The standard way is to use the MIDIResponder classes:
NoteOnResponder
NoteOffResponder
CCResponder
... are the most commonly used. See the MIDIResponder helpfile.
But, if you download my library from
http://www.dewdrop-world.net/sc3 there are some more convenient ways. You can modify CCAllocator in my lib to contain the controller types and controller numbers for your interface so that you can request a controller of a certain type and get a valid cc number. I can post an example tonight.
To play notes on the keyboard, Voicer and VoicerMIDISocket in my lib are the easiest way. Noteon/noteoff require some bookkeeping behind the scenes, which Voicer handles transparently.
SynthDef(\somenoise, { ... }).send(s);
v = Voicer(20, \somenoise, args: [... override arg defaults, optional ...], bus: optional_output_bus, target: optional_server_group or MixerChannel);
k = VoicerMIDISocket(midi_channel, v);
You can map midi controllers onto parameters using k.addControl (see the helpfile).
hjh