2 summary:: allow functions to be registered to respond to MIDI control change events
3 related:: Classes/MIDIFunc, Classes/MIDIdef, Classes/MIDIResponder, Classes/NoteOnResponder
7 note:: As of SC 3.5 link::Classes/MIDIFunc:: and link::Classes/MIDIdef:: are the recommended way of registering for incoming MIDI messages. They are faster, safer, and have more logical argument order than the old MIDI responder classes. The older class MIDIResponder, and its subclasses NoteOnResponder, NoteOffResponder, BendResponder, TouchResponder, CCResponder, and ProgramChangeResponder are maintained for legacy code only.::
13 A link::Classes/Function:: to be evaluated. Arguments passed to the function are: src, chan, num, value.
16 The src number may be the system UID (obtained from code:: MIDIClient.sources[index].uid ::) or the index of the source in the code:: MIDIClient.sources :: array. nil matches all.
19 An link::Classes/Integer:: between 0 and 15 that selects which MIDI channel to match. nil matches all. May also be a link::Classes/Function:: which will be evaluated to determine the match. eg: { |val| val < 2 }
22 An link::Classes/Integer:: between 0 and 127 that selects which controller number to match. nil matches all. May also be a link::Classes/Function:: which will be evaluated to determine the match. eg: { |val| val >= 4 }
25 An link::Classes/Integer:: between 0 and 127 to filter values. nil matches all. May also be a link::Classes/Function:: which will be evaluated to determine the match. eg: { |val| val < 50 }
28 If true, install the responder automatically so it is active and ready to respond. If false, then it will be inactive.
30 argument::swallowEvent
31 If true, then if the midi event is matched, cease testing any further responders.
36 Wait for the next CC message, reset to match src, chan, cc num.
40 c = CCResponder({ |src,chan,num,value|
41 [src,chan,num,value].postln;
43 c.learn; // wait for the first controller
53 c = CCResponder({ |src,chan,num,value|
54 [src,chan,num,value].postln;
68 c = CCResponder({ |src,chan,num,value|
69 [src,chan,num,value].postln;
74 { |val| val < 50 } // any value less than 50