Skip to content

Instantly share code, notes, and snippets.

@jordanorelli
Created September 14, 2013 17:12
Show Gist options
  • Save jordanorelli/6563747 to your computer and use it in GitHub Desktop.
Save jordanorelli/6563747 to your computer and use it in GitHub Desktop.
midi printing util
// number of the device to open (see: chuck --probe)
0 => int device;
// the midi event
MidiIn min;
// the message for retrieving data
MidiMsg msg;
// open the device
if(!min.open(device)) {
me.exit();
}
// print out device that was opened
<<< "MIDI device:", min.num(), " -> ", min.name() >>>;
// infinite time-loop
while(true) {
// wait on the event 'min'
min => now;
// get the message(s)
while(min.recv(msg)) {
// print out midi message
<<< msg.data1, msg.data2, msg.data3 >>>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment