/[svn]/linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h
ViewVC logotype

Annotation of /linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3561 - (hide annotations) (download) (as text)
Fri Aug 23 11:44:00 2019 UTC (4 years, 7 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 25939 byte(s)
NKSP: Added standard units support for numbers and final "!" operator:

* NKSP strictness: Variable names, function names and preprocessor condition
  names must start with a regular character (a-z or A-Z); starting them with
  a digit or underscore is no longer allowed.

* NKSP parser fix: equal comparison operator "=" and not equal comparison
  operator "#" must only accept integer operands.

* NKSP language: Implemented support for standard units like Hertz, seconds,
  Bel including support for metric unit prefixes; so one can now e.g.
  conveniently use numbers in scripts like "5us" meaning "5 microseconds",
  or e.g. "12kHz" meaning "12 kilo Hertz", or e.g. "-14mdB" meaning
  "minus 14 Millidecibel", or e.g. "28c" meaning "28 cents" (for tuning).

* NKSP language: Introduced "final" operator "!" which is specifically
  intended for synthesis parameter values to denote that the synthesis
  parameter value is intended to be the "final" value for that synthesis
  parameter that should explicitly be used by the engine and thus causing
  the sampler engine to ignore all other modulation sources for the same
  synthesis parameter (like e.g. LFO, EG); by simply prefixing a value,
  variable or formula with this new "!" operator the expression is marked as
  being "final".

* Bumped version (2.1.1.svn4).

1 schoenebeck 2596 /*
2 persson 3455 * Copyright (c) 2014 - 2019 Christian Schoenebeck
3 schoenebeck 2596 *
4     * http://www.linuxsampler.org
5     *
6     * This file is part of LinuxSampler and released under the same terms.
7     * See README file for details.
8     */
9    
10     #ifndef LS_INSTRSCRIPTVMFUNCTIONS_H
11     #define LS_INSTRSCRIPTVMFUNCTIONS_H
12    
13     #include "../../common/global.h"
14     #include "../../scriptvm/CoreVMFunctions.h"
15 schoenebeck 3118 #include "Note.h"
16 schoenebeck 2596
17     namespace LinuxSampler {
18    
19 schoenebeck 2630 class EventGroup;
20 schoenebeck 2596 class InstrumentScriptVM;
21    
22 schoenebeck 2598 class InstrumentScriptVMFunction_play_note : public VMIntResultFunction {
23 schoenebeck 2596 public:
24     InstrumentScriptVMFunction_play_note(InstrumentScriptVM* parent);
25 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
26     vmint maxAllowedArgs() const OVERRIDE { return 4; }
27     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
28     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
29     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
30 schoenebeck 2596 protected:
31     InstrumentScriptVM* m_vm;
32     };
33    
34 schoenebeck 2600 class InstrumentScriptVMFunction_set_controller : public VMIntResultFunction {
35     public:
36     InstrumentScriptVMFunction_set_controller(InstrumentScriptVM* parent);
37 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
38     vmint maxAllowedArgs() const OVERRIDE { return 2; }
39     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
40     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
41     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
42 schoenebeck 2600 protected:
43     InstrumentScriptVM* m_vm;
44     };
45    
46 schoenebeck 2598 class InstrumentScriptVMFunction_ignore_event : public VMEmptyResultFunction {
47     public:
48     InstrumentScriptVMFunction_ignore_event(InstrumentScriptVM* parent);
49 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 0; }
50     vmint maxAllowedArgs() const OVERRIDE { return 1; }
51     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
52     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
53     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
54 schoenebeck 2598 protected:
55     InstrumentScriptVM* m_vm;
56     };
57    
58     class InstrumentScriptVMFunction_ignore_controller : public VMEmptyResultFunction {
59     public:
60     InstrumentScriptVMFunction_ignore_controller(InstrumentScriptVM* parent);
61 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 0; }
62     vmint maxAllowedArgs() const OVERRIDE { return 1; }
63     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
64     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
65     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
66 schoenebeck 2598 protected:
67     InstrumentScriptVM* m_vm;
68     };
69    
70 schoenebeck 2629 class InstrumentScriptVMFunction_note_off : public VMEmptyResultFunction {
71     public:
72     InstrumentScriptVMFunction_note_off(InstrumentScriptVM* parent);
73 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
74     vmint maxAllowedArgs() const OVERRIDE { return 2; }
75     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
76     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
77     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
78 schoenebeck 2630 protected:
79     InstrumentScriptVM* m_vm;
80     };
81    
82     class InstrumentScriptVMFunction_set_event_mark : public VMEmptyResultFunction {
83     public:
84     InstrumentScriptVMFunction_set_event_mark(InstrumentScriptVM* parent);
85 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
86     vmint maxAllowedArgs() const OVERRIDE { return 2; }
87     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
88     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
89     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
90 schoenebeck 2629 protected:
91     InstrumentScriptVM* m_vm;
92     };
93    
94 schoenebeck 2630 class InstrumentScriptVMFunction_delete_event_mark : public VMEmptyResultFunction {
95     public:
96     InstrumentScriptVMFunction_delete_event_mark(InstrumentScriptVM* parent);
97 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
98     vmint maxAllowedArgs() const OVERRIDE { return 2; }
99     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
100     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
101     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
102 schoenebeck 2630 protected:
103     InstrumentScriptVM* m_vm;
104     };
105    
106     class InstrumentScriptVMFunction_by_marks : public VMFunction {
107     public:
108     InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent);
109 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
110     vmint maxAllowedArgs() const OVERRIDE { return 1; }
111     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
112     bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
113     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
114 schoenebeck 3054 ExprType_t returnType() OVERRIDE { return INT_ARR_EXPR; }
115     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
116 schoenebeck 2630 protected:
117     InstrumentScriptVM* m_vm;
118     class Result : public VMFnResult, public VMIntArrayExpr {
119     public:
120     StmtFlags_t flags;
121     EventGroup* eventGroup;
122    
123 schoenebeck 3557 vmint arraySize() const OVERRIDE;
124     vmint evalIntElement(vmuint i) OVERRIDE;
125     void assignIntElement(vmuint i, vmint value) OVERRIDE {} // ignore assignment
126 schoenebeck 2630 VMExpr* resultValue() OVERRIDE { return this; }
127 schoenebeck 3054 StmtFlags_t resultFlags() OVERRIDE { return flags; }
128 schoenebeck 2945 bool isConstExpr() const OVERRIDE { return false; }
129 schoenebeck 2630 } m_result;
130    
131     VMFnResult* errorResult();
132     VMFnResult* successResult(EventGroup* eventGroup);
133     };
134    
135 schoenebeck 2931 class InstrumentScriptVMFunction_change_vol : public VMEmptyResultFunction {
136     public:
137     InstrumentScriptVMFunction_change_vol(InstrumentScriptVM* parent);
138 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
139     vmint maxAllowedArgs() const OVERRIDE { return 3; }
140     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
141 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
142     bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE;
143     bool acceptsArgFinal(vmint iArg) const OVERRIDE;
144 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
145     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
146 schoenebeck 2931 protected:
147     InstrumentScriptVM* m_vm;
148     };
149    
150     class InstrumentScriptVMFunction_change_tune : public VMEmptyResultFunction {
151     public:
152     InstrumentScriptVMFunction_change_tune(InstrumentScriptVM* parent);
153 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
154     vmint maxAllowedArgs() const OVERRIDE { return 3; }
155     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
156 schoenebeck 3561 bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE;
157     bool acceptsArgFinal(vmint iArg) const OVERRIDE;
158 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
159     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
160 schoenebeck 2931 protected:
161     InstrumentScriptVM* m_vm;
162     };
163    
164     class InstrumentScriptVMFunction_change_pan : public VMEmptyResultFunction {
165     public:
166     InstrumentScriptVMFunction_change_pan(InstrumentScriptVM* parent);
167 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
168     vmint maxAllowedArgs() const OVERRIDE { return 3; }
169     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
170 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
171 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
172     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
173 schoenebeck 2931 protected:
174     InstrumentScriptVM* m_vm;
175     };
176    
177 schoenebeck 2935 class InstrumentScriptVMFunction_change_cutoff : public VMEmptyResultFunction {
178     public:
179     InstrumentScriptVMFunction_change_cutoff(InstrumentScriptVM* parent);
180 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
181     vmint maxAllowedArgs() const OVERRIDE { return 2; }
182     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
183 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
184     bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE;
185     bool acceptsArgFinal(vmint iArg) const OVERRIDE;
186 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
187     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
188 schoenebeck 2935 protected:
189     InstrumentScriptVM* m_vm;
190     };
191    
192     class InstrumentScriptVMFunction_change_reso : public VMEmptyResultFunction {
193     public:
194     InstrumentScriptVMFunction_change_reso(InstrumentScriptVM* parent);
195 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
196     vmint maxAllowedArgs() const OVERRIDE { return 2; }
197     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
198 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
199 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
200     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
201 schoenebeck 2935 protected:
202     InstrumentScriptVM* m_vm;
203     };
204 schoenebeck 2953
205     class InstrumentScriptVMFunction_change_attack : public VMEmptyResultFunction {
206     public:
207     InstrumentScriptVMFunction_change_attack(InstrumentScriptVM* parent);
208 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
209     vmint maxAllowedArgs() const OVERRIDE { return 2; }
210     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
211 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
212     bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE;
213     bool acceptsArgFinal(vmint iArg) const OVERRIDE;
214 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
215     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
216 schoenebeck 2953 protected:
217     InstrumentScriptVM* m_vm;
218     };
219 schoenebeck 2935
220 schoenebeck 2953 class InstrumentScriptVMFunction_change_decay : public VMEmptyResultFunction {
221     public:
222     InstrumentScriptVMFunction_change_decay(InstrumentScriptVM* parent);
223 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
224     vmint maxAllowedArgs() const OVERRIDE { return 2; }
225     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
226 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
227     bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE;
228     bool acceptsArgFinal(vmint iArg) const OVERRIDE;
229 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
230     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
231 schoenebeck 2953 protected:
232     InstrumentScriptVM* m_vm;
233     };
234    
235     class InstrumentScriptVMFunction_change_release : public VMEmptyResultFunction {
236     public:
237     InstrumentScriptVMFunction_change_release(InstrumentScriptVM* parent);
238 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
239     vmint maxAllowedArgs() const OVERRIDE { return 2; }
240     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
241 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
242     bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE;
243     bool acceptsArgFinal(vmint iArg) const OVERRIDE;
244 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
245     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
246 schoenebeck 2953 protected:
247     InstrumentScriptVM* m_vm;
248     };
249    
250 schoenebeck 3118 class VMChangeSynthParamFunction : public VMEmptyResultFunction {
251     public:
252 schoenebeck 3561 VMChangeSynthParamFunction(InstrumentScriptVM* parent, bool acceptFinal, StdUnit_t unit)
253     : m_vm(parent), m_acceptFinal(acceptFinal), m_unit(unit) {}
254 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
255     vmint maxAllowedArgs() const OVERRIDE { return 2; }
256     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
257 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
258     bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE;
259     bool acceptsArgFinal(vmint iArg) const OVERRIDE;
260 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
261 schoenebeck 3118
262 schoenebeck 3561 template<class T_NoteParamType, T_NoteParamType NoteBase::_Override::*T_noteParam,
263     vmint T_synthParam,
264     vmint T_minValueNorm, vmint T_maxValueNorm, bool T_normalizeNorm,
265     vmint T_minValueUnit, vmint T_maxValueUnit,
266     MetricPrefix_t T_unitPrefix0, MetricPrefix_t ... T_unitPrefixN>
267 schoenebeck 3118 VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);
268     protected:
269     InstrumentScriptVM* m_vm;
270 schoenebeck 3561 const bool m_acceptFinal;
271     const StdUnit_t m_unit;
272 schoenebeck 3118 };
273    
274 schoenebeck 3316 class InstrumentScriptVMFunction_change_sustain : public VMChangeSynthParamFunction {
275     public:
276 schoenebeck 3561 InstrumentScriptVMFunction_change_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_BEL) {}
277 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
278 schoenebeck 3316 };
279    
280 schoenebeck 3360 class InstrumentScriptVMFunction_change_cutoff_attack : public VMChangeSynthParamFunction {
281     public:
282 schoenebeck 3561 InstrumentScriptVMFunction_change_cutoff_attack(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND) {}
283 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
284 schoenebeck 3360 };
285    
286     class InstrumentScriptVMFunction_change_cutoff_decay : public VMChangeSynthParamFunction {
287     public:
288 schoenebeck 3561 InstrumentScriptVMFunction_change_cutoff_decay(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND) {}
289 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
290 schoenebeck 3360 };
291    
292     class InstrumentScriptVMFunction_change_cutoff_sustain : public VMChangeSynthParamFunction {
293     public:
294 schoenebeck 3561 InstrumentScriptVMFunction_change_cutoff_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_BEL) {}
295 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
296 schoenebeck 3360 };
297    
298     class InstrumentScriptVMFunction_change_cutoff_release : public VMChangeSynthParamFunction {
299     public:
300 schoenebeck 3561 InstrumentScriptVMFunction_change_cutoff_release(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND) {}
301 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
302 schoenebeck 3360 };
303    
304 schoenebeck 3118 class InstrumentScriptVMFunction_change_amp_lfo_depth : public VMChangeSynthParamFunction {
305     public:
306 schoenebeck 3561 InstrumentScriptVMFunction_change_amp_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT) {}
307 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
308 schoenebeck 3118 };
309    
310     class InstrumentScriptVMFunction_change_amp_lfo_freq : public VMChangeSynthParamFunction {
311     public:
312 schoenebeck 3561 InstrumentScriptVMFunction_change_amp_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ) {}
313 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
314 schoenebeck 3118 };
315    
316 schoenebeck 3360 class InstrumentScriptVMFunction_change_cutoff_lfo_depth : public VMChangeSynthParamFunction {
317     public:
318 schoenebeck 3561 InstrumentScriptVMFunction_change_cutoff_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT) {}
319 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
320 schoenebeck 3360 };
321    
322     class InstrumentScriptVMFunction_change_cutoff_lfo_freq : public VMChangeSynthParamFunction {
323     public:
324 schoenebeck 3561 InstrumentScriptVMFunction_change_cutoff_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ) {}
325 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
326 schoenebeck 3360 };
327    
328 schoenebeck 3118 class InstrumentScriptVMFunction_change_pitch_lfo_depth : public VMChangeSynthParamFunction {
329     public:
330 schoenebeck 3561 InstrumentScriptVMFunction_change_pitch_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT) {}
331 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
332 schoenebeck 3118 };
333    
334     class InstrumentScriptVMFunction_change_pitch_lfo_freq : public VMChangeSynthParamFunction {
335     public:
336 schoenebeck 3561 InstrumentScriptVMFunction_change_pitch_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ) {}
337 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
338 schoenebeck 3118 };
339    
340 schoenebeck 3188 class InstrumentScriptVMFunction_change_vol_time : public VMChangeSynthParamFunction {
341     public:
342 schoenebeck 3561 InstrumentScriptVMFunction_change_vol_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND) {}
343 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
344 schoenebeck 3188 };
345    
346     class InstrumentScriptVMFunction_change_tune_time : public VMChangeSynthParamFunction {
347     public:
348 schoenebeck 3561 InstrumentScriptVMFunction_change_tune_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND) {}
349 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
350 schoenebeck 3188 };
351    
352 schoenebeck 3335 class InstrumentScriptVMFunction_change_pan_time : public VMChangeSynthParamFunction {
353     public:
354 schoenebeck 3561 InstrumentScriptVMFunction_change_pan_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND) {}
355 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
356 schoenebeck 3335 };
357    
358 schoenebeck 3246 class VMChangeFadeCurveFunction : public VMEmptyResultFunction {
359     public:
360     VMChangeFadeCurveFunction(InstrumentScriptVM* parent) : m_vm(parent) {}
361 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
362     vmint maxAllowedArgs() const OVERRIDE { return 2; }
363     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
364     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
365 schoenebeck 3246
366 schoenebeck 3557 template<fade_curve_t NoteBase::_Override::*T_noteParam, vmint T_synthParam>
367 schoenebeck 3246 VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);
368     protected:
369     InstrumentScriptVM* m_vm;
370     };
371    
372     class InstrumentScriptVMFunction_change_vol_curve : public VMChangeFadeCurveFunction {
373     public:
374     InstrumentScriptVMFunction_change_vol_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
375 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
376 schoenebeck 3246 };
377    
378     class InstrumentScriptVMFunction_change_tune_curve : public VMChangeFadeCurveFunction {
379     public:
380     InstrumentScriptVMFunction_change_tune_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
381 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
382 schoenebeck 3246 };
383    
384 schoenebeck 3335 class InstrumentScriptVMFunction_change_pan_curve : public VMChangeFadeCurveFunction {
385     public:
386     InstrumentScriptVMFunction_change_pan_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
387 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
388 schoenebeck 3335 };
389    
390 schoenebeck 3188 class InstrumentScriptVMFunction_fade_in : public VMEmptyResultFunction {
391     public:
392     InstrumentScriptVMFunction_fade_in(InstrumentScriptVM* parent);
393 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
394     vmint maxAllowedArgs() const OVERRIDE { return 2; }
395     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
396 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
397     bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE;
398 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
399     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
400 schoenebeck 3188 protected:
401     InstrumentScriptVM* m_vm;
402     };
403    
404     class InstrumentScriptVMFunction_fade_out : public VMEmptyResultFunction {
405     public:
406     InstrumentScriptVMFunction_fade_out(InstrumentScriptVM* parent);
407 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
408     vmint maxAllowedArgs() const OVERRIDE { return 3; }
409     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
410 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
411     bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE;
412 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
413     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
414 schoenebeck 3188 protected:
415     InstrumentScriptVM* m_vm;
416     };
417    
418 schoenebeck 3193 class InstrumentScriptVMFunction_get_event_par : public VMIntResultFunction {
419     public:
420     InstrumentScriptVMFunction_get_event_par(InstrumentScriptVM* parent);
421 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
422     vmint maxAllowedArgs() const OVERRIDE { return 2; }
423     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
424     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
425     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
426 schoenebeck 3193 protected:
427     InstrumentScriptVM* m_vm;
428     };
429    
430     class InstrumentScriptVMFunction_set_event_par : public VMEmptyResultFunction {
431     public:
432     InstrumentScriptVMFunction_set_event_par(InstrumentScriptVM* parent);
433 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 3; }
434     vmint maxAllowedArgs() const OVERRIDE { return 3; }
435     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
436     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
437     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
438 schoenebeck 3193 protected:
439     InstrumentScriptVM* m_vm;
440     };
441    
442 schoenebeck 3214 class InstrumentScriptVMFunction_change_note : public VMEmptyResultFunction {
443     public:
444     InstrumentScriptVMFunction_change_note(InstrumentScriptVM* parent);
445 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
446     vmint maxAllowedArgs() const OVERRIDE { return 2; }
447     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
448     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
449     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
450 schoenebeck 3214 protected:
451     InstrumentScriptVM* m_vm;
452     };
453    
454     class InstrumentScriptVMFunction_change_velo : public VMEmptyResultFunction {
455     public:
456     InstrumentScriptVMFunction_change_velo(InstrumentScriptVM* parent);
457 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
458     vmint maxAllowedArgs() const OVERRIDE { return 2; }
459     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
460     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
461     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
462 schoenebeck 3214 protected:
463     InstrumentScriptVM* m_vm;
464     };
465    
466 schoenebeck 3255 class InstrumentScriptVMFunction_change_play_pos : public VMEmptyResultFunction {
467     public:
468     InstrumentScriptVMFunction_change_play_pos(InstrumentScriptVM* parent);
469 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
470     vmint maxAllowedArgs() const OVERRIDE { return 2; }
471     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
472 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
473     bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE;
474 schoenebeck 3557 ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
475     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
476 schoenebeck 3255 protected:
477     InstrumentScriptVM* m_vm;
478     };
479    
480 schoenebeck 2935 class InstrumentScriptVMFunction_event_status : public VMIntResultFunction {
481     public:
482     InstrumentScriptVMFunction_event_status(InstrumentScriptVM* parent);
483 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
484     vmint maxAllowedArgs() const OVERRIDE { return 1; }
485     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
486     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
487     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
488 schoenebeck 2935 protected:
489     InstrumentScriptVM* m_vm;
490     };
491    
492 schoenebeck 3296 class InstrumentScriptVMFunction_callback_status : public VMIntResultFunction {
493     public:
494     InstrumentScriptVMFunction_callback_status(InstrumentScriptVM* parent);
495 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
496     vmint maxAllowedArgs() const OVERRIDE { return 1; }
497     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
498     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
499     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
500 schoenebeck 3296 protected:
501     InstrumentScriptVM* m_vm;
502     };
503    
504 schoenebeck 2948 // overrides core wait() implementation
505     class InstrumentScriptVMFunction_wait : public CoreVMFunction_wait {
506     public:
507     InstrumentScriptVMFunction_wait(InstrumentScriptVM* parent);
508 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
509 schoenebeck 2948 };
510    
511     class InstrumentScriptVMFunction_stop_wait : public VMEmptyResultFunction {
512     public:
513     InstrumentScriptVMFunction_stop_wait(InstrumentScriptVM* parent);
514 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
515     vmint maxAllowedArgs() const OVERRIDE { return 2; }
516     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
517     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
518     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
519 schoenebeck 2948 protected:
520     InstrumentScriptVM* m_vm;
521     };
522    
523 schoenebeck 3277 class InstrumentScriptVMFunction_abort : public VMEmptyResultFunction {
524     public:
525     InstrumentScriptVMFunction_abort(InstrumentScriptVM* parent);
526 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
527     vmint maxAllowedArgs() const OVERRIDE { return 1; }
528     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
529     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
530 schoenebeck 3277 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
531     protected:
532     InstrumentScriptVM* m_vm;
533     };
534    
535 schoenebeck 3293 class InstrumentScriptVMFunction_fork : public VMIntResultFunction {
536     public:
537     InstrumentScriptVMFunction_fork(InstrumentScriptVM* parent);
538 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 0; }
539     vmint maxAllowedArgs() const OVERRIDE { return 2; }
540     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
541     ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
542     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
543 schoenebeck 3293 protected:
544     InstrumentScriptVM* m_vm;
545     };
546    
547 schoenebeck 2596 } // namespace LinuxSampler
548    
549     #endif // LS_INSTRSCRIPTVMFUNCTIONS_H

  ViewVC Help
Powered by ViewVC