Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
171 lines (154 sloc) 6.55 KB
/* KORG nanoKONTROL2 specs:
* all cc messages
* transport buttons - tr,
* track buttons
* 8x sliders, knobs, 3 buttons
MKtlDesc.loadDescs("*trol2");
k.free; k = MKtl(\nk2, "*trol2"); k.gui;
*/
(
deviceName: "nanoKONTROL2",
protocol: \midi,
deviceType: \faderbox,
elementTypes: [\fader, \knob, \button],
status: (
linux: "unknown",
osx: "tested and working, 15.3.2016 by LFSaw.de",
win: "unknown"),
idInfo: "nanoKONTROL2",
deviceInfo: (
vendorURI: "http://www.korg.com/us/products/controllers/nanokontrol2/",
// manualURI: "",
// description: "",
// features: [],
// notes: "",
longName: "KORG nanoKONTROL 2"
),
// testCode - packed into function to allow readable code here (no escape chars)
testCode: {
// an action for all buttons
~mktl.elAt(\bt).action = { |el ... groups|
[el.name, el.value, "groups:", groups.collect(_.name)].postln;
};
// just for slider 1
~mktl.elAt(\sl, \1).action = { |el| [el.name, el.value].postln };
// test for enabling LED control:
// check if you already have LEDs enabled -
// if they all go on and off, they are enabled:
n.outputElements.do(_.value_(1));
n.outputElements.do(_.value_(0));
// if not, enable them:
n.sendSpecialMessage('makeButtonLEDsWriteable');
// now they should go on and off:
n.outputElements.do(_.value_(1));
n.outputElements.do(_.value_(0));
// To restore the nanoK to factory settings:
// * power it down
// * hold down track buttons "<" and ">" and "cycle"
// * power up and wait for ca. 5 seconds
/*************** end of test code *****************/
},
elementsDesc: (
shared: (\midiMsgType: \cc, \midiChan: 0),
elements: [
(
key: \tr,
shared: (\elementType: \button, \spec: \midiBut,
\mode: \push, \ioType: \inout),
elements: [
(key: \rew, \midiNum: 43, \label: \rew,
\style: (row: 3, column: 0)),
(key: \fwd, \midiNum: 44, \label: \fwd,
\style: (row: 3, column: 1)),
(key: \stop, \midiNum: 42, \label: \stop,
\style: (row: 3, column: 2)),
(key: \play, \midiNum: 41, \label: \play,
\style: (row: 3, column: 3)),
(key: \rec, \midiNum: 45, \label: \rec,
\style: (row: 3, column: 4)),
(key: \cycle, \midiNum: 46, \label: \cycle,
\style: (row: 2.125, column: 0, height: 0.75)),
(key: \mset, \midiNum: 60, \label: "set",
\style: (row: 2.125, column: 2, height: 0.75)),
(key: \mleft, \midiNum: 61, \label: "<",
\style: (row: 2.125, column: 3, height: 0.75)),
(key: \mright, \midiNum: 62, \label: ">",
\style: (row: 2.125, column: 4, height: 0.75)),
(key: \tleft, \midiNum: 58, \label: "<",
\style: (row: 1.125, column: 0, height: 0.75)),
(key: \tright, \midiNum: 59, \label: ">",
\style: (row: 1.125, column: 1, height: 0.75)),
]
),
(
key: \sl,
shared: (\elementType: \slider, \spec: \midiCC),
elements: (1..8).collect { |num, i|
(key: num.asSymbol, \midiNum: i, \style: (row: 1, column: 7+(i*2)))
}
),
(
key: \kn,
shared: (\elementType: \knob, \spec: \midiCC),
elements: (16..23).collect { |num, i|
(key: (i + 1).asSymbol, \midiNum: num, \style: (row: 0, column: 7+(i*2)))
}
),
(
key: \bt,
shared: (\elementType: \button, \spec: \midiBut, ioType: \inout),
elements: [\S, \M, \R].collect { |label, i|
var nums = [(32..39),(48..55),(64..71)][i];
(
key: label,
elements: nums.collect { |num, j|
(key: (j + 1).asSymbol, \midiNum: num, label: label,
\style: (row: 1+i, column: 6+(j*2) ))
}
)
}
)
]
),
// don't touch the following code: these are sysex messages found from the Korg NanoKontrol2 editor.
// found at: https://github.com/overtone/overtone/blob/master/src/overtone/device/midi/nanoKONTROL2.clj
// see https://github.com/ModalityTeam/Modality-toolkit/issues/112
specialMessages: (
makeButtonLEDsWriteable:
[
[ \sysex, Int8Array[ 0xF0, 0x7E, 0x7F, 0x06, 0x01, 0xF7 ] ],
[ \sysex, Int8Array[ 0xF0, 0x42, 0x40, 0x00, 0x01, 0x13, 0x00, 0x1F, 0x12, 0x00, 0xF7] ],
[ \sysex, Int8Array[ 0xF0, 0x7E, 0x7F, 0x06, 0x01, 0xF7 ] ],
[ \sysex, Int8Array[
0xF0, 0x42, 0x40, 0x00, 0x01, 0x13, 0x00, 0x7F, 0x7F, 0x02, 0x03, 0x05, 0x40, 0x00, 0x00, 0x00,
0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x7F, 0x00,
0x01, 0x00, 0x20, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x00, 0x30, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x00,
0x40, 0x00, 0x7F, 0x00, 0x10, 0x00, 0x01, 0x00, 0x01, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x11,
0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x21, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x31, 0x00, 0x00, 0x7F,
0x00, 0x01, 0x00, 0x41, 0x00, 0x00, 0x7F, 0x00, 0x10, 0x01, 0x00, 0x02, 0x00, 0x00, 0x7F, 0x00,
0x01, 0x00, 0x12, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x00, 0x22, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x00,
0x32, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x42, 0x00, 0x7F, 0x00, 0x10, 0x01, 0x00, 0x00, 0x03,
0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x13, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x23, 0x00, 0x00, 0x7F,
0x00, 0x01, 0x00, 0x33, 0x00, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x43, 0x00, 0x7F, 0x00, 0x00, 0x10,
0x01, 0x00, 0x04, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x00,
0x24, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x34, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x44, 0x00,
0x7F, 0x00, 0x10, 0x01, 0x00, 0x00, 0x05, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x15, 0x00, 0x00, 0x7F,
0x00, 0x01, 0x00, 0x25, 0x00, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x35, 0x00, 0x7F, 0x00, 0x00, 0x01,
0x00, 0x45, 0x00, 0x7F, 0x00, 0x00, 0x10, 0x01, 0x00, 0x06, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x00,
0x16, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x26, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x36, 0x00,
0x7F, 0x00, 0x01, 0x00, 0x46, 0x00, 0x00, 0x7F, 0x00, 0x10, 0x01, 0x00, 0x07, 0x00, 0x00, 0x7F,
0x00, 0x01, 0x00, 0x17, 0x00, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x27, 0x00, 0x7F, 0x00, 0x00, 0x01,
0x00, 0x37, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x00, 0x47, 0x00, 0x7F, 0x00, 0x10, 0x00, 0x01, 0x00,
0x3A, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x3B, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x2E, 0x00,
0x7F, 0x00, 0x01, 0x00, 0x3C, 0x00, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x3D, 0x00, 0x00, 0x7F, 0x00,
0x01, 0x00, 0x3E, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x00, 0x2B, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x00,
0x2C, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x2A, 0x00, 0x7F, 0x00, 0x01, 0x00, 0x00, 0x29, 0x00,
0x7F, 0x00, 0x01, 0x00, 0x2D, 0x00, 0x00, 0x7F, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x7F, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xF7
] ],
[ \sysex, Int8Array[ 0xF0, 0x7E, 0x7F, 0x06, 0x01, 0xF7 ] ],
[ \sysex, Int8Array[ 0xF0, 0x42, 0x40, 0x00, 0x01, 0x13, 0x00, 0x1F, 0x11, 0x00, 0xF7 ] ]
];
)
)
You can’t perform that action at this time.