Thomas GUFFROY 7 месяцев назад
Родитель
Сommit
7bd02f8f57
1 измененных файлов с 25 добавлено и 0 удалено
  1. 25 0
      resources for sc and juce/midi_receiver_example.scd

+ 25 - 0
resources for sc and juce/midi_receiver_example.scd

@@ -0,0 +1,25 @@
+s.boot;
+
+// Make sure MIDI is initialized
+MIDIClient.init;
+
+// List available MIDI sources
+MIDIIn.connectAll;
+
+// Create a function to handle MIDI messages
+(
+MIDIdef.noteOn(\printNoteOn, { |vel, num, chan, src|
+    "Note On - Channel: %, Note: %, Velocity: %, Source: %"
+    .format(chan, num, vel, src).postln;
+});
+
+MIDIdef.noteOff(\printNoteOff, { |vel, num, chan, src|
+    "Note Off - Channel: %, Note: %, Velocity: %, Source: %"
+    .format(chan, num, vel, src).postln;
+});
+
+MIDIdef.cc(\printCC, { |val, num, chan, src|
+    "Control Change - Channel: %, Controller: %, Value: %, Source: %"
+    .format(chan, num, val, src).postln;
+});
+)