gadgets-OSC/chuck/midi2osc.ck

34 lines
497 B
Plaintext
Raw Normal View History

2021-07-20 11:20:03 +02:00
/*
* recevoir des notes on/off par le MIDI
* et envoyer des boutons de joy par OSC
*
* nouveau Rural Art System 2021 - TerreBlanque
*/
2021-07-23 14:13:56 +02:00
MidiIn input;
MidiMsg msg;
2021-07-20 11:20:03 +02:00
2021-07-23 14:13:56 +02:00
1 => int port; // please explain
if (!input.open(port)) {
<<< "erreur open" >>>;
me.exit();
}
// print out device that was opened
<<< "MIDI device:", input.num(), " -> ", input.name() >>>;
// infinite loop
while (1) {
input => now;
while ( input.recv(msg) ) {
<<< msg.data1, msg.data2, msg.data3 >>>;
}
}
2021-07-20 11:20:03 +02:00