I have scripted a scene with only one trigger, but many cursors running through it on their respective paths. I want the trigger to transmit a MIDI note number (I have to use midi instead of OSC because Reaktor won’t accept osc when run as a plugin) based on cursor running through it. For some reason, the note number is mapped between 0-1 and not 0-127. This is where i’m stuck:
run("add trigger 1020");
run("setpos current 0 0 0");
run("setmessage current 1, midi://midi_out/notef 1 "+ (cursor_id/127));
You can see i’ve tried to map note number to 0-1 range by dividing it by 127. This doesn’t work though. Strangely I get output with note number 63: midi://from_iannix/notef 1 63 (Eb4) 12 1 (1 s.).
I’ve also tried plain and simple run("setmessage current 1, midi://midi_out/notef 1 cursor_id"); but it gives me always note number 127 since my cursor id’s go from 1-24.
I don’t get it. How do I perform calculations with cursor_id?
Be aware that you’re using /notef in floating format (‘f’ => needs values between 0. and 1.). You can also use the /note that uses integers (between 0 and 127). So it could look like: run("setmessage current 1, midi://midi_out/note 1 cursor_id");