MidiControl

v250715

Binding a Midi-controller in SuperCollider

The MidiControl class is a convenient wrapper around the MIDI functionality of SuperCollider, making it easier to connect/disconnect to MIDI devices and define handlers for MIDI messages sent/received by those devices. The source code is available on Codeberg: https://codeberg.org/teymuri/midicontrol.git

To use the MidiControl class, follow these steps:

This will integrate the MidiControl class into your SuperCollider environment, allowing you to utilize its features for simplified MIDI device management and message handling.

Below are listed the class methods and a simple typical usage.


MidiControl.init(inports, outports, connectAll=false, verbose=false)

Call to initialize the midi-interface, pass in the desired number of input and output ports. Setting connectAll will connect to all possible midi inputs.

MidiControl.show

Print all found source and destination devices, prepended by their corresponding index number (and a + sign if the device is already connected).

MidiControl.connect(idx)

Connect to the device with the index number idx.

MidiControl.trace_(bool)

Set/unset the tracer (for debugging). bool can be any boolean value.

MidiControl.def(key, func, msgNum=0, chan=0, msgType='control', srcID, argTemplate, dispatcher)

Define a new handler function. key must be a symbol, which serves as the identifier of your function in a function registry, enabling retrieving and replacing and removing the function later.

Contact

amte(at)tutamail.com