Script advice

Is it possible to trigger a timer from a note on?. At the end of the timer ‘something’ could happen, such as a program change or CC change


1 Like

Here’s a small example of a note triggering a Control Change message after 300ms.

   M1 : MidiInBlock
   R : Ramp
   A : MidiMessage

//Called when a NoteOn message is received at some MidiIn block
On NoteOnEvent(m : NoteMessage) from M1
SendNow(M1,m) // This sends the note. Remove if you don't want the note triggered.
TriggerOneShotRamp(R,300,10) // This sets the ramp for 300ms

// Called by function generator at the end of each cycle
On GeneratorEndCycle(timeX : integer) from R
A = MakeControlChangeMessage(99,127)
SendNow(M1, A) // This sends CC 99 127 to the MidiIn Block