Created
September 14, 2013 17:12
-
-
Save jordanorelli/6563747 to your computer and use it in GitHub Desktop.
midi printing util
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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