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

Diff of /linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3296 by schoenebeck, Wed Jun 28 09:45:56 2017 UTC revision 3360 by schoenebeck, Fri Oct 27 21:19:18 2017 UTC
# Line 838  namespace LinuxSampler { Line 838  namespace LinuxSampler {
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          }          }
# Line 925  namespace LinuxSampler { Line 924  namespace LinuxSampler {
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          }          }
# Line 1012  namespace LinuxSampler { Line 1010  namespace LinuxSampler {
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          }          }
# Line 1177  namespace LinuxSampler { Line 1174  namespace LinuxSampler {
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                        true, 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                        true, 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                        true, 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                        true, 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                        true, 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) {
# Line 1195  namespace LinuxSampler { Line 1237  namespace LinuxSampler {
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) {
# Line 1231  namespace LinuxSampler { Line 1291  namespace LinuxSampler {
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 {
# Line 1332  namespace LinuxSampler { Line 1401  namespace LinuxSampler {
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)

Legend:
Removed from v.3296  
changed lines
  Added in v.3360

  ViewVC Help
Powered by ViewVC