Re: Turning a micro computer system into MIDI device
Posted: Sat Nov 28, 2015 8:06 pm
Sorry... i didn't mean the code from above but the concept of passing the messages you don't want to filter or treat...
If the status is 128 or 144 then apply the filter on the event... otherwise let it pass...
"output Midi.new m[0],m[1],m[2],m[3]" is the equivlent of "MIDI.send(type,d1,d2,channel)" in the Arduino/Teensy code.
FYI - on the green side but unrelated to your issue; you only need a trigger switch on the trigger stream... the MIDI split and event primitives can have their integer values connected directly and it will only be output when the trigger is allowed through by the (single) switch.
Code: Select all
def event i
m = @midiInput.to_array
if (m[0] == 144) || (m[0] == 128)
output Midi.new m[0],m[1],m[2],m[3] if m[2]>@thresh1
else
output Midi.new m[0],m[1],m[2],m[3]
end
endIf the status is 128 or 144 then apply the filter on the event... otherwise let it pass...
"output Midi.new m[0],m[1],m[2],m[3]" is the equivlent of "MIDI.send(type,d1,d2,channel)" in the Arduino/Teensy code.
FYI - on the green side but unrelated to your issue; you only need a trigger switch on the trigger stream... the MIDI split and event primitives can have their integer values connected directly and it will only be output when the trigger is allowed through by the (single) switch.