MIDIMKtlDevice provides an internal interface for MIDI controllers you can connect to your computer.
When looking for available devices with MKtl.find(\midi)
, MIDIMKtlDevice searches for connected controllers, and returns a list of available devices.
When creating an MKtl by desc name, e.g. MKtl(\x, "*nanokontrol2");
, MIDIMKtlDevice try to find the matching MIDI ins and outs in the list of available devices and return a MIDIMKtlDevice that contains them. If it does not find it, e.g. because the physical controller is not there, it will return nil. In that case, the MKtl will be virtual, meaning it has no device, and you can still work with it, because it can open a GUI that can replace the controller.
For most devices, this requires that someone has already made a description file for the device; if there is none, it is easy to make one following the instructions here: How_to_create_a_description_file
More general info can be found in MKtl and MKtlDevice .
Find all currently connected MIDI controllers.
post |
Whether or not to post about the found MIDI controllers. |
Post all access code for device that could be used by name.
protocol name, \midi.
Look for available MIDI devices.
force |
Whether or not to do this again if it was already done before. |
Creates a new instance of MIDIMKtlDevice.
name |
The short name of the controller as it shows up in the list of found devices. |
idInfo |
The lookup idInfo as in MKtlLookup if device is present. |
parentMKtl |
The instance of MKtl that this MKtlDevice will belong to. |
multiIndex |
When using multiple identical devices, the index which one to use. |
All midi message types supported by MIDIMKtlDevice.
turn this device on and off
Close the device and clean up anything that it used.
the midi messages types used by this device
a dict of global response functions for all msgTypes used by this device. This can be used for global responders, e.g. to noteOn/Off messages :
a MIDIOut for this device if present
an action to perform with all incoming midi messages, e.g. for logging.
All responders built for this device
The MIDI source, a MIDIEndPoint.
The uid of the source.
The MIDI destination, a MIDIEndPoint.
The uid of the destination.
When opening a device that is not known yet by MKtl, you want to explore the device. See for a full tutorial: How_to_create_a_description_file
bool |
a Boolean to turn this on or off. |
Whether or not the device is currently being explored.
Create and open a description file for this MKtlDevice, after exploring it.
Initialize all elements and hook them up to the hardware elements.
De-initialize all elements and collectives.
Send the value of the element to the MIDI device; called if you set the value of an MKtlElement that is an output.
key |
The key of the element. |
val |
The value to which it is set. |