Setup priority on MIDI Execution - Delay?

For general discussion related FlowStone
User avatar
nix
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Setup priority on MIDI Execution - Delay?

Post 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
User avatar
Walter Sommerfeld
Posts: 250
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany
Contact:

Re: Setup priority on MIDI Execution - Delay?

Post by Walter Sommerfeld »

maybe the R&D primitive: Midi Buffer

could help here...

Flush the second buffer after a short delay?!
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Setup priority on MIDI Execution - Delay?

Post 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


Post Reply