838 |
|
|
839 |
VMFnResult* InstrumentScriptVMFunction_change_attack::exec(VMFnArgs* args) { |
VMFnResult* InstrumentScriptVMFunction_change_attack::exec(VMFnArgs* args) { |
840 |
int attack = args->arg(1)->asInt()->evalInt(); |
int attack = args->arg(1)->asInt()->evalInt(); |
841 |
if (attack > VM_EG_PAR_MAX_VALUE) { |
// note: intentionally not checking against a max. value here! |
842 |
wrnMsg("change_attack(): argument 2 may not be larger than 1000000"); |
// (to allow i.e. passing 2000000 for doubling the attack time) |
843 |
attack = VM_EG_PAR_MAX_VALUE; |
if (attack < 0) { |
|
} else if (attack < 0) { |
|
844 |
wrnMsg("change_attack(): argument 2 may not be negative"); |
wrnMsg("change_attack(): argument 2 may not be negative"); |
845 |
attack = 0; |
attack = 0; |
846 |
} |
} |
924 |
|
|
925 |
VMFnResult* InstrumentScriptVMFunction_change_decay::exec(VMFnArgs* args) { |
VMFnResult* InstrumentScriptVMFunction_change_decay::exec(VMFnArgs* args) { |
926 |
int decay = args->arg(1)->asInt()->evalInt(); |
int decay = args->arg(1)->asInt()->evalInt(); |
927 |
if (decay > VM_EG_PAR_MAX_VALUE) { |
// note: intentionally not checking against a max. value here! |
928 |
wrnMsg("change_decay(): argument 2 may not be larger than 1000000"); |
// (to allow i.e. passing 2000000 for doubling the decay time) |
929 |
decay = VM_EG_PAR_MAX_VALUE; |
if (decay < 0) { |
|
} else if (decay < 0) { |
|
930 |
wrnMsg("change_decay(): argument 2 may not be negative"); |
wrnMsg("change_decay(): argument 2 may not be negative"); |
931 |
decay = 0; |
decay = 0; |
932 |
} |
} |
1010 |
|
|
1011 |
VMFnResult* InstrumentScriptVMFunction_change_release::exec(VMFnArgs* args) { |
VMFnResult* InstrumentScriptVMFunction_change_release::exec(VMFnArgs* args) { |
1012 |
int release = args->arg(1)->asInt()->evalInt(); |
int release = args->arg(1)->asInt()->evalInt(); |
1013 |
if (release > VM_EG_PAR_MAX_VALUE) { |
// note: intentionally not checking against a max. value here! |
1014 |
wrnMsg("change_release(): argument 2 may not be larger than 1000000"); |
// (to allow i.e. passing 2000000 for doubling the release time) |
1015 |
release = VM_EG_PAR_MAX_VALUE; |
if (release < 0) { |
|
} else if (release < 0) { |
|
1016 |
wrnMsg("change_release(): argument 2 may not be negative"); |
wrnMsg("change_release(): argument 2 may not be negative"); |
1017 |
release = 0; |
release = 0; |
1018 |
} |
} |
1174 |
return successResult(); |
return successResult(); |
1175 |
} |
} |
1176 |
|
|
1177 |
|
// change_sustain() function |
1178 |
|
|
1179 |
|
VMFnResult* InstrumentScriptVMFunction_change_sustain::exec(VMFnArgs* args) { |
1180 |
|
return VMChangeSynthParamFunction::execTemplate< |
1181 |
|
&NoteBase::_Override::Sustain, |
1182 |
|
Event::synth_param_sustain, |
1183 |
|
false, NO_LIMIT, 0>( args, "change_sustain" ); |
1184 |
|
} |
1185 |
|
|
1186 |
|
// change_cutoff_attack() function |
1187 |
|
|
1188 |
|
VMFnResult* InstrumentScriptVMFunction_change_cutoff_attack::exec(VMFnArgs* args) { |
1189 |
|
return VMChangeSynthParamFunction::execTemplate< |
1190 |
|
&NoteBase::_Override::CutoffAttack, |
1191 |
|
Event::synth_param_cutoff_attack, |
1192 |
|
false, NO_LIMIT, 0>( args, "change_cutoff_attack" ); |
1193 |
|
} |
1194 |
|
|
1195 |
|
// change_cutoff_decay() function |
1196 |
|
|
1197 |
|
VMFnResult* InstrumentScriptVMFunction_change_cutoff_decay::exec(VMFnArgs* args) { |
1198 |
|
return VMChangeSynthParamFunction::execTemplate< |
1199 |
|
&NoteBase::_Override::CutoffDecay, |
1200 |
|
Event::synth_param_cutoff_decay, |
1201 |
|
false, NO_LIMIT, 0>( args, "change_cutoff_decay" ); |
1202 |
|
} |
1203 |
|
|
1204 |
|
// change_cutoff_sustain() function |
1205 |
|
|
1206 |
|
VMFnResult* InstrumentScriptVMFunction_change_cutoff_sustain::exec(VMFnArgs* args) { |
1207 |
|
return VMChangeSynthParamFunction::execTemplate< |
1208 |
|
&NoteBase::_Override::CutoffSustain, |
1209 |
|
Event::synth_param_cutoff_sustain, |
1210 |
|
false, NO_LIMIT, 0>( args, "change_cutoff_sustain" ); |
1211 |
|
} |
1212 |
|
|
1213 |
|
// change_cutoff_release() function |
1214 |
|
|
1215 |
|
VMFnResult* InstrumentScriptVMFunction_change_cutoff_release::exec(VMFnArgs* args) { |
1216 |
|
return VMChangeSynthParamFunction::execTemplate< |
1217 |
|
&NoteBase::_Override::CutoffRelease, |
1218 |
|
Event::synth_param_cutoff_release, |
1219 |
|
false, NO_LIMIT, 0>( args, "change_cutoff_release" ); |
1220 |
|
} |
1221 |
|
|
1222 |
// change_amp_lfo_depth() function |
// change_amp_lfo_depth() function |
1223 |
|
|
1224 |
VMFnResult* InstrumentScriptVMFunction_change_amp_lfo_depth::exec(VMFnArgs* args) { |
VMFnResult* InstrumentScriptVMFunction_change_amp_lfo_depth::exec(VMFnArgs* args) { |
1237 |
true, 1000000, 0>( args, "change_amp_lfo_freq" ); |
true, 1000000, 0>( args, "change_amp_lfo_freq" ); |
1238 |
} |
} |
1239 |
|
|
1240 |
|
// change_cutoff_lfo_depth() function |
1241 |
|
|
1242 |
|
VMFnResult* InstrumentScriptVMFunction_change_cutoff_lfo_depth::exec(VMFnArgs* args) { |
1243 |
|
return VMChangeSynthParamFunction::execTemplate< |
1244 |
|
&NoteBase::_Override::CutoffLFODepth, |
1245 |
|
Event::synth_param_cutoff_lfo_depth, |
1246 |
|
true, 1000000, 0>( args, "change_cutoff_lfo_depth" ); |
1247 |
|
} |
1248 |
|
|
1249 |
|
// change_cutoff_lfo_freq() function |
1250 |
|
|
1251 |
|
VMFnResult* InstrumentScriptVMFunction_change_cutoff_lfo_freq::exec(VMFnArgs* args) { |
1252 |
|
return VMChangeSynthParamFunction::execTemplate< |
1253 |
|
&NoteBase::_Override::CutoffLFOFreq, |
1254 |
|
Event::synth_param_cutoff_lfo_freq, |
1255 |
|
true, 1000000, 0>( args, "change_cutoff_lfo_freq" ); |
1256 |
|
} |
1257 |
|
|
1258 |
// change_pitch_lfo_depth() function |
// change_pitch_lfo_depth() function |
1259 |
|
|
1260 |
VMFnResult* InstrumentScriptVMFunction_change_pitch_lfo_depth::exec(VMFnArgs* args) { |
VMFnResult* InstrumentScriptVMFunction_change_pitch_lfo_depth::exec(VMFnArgs* args) { |
1291 |
false, NO_LIMIT, 0>( args, "change_tune_time" ); |
false, NO_LIMIT, 0>( args, "change_tune_time" ); |
1292 |
} |
} |
1293 |
|
|
1294 |
|
// change_pan_time() function |
1295 |
|
|
1296 |
|
VMFnResult* InstrumentScriptVMFunction_change_pan_time::exec(VMFnArgs* args) { |
1297 |
|
return VMChangeSynthParamFunction::execTemplate< |
1298 |
|
&NoteBase::_Override::PanTime, |
1299 |
|
Event::synth_param_pan_time, |
1300 |
|
false, NO_LIMIT, 0>( args, "change_pan_time" ); |
1301 |
|
} |
1302 |
|
|
1303 |
// template for change_*_curve() functions |
// template for change_*_curve() functions |
1304 |
|
|
1305 |
bool VMChangeFadeCurveFunction::acceptsArgType(int iArg, ExprType_t type) const { |
bool VMChangeFadeCurveFunction::acceptsArgType(int iArg, ExprType_t type) const { |
1401 |
Event::synth_param_pitch_curve>( args, "change_tune_curve" ); |
Event::synth_param_pitch_curve>( args, "change_tune_curve" ); |
1402 |
} |
} |
1403 |
|
|
1404 |
|
// change_pan_curve() function |
1405 |
|
|
1406 |
|
VMFnResult* InstrumentScriptVMFunction_change_pan_curve::exec(VMFnArgs* args) { |
1407 |
|
return VMChangeFadeCurveFunction::execTemplate< |
1408 |
|
&NoteBase::_Override::PanCurve, |
1409 |
|
Event::synth_param_pan_curve>( args, "change_pan_curve" ); |
1410 |
|
} |
1411 |
|
|
1412 |
// fade_in() function |
// fade_in() function |
1413 |
|
|
1414 |
InstrumentScriptVMFunction_fade_in::InstrumentScriptVMFunction_fade_in(InstrumentScriptVM* parent) |
InstrumentScriptVMFunction_fade_in::InstrumentScriptVMFunction_fade_in(InstrumentScriptVM* parent) |