If you want to control a MIDI instrument, you generally have to control both note informations and control messages (to tweak your parameters). To do so, you currently need to have two separate patterns like so:
This is not encouraging experimentation at all because configuring things that way is slow as hell. It would be much better to be able to create MixedPlayers that can effectively combine multiple MIDI functions in one unified interface. You would be able to give a map of parameters with names and it would function as a regular MIDI instrument:
instrument_map = {
'cutoff': {'control': 20, 'channel': 0, 'alias': 'cut'},
'resonance': {'control': 21, 'channel': 0, 'alias': 'res'},
}
my_instrument = MIDIInstrument(
midi_handler=midi,
channel=0,
instrument_map=instrument_map)
instr = my_instrument
... here define a new player ...
Pa * instr('0 1 2', cut=2, res=1)
Implementation
This specialized player is breaking the current architecture a tiny bit. You need to use two senders at once in a coordinated fashion:
midi.send_note: sending the note information and handling note lifetime.
midi.send_control: send a control.
However, it does not look impossible to manage at all as long as you can triage information coming from the pattern initially. One can imagine a send.midi_instrument method that would combine both patterns by distinguishing between keys related to the MIDI note and keys related to the MIDI Control message.
Problem
If you want to control a MIDI instrument, you generally have to control both note informations and control messages (to tweak your parameters). To do so, you currently need to have two separate patterns like so:
This is not encouraging experimentation at all because configuring things that way is slow as hell. It would be much better to be able to create
MixedPlayers
that can effectively combine multiple MIDI functions in one unified interface. You would be able to give a map of parameters with names and it would function as a regular MIDI instrument:Implementation
This specialized player is breaking the current architecture a tiny bit. You need to use two senders at once in a coordinated fashion:
midi.send_note
: sending the note information and handling note lifetime.midi.send_control
: send a control.However, it does not look impossible to manage at all as long as you can triage information coming from the pattern initially. One can imagine a
send.midi_instrument
method that would combine both patterns by distinguishing between keys related to the MIDI note and keys related to the MIDI Control message.