Hello all,
I apologize in advance for asking what's probably a very simple question. I'm new to SC (coming from Max, PD, and Processing) and am working through Eli Fieldsteel's excellent YouTube tutorials.
MIDIdef is not working for me. I am using the following (super simple) code to troubleshoot (after initializing and connecting MIDI):
MIDIdef.noteOn(\print, {arg val, num, chan, src; ["NOTE ON", chan, num, val].postln});
MIDIdef.noteOff(\print , {arg val, num, chan, src; ["NOTE OFF", chan, num, val].postln});
If I only run the first line (noteOn), everything works as it should (prints noteOn messages). And if I free the MIDIdef and run the second line (noteOff), this works as well (only prints noteOffs). However, if I run both lines SC only prints the noteOff
messages and doesn't seem to be receiving the noteOns. It's almost as though MIDIdef.noteOff is somehow cancelling out MIDIdef.noteOn.
I used the freeware MIDI Monitor to check the input from my keyboard and it is indeed sending both note-ons and note-offs as it should.
Obviously this makes it impossible to build a polyphonic synth with an array of note numbers, gates, etc. I feel like I have a pretty good grasp on the MIDIdef idea and how to use it for polyphony but I can't move forward until I figure this out. I suspect
it may have something to do with my MIDI keyboard. Here is my relevant system info:
macOS Sierra 10.12.6
27" iMac w 3.4 GHz i5 processor
SuperCollider 3.10.0
M-Audio Oxygen 49 MIDI keyboard connected via USB
Thanks for your patience with such a newbie question. Excited to continue my dive into SC after I figure this out.