Clamps Dictionary
nanoktl2-midi
Class
Class for a Korg Nanokontrol2 midi controller. This class contains the state of the Hardware Controller in respect to the Knobs, Faders and Buttons of the device. If the device is connected bidirectionally to the midi Ports and the instance is created with add-midi-controller, the following behaviour is implemented:
- Moving the hardware faders will update the respective slots of the instance. Note that the values of the slots for the faders and buttons are normalized to the range [0..1].
- Setting the values of the button slots of the instance to 0, 1 or 2 will highlight the respective button on the hardware controller. 1
- Pressing a button on the Hardware controller will call the trigger function with the corresponding slot of the instance as argument.
See Using a Korg NanoKONTROL2 Controller in the Clamps Packages documentation for usage examples.
nanoktl2-midi implements the following slots with accessor methods of the same name and initargs being the keywords of the slot symbol:
cc-nums
– Array of 51 elements containing the CC numbers of all
knobs, faders and buttons of the NanoKontrol2 in the following
order (with their array idxs in brackets):
knobs [0..7] | faders [8..15] | s-buttons [16..23] | m-buttons [24..31] | r-buttons [32..39] | |
track-left [40] | track-right [41] | cycle[42] | set [43] | marker-left [44] | marker-right [45] |
rew [46] | ff [47] | stop [48] | play [49] | rec [50] |
cc-state
– Array of 51 bang-objects or ref-objects containing the state (value)
of all buttons and faders of the NanoKontrol2 in the same idx order, as in cc-nums
.
nk2-faders
– Array of 16 elements containing the
ref-objects of the 8 knobs and the 8 faders of the
NanoKontrol2 (same as ccstate[0..15]).
nk2-fader-modes
– Array of 16 elements containing the mode of the
fader when the hardware fader is out of sync with the program state of
the fader. Currently implemented are:
- :scale Scale fader values when moving the hardware fader.
- :jump Jump to the value when moving the hardware fader.
- :catch Catch the slot-value when moving the hardware fader.
nk2-fader-test-sync-fns
– Array of 16 functions, invoked if fader-mode :catch is used.
nk2-fader-last-cc
– Array of 16 values containing the last (normalized) received CC values of the hardware faders.
button-labels
– Array of 35 elements containing the labels of all
buttons of the NanoKontrol2.
s-buttons
– Array of 8 bang-objects containing the state of the 8 S buttons with a value of 0, 1 or 2 (same as ccstate[16..23]).
m-buttons
– Array of 8 bang-objects containing the state of the 8 M buttons with a value of 0, 1 or 2 (same as ccstate[24..31]).
r-buttons
– Array of 8 bang-objects containing the state of the 8 R buttons with a value of 0 or 1 (same as ccstate[32..39]).
track-left
– bang-object of the track left button (same as ccstate[40]).
track-right
– bang-object of the track right button (same as ccstate[41]).
cycle
– bang-object of the cycle button (same as ccstate[42]).
set-marker
– bang-object of the set marker button (same as ccstate[43]).
marker-left
– bang-object of the marker left button (same as ccstate[44]).
marker-right
– bang-object of the marker right button (same as ccstate[45]).
tr-rewind
– bang-object of the rewind transport button (same as ccstate[46]).
tr-ffwd
– bang-object of the fast forward transport button (same as ccstate[47]).
tr-stop
– bang-object of the stop transport button (same as ccstate[48]).
tr-play
– bang-object of the play transport button (same as ccstate[49]).
tr-record
– bang-object of the record transport button (same as ccstate[50]).
See also
Footnotes:
For this to work, the LED mode of the NanoKONTROL2 has to be set to External (see Using a Korg NanoKONTROL2 Controller)
Created: 2025-06-08 So 16:56