MIDI controller

A controller you can use with any music program: examples/audio/midi_controller.py.
python examples/audio/midi_controller.pyIt has eight channel strips (a pan knob, a fader with a level meter, mute and solo), eight velocity pads, pitch and mod wheels, transport buttons and a three-octave piano. PLAY runs a beat on the pads.
It plays its own drum kit and synth through the engine, so you hear everything. Switch on MIDI OUT to also send every move to other programs:
| Control | MIDI message |
|---|---|
| Fader 1–8 | Control change 70–77 |
| Pan 1–8 | Control change 10–17 |
| Pad 1–8 | Note 36–43 on channel 10 (drums) |
| Piano | Note on / note off on channel 1 |
| Pitch wheel | Pitch bend |
| Mod wheel | Control change 1 |
How it is built
Section titled “How it is built”def set_level(self, i, value): self.levels[i] = value self.apply_mix() # the engine's mixer channel self.send(0xB0, 70 + i, int(value * 127)) # and a MIDI control change
def toggle_midi_out(self, on): if on: self.engine.open_midi_output(virtual="Pyzed Controller") self.midi_out = onsend writes the bytes to the log on the right and, when MIDI OUT is on, calls
engine.send_midi(message).