This is the function:
Code: Select all
fn onCC( $chan, $cc, $value ){
sprintf(midi_last, "CC%i(%i) chan(%i)", $cc, $value, $chan )
fputs(midi_last)
$index = modules[$chan]
$name = dlcall(svl, sv_get_module_name, 0, $index )
$ctlname = dlcall(svl, sv_get_module_ctl_name, 0,$index, $cc )
sprintf(ts,"\n => setting %s of %s to %i\n",$ctlname,$name,$value)
fputs(ts)
/*
sv_send_event() - send some event (note ON, note OFF, controller change, etc.)
Parameters:
slot;
track_num - track number within the pattern;
note: 0 - nothing; 1..127 - note num; 128 - note off; 129, 130... - see NOTECMD_xxx defines;
vel: velocity 1..129; 0 - default;
module: 0 - nothing; 1..255 - module number + 1;
ctl: 0xCCEE. CC - number of a controller (1..255). EE - effect;
ctl_val: value of controller or effect.
*/
dlcall( svl, sv_send_event, 0 /*slot*/, 0 /*tracknum*/, 0 /*note*/, 0 /*vel*/, $index+1, $cc+1, $value )
// ^--- how to convert to 0xCCEE ?
}