Page 2 of 2
Re: Setup priority on MIDI Execution - Delay?
Posted: Wed Apr 29, 2015 8:43 pm
by nix
It's fine to delay triggers-
even MIDI(with Ruby) I imagine.
It's not necessary here though, the link order thing should be fine IMO
If the changes are too fast, and it doesn't work right,
you can introduce a 'timer' if needed, on the trigger
Nice idea
Re: Setup priority on MIDI Execution - Delay?
Posted: Thu Apr 30, 2015 1:51 pm
by Walter Sommerfeld
maybe the R&D primitive: Midi Buffer
could help here...
Flush the second buffer after a short delay?!
Re: Setup priority on MIDI Execution - Delay?
Posted: Thu Apr 30, 2015 2:38 pm
by KG_is_back
You may use Ruby, to order midi messages in specific order, if they arrive at the same time.
For example this code will accumulate all note on and note off messages that arrive at the same time and order them properly, that all note on preceed note off. Other messages (like CC) are simply passed as they are
input midiIn, output midiOut
Code: Select all
def init
@noteon=[]
@noteof=[]
end
def event i,v,t
if i==0 #ariving messages
midi=@in.to_array
if midi[0]==144
@noteon << midi
input 99,nil #schedule buffers emptying after all notes are received
elsif midi[0]=128
@noteof<< midi
input 99,nil #schedule buffers emptying after all notes are received
else
output @in
end
elsif i==99 #clear buffer
@noteon.each{|note|
output Midi.new(note[0],note[1],note[2],note[3])}
@noteof.each{|note|
output Midi.new(note[0],note[1],note[2],note[3])}
@noteon=[]
@noteof=[]
end
end