MIDI Out - automatically pair MIDI note-on and note-off messages?


So I’ve been using MIDI out quite a bit, and have a (stupid) question: I’m assuming the trick to effectively using MIDI out and not locking things up is to make sure that all MIDI note-on messages get matching MIDI note-off messages as appropriate? Each run of a live loop doesn’t do anything magical to kill any existing note-ons, correct?



Hi Bryan
Actually Sonic PI takes care of this for you if you use the midi command with a sustain value.
It then sends a midi_on command and after the sustain time a midi_off command for you.

eg midi :c4,sustain: 2
This would send to all current midi ports and all channels, so you may want to limit it by adding a channel specification.
Take a look at the midi command entry in the lang section of the help window.


Fantastic, thanks!