From 1f742a2ff4016ee74c3cce3c3329032c9764f054 Mon Sep 17 00:00:00 2001 From: grirgz Date: Fri, 18 Apr 2025 01:18:24 +0200 Subject: [PATCH 1/2] add novation-launchpad-s and apc40mkii description files --- .../MKtlDescriptions/akai-apc40mkii.desc.scd | 248 ++++++++++++++++++ .../novation-launchpad-s.desc.scd | 84 ++++++ 2 files changed, 332 insertions(+) create mode 100755 Modality/MKtlDescriptions/akai-apc40mkii.desc.scd create mode 100644 Modality/MKtlDescriptions/novation-launchpad-s.desc.scd diff --git a/Modality/MKtlDescriptions/akai-apc40mkii.desc.scd b/Modality/MKtlDescriptions/akai-apc40mkii.desc.scd new file mode 100755 index 0000000..c4a3632 --- /dev/null +++ b/Modality/MKtlDescriptions/akai-apc40mkii.desc.scd @@ -0,0 +1,248 @@ +( +deviceName: "APC40 mkII", +protocol: \midi, +deviceType: 'multiController', +elementTypes: [ \fader, \knob, \button ], +status: ( + linux: "tested and working", + osx: "unknown", + win: "unknown"), + +idInfo: "APC40 mkII", + +deviceInfo: ( + vendorURI: 'https://www.akaipro.com/apc40-mkii.html', + manualURI: 'https://www.akaipro.com/downloads#apc40mkii', + // description: , + // features: [], + notes: "adapted from APC40 desc file", +), + + + +elementsDesc: ( + elements: [ + + /////////////// BUTTONS ////////////////////////// + ( + key: \bt, + shared: ( elementType:\button, spec:\midiVel, \ioType: \inout ), + elements: + [ + + //---------- Clip Launch + ( + key:\clip, + elements: (0..4).collect{ |row, i| ( + elements: (0..7).collect{ |col, j| + MKtlDesc.notePair( (j+1).asSymbol, col+(row*8), + shared:( midiNum:col+(row*8), midiChan:0, + buttonMode:\toggle, style:(row:i, column:j) ) ) + } + ) } + ), + + //---------- Clip Stop + ( + key: \clipS, + elements: (0..7).collect({ |chan, i| + MKtlDesc.notePair( (i+1).asSymbol, midiNum:52, + shared: (\midiChan:chan, style:(row:5.5, column:i) ) + ) + }) + ), + //--------- Stop All Clips + ( + MKtlDesc.notePair( key:\stopAll, midiNum:81, + shared:( midiChan: 0, style:(row:5.5, column:8) ) + )), + + //--------- Activator, Solo/Cue, Record Arm + ( + elements: [50, 49, 48, 66].collect{ |num, i| ( + elements: (0..7).collect{ |chan, j| ( + MKtlDesc.notePair( + ( ['activ', 'solo', 'rec', 'ab'][i]++(1+j) ).asSymbol, + midiNum:num, + shared: ( midiChan:chan, /*buttonMode:\toggle, */ + style:( row:7+i, column:j, height:0.85 ) ) + ) + ) } + ) } + ), + //--------- Scene Launch + ( + key: \scene, + elements: (82..86).collect{ |num, i| + MKtlDesc.notePair( key:((1+i).asSymbol), midiNum:num, + shared: ( midiChan:0, style:( row: i, column:8 ) ) ) + } + ), + // ******** Track Control - pan, sends, user + ( + elements: [87, 88, 89].collect{ |num, i| + MKtlDesc.notePair( + key:[ 'pan', 'sends', 'user'][i], + midiNum:num, + shared:( midiChan:0, buttonMode:\toggle, + style:( row:1.85, column:12+i, height:0.75 ) ) ) + } ), + + //------------ Shift ---------------- // + ( + MKtlDesc.notePair( key:\shift, midiNum:98, + shared:( midiChan: 0, elementType:\button, spec:\midiVel, + style:( row:3, column:11.25, width:0.75, height:0.75 ) + ) ) + ), + + //------------ Bank toggle ---------------- // + ( + MKtlDesc.notePair( key:\bank, midiNum:103, + shared:( midiChan: 0, elementType:\button, spec:\midiVel, + style:( row:3, column:11.25, width:0.75, height:0.75 ) + ) ) + ), + + // ---------- Bank Select ----------- // + ( + elements:[ 94, 97, 96, 95 ].collect{ |num, i| + MKtlDesc.notePair( key:[ 'up', 'left', 'right', 'down' ][i], + midiNum:num, + shared:( midiChan:0, + style:( row: 2.75+[0,0.3,0.3,0.75][i], + column:12.25+[0.7,0,1.4,0.7][i], + width:0.75, height:0.85 ) ) + ) + } ), + + //--------- Metronome, Tap-Tempo, Nudge -, Nudge + + ( + elements: [ 90, 99, 101, 100 ].collect{ |num, i| + MKtlDesc.notePair( key:[ 'metronome', 'tap', 'minus', 'plus' ][i], midiNum:num, + shared:( midiChan:0, + style:( row:2.75+[ 0, 0.4, 0.4, 0.4 ][i], + column:14.75 + [ 0.7, 0, 1.4, 1.4 ][i], + width:0.75, height:[ 0.75, 0.75, 0.75, 0.75 ][i] ) + ) + ) + } + ), + + // ******** Device Control ** + // dev<-, dev->, bank<-, bank->, device on/off, dev lock, clipdev view, detail view + ( + elements: (0..8).collect{ |chan, i| ( + elements: (58..65).collect( { |num, j| + MKtlDesc.notePair( + key:[ + 'devleft', 'devright', 'bankleft', 'bankright', + 'devonoff', 'devlock', 'clipdev', 'detail' + ][j], + midiNum:num, + shared:( midiChan:chan, buttonMode:\toggle, + style:( row:4.5+i, column:18+j, height:0.75 ) + ) + ) + } ) + ) + } ), + + + // transport buttons + ( + elements:( [91, 93, 102].collect{ |num, i| + MKtlDesc.notePair( key:[ 'play', 'rec', 'session' ][i], + midiNum:num, + shared:( midiChan:0, style:( row:14.4, + column:12.4+( i*1.16 ), width:0.85, height:0.75 ) ) + ) + })), + + ] + ), + + + //////////////////// SLIDERS ///////////////// + ( + key: \sl, + shared: ( midiMsgType:\cc, elementType:\slider, spec:\midiCC ), + elements: + [ + ( + elements: (0..7).collect { |chan, i| + (key: (i+1).asSymbol, midiChan:chan, midiNum:7, + style:( row: 13.3, column: i ) + ) + }), + + ( key:\master, midiNum:14, midiChan:0, spec:\midiCC, + style:( row:13.3, column:8 ) ) + + ] + ), + + + /////////////////// KNOBS /////////////////////// + ( key: \kn, + shared:( midiMsgType:\cc, elementType:\knob, spec:\midiCC ), + elements: + [ + + //-------------- tempo + ( + key: \tempo, midiNum:13, midiChan:0, midiMsgType:\cc, + elementType:\knob, spec: \midiCC, valueType: \relative, + style: ( row:9, column:8 ) + ), + + //-------------- cue level + ( + key: \cue, midiNum:47, midiChan:0, midiMsgType:\cc, + elementType:\knob, spec: \midiCC, valueType: \relative, + style: ( row:9, column:8 ) + ), + + //************** Track Control + ( + key: \t, + elements: (48..55).clump(4).collect{ |row, i| + ( elements: + row.collect{ |num, j| + ( key:((1..8)[j]).asSymbol, midiChan:0, midiNum:num, + style:( row:i, column:12+j ) ) + } + ) + } + ), + + //************** Device Control (all channels) + ( + key: \d, + elements: (0..8).collect{ |chan, i| ( + elements: (16..23).collect { |num, j| + ( key: (1..8)[j].asSymbol, + midiChan:chan, midiNum:num, + style:( row:4.5+i, column:10+j ) + ) + } ) + } ), + ] + ), + + //--------------------- crossfader + ( key: \xfader, + midiNum:15, midiChan:0, midiMsgType:\cc, elementType: \xfader, + spec:\midiCC, style:( row:15.3, column:12, height: 1, width: 4 ) + ) + + + ], +), +specialMessages: ( + makeButtonLEDsWriteable: [ + [ \sysex, Int8Array[ 0xF0, 0x7E, 0x00, 0x06, 0x01, 0xF7 ] ], + [ \sysex, Int8Array[ 0xF0, 0x47, 0x00, 0x73, 0x60, 0x00, 0x04, 0x41, 0x08, 0x01, 0x01, 0xF7 ] ], + ] +); +) diff --git a/Modality/MKtlDescriptions/novation-launchpad-s.desc.scd b/Modality/MKtlDescriptions/novation-launchpad-s.desc.scd new file mode 100644 index 0000000..330932f --- /dev/null +++ b/Modality/MKtlDescriptions/novation-launchpad-s.desc.scd @@ -0,0 +1,84 @@ +// Novation Launchpad specs: +// Mostly NoteOn / NoteOff, some cc messages, +// no hardware scenes, flattened out with underscores + +/* +MKtlDesc.loadDescs("*launchpad"); +m.free; m = MKtl(\lp, "*launchpad"); m.gui; +*/ + + +( +deviceName: "Launchpad S", +protocol: \midi, +deviceType: \launchpad, +elementTypes: [\button], +status: ( + linux: "unknown", + osx: "now with gui layout. 2019_12_29, adc", + win: "unknown"), + +idInfo: "Launchpad S", + + +deviceInfo: ( + vendorURI: "http://us.novationmusic.com/midi-controllers-digital-dj/launchpad", + manualURI: "http://us.novationmusic.com/support/product-downloads?product=Launchpad", + // description: "", + features: [ + "64 multi-colour backlit buttons", + "8 arrow buttons", + "8 other buttons", + ], + // notes: "", + + longName: "novation launchpad-s" +), +elementsDesc: ( + shared: (\midiChan: 0), + elements: [ + ( + key: \bt, + shared: (\midiMsgType: \cc, \elementType: \button, + \spec: \midiBut, \mode: \push), + elements: [ + (key: \up, \midiNum: 104), + (key: \down, \midiNum: 105), + (key: \left, \midiNum: 106), + (key: \right, \midiNum: 107), + (key: \session,\midiNum: 108), + (key: \user1, \midiNum: 109), + (key: \user2, \midiNum: 110), + (key: \mixer, \midiNum: 111) + ] + ), + ( + key: \pad, + shared: (\elementType: \button, \spec: \midiBut, \ioType: \inout), + elements: ((0, 16 .. 112) +.t (0..7)).flat.clump(8).collect {|nums, i| + ( + elements: nums.collect { |num, j| + ( groupType: \noteOnOff, + \midiNum: num, + style: (row: i + 1, column: j) + ) + } + ) + } + ), + ( + key: \arr, + shared: (\elementType: \pad, \spec: \midiVel), + elements: ((0, 16 .. 112) + 8).flat.postln.collect {|num, i| + ( + groupType: \noteOnOff, + \midiNum: num, + style: (row: 10, column: i) + + + ) + } + ) + ] +) +) From f1b96aa014ae90e13039db3e25b89bb60f8645ed Mon Sep 17 00:00:00 2001 From: grirgz Date: Fri, 18 Apr 2025 06:03:22 +0200 Subject: [PATCH 2/2] support ableton live mode and colors --- .../MKtlDescriptions/akai-apc40mkii.desc.scd | 61 ++++++++++++++++--- 1 file changed, 52 insertions(+), 9 deletions(-) diff --git a/Modality/MKtlDescriptions/akai-apc40mkii.desc.scd b/Modality/MKtlDescriptions/akai-apc40mkii.desc.scd index c4a3632..70991ba 100755 --- a/Modality/MKtlDescriptions/akai-apc40mkii.desc.scd +++ b/Modality/MKtlDescriptions/akai-apc40mkii.desc.scd @@ -33,7 +33,7 @@ elementsDesc: ( //---------- Clip Launch ( key:\clip, - elements: (0..4).collect{ |row, i| ( + elements: (0..4).reverse.collect{ |row, i| ( elements: (0..7).collect{ |col, j| MKtlDesc.notePair( (j+1).asSymbol, col+(row*8), shared:( midiNum:col+(row*8), midiChan:0, @@ -41,6 +41,27 @@ elementsDesc: ( } ) } ), + //---------- Clip color + ( + key:\clipColor, + elements: (0..4).reverse.collect{ |row, i| ( + elements: (0..7).collect{ |col, j| + ( + elements: [0,13].collect { arg colormode, idx; + ( + key: [\normal, \blink][idx], + midiNum:col+(row*8), + midiMsgType: \noteOn, + midiChan:colormode, + buttonMode:\toggle, + ioType: \out, + ) + + }; + ) + } + ) } + ), //---------- Clip Stop ( @@ -57,9 +78,27 @@ elementsDesc: ( shared:( midiChan: 0, style:(row:5.5, column:8) ) )), + //---------- Clip select + ( + key: \selection, + elements: (0..7).collect({ |chan, i| + MKtlDesc.notePair( (i+1).asSymbol, midiNum:51, + shared: (\midiChan:chan, style:(row:5.5, column:i) ) + ) + }) + ), + //--------- Master + ( + MKtlDesc.notePair( key:\master, midiNum:80, + shared:( midiChan: 0, style:(row:5.5, column:8) ) + )), + + //--------- Activator, Solo/Cue, Record Arm ( + key: \track, elements: [50, 49, 48, 66].collect{ |num, i| ( + key:( ['activ', 'solo', 'rec', 'ab'][i] ).asSymbol, elements: (0..7).collect{ |chan, j| ( MKtlDesc.notePair( ( ['activ', 'solo', 'rec', 'ab'][i]++(1+j) ).asSymbol, @@ -73,13 +112,14 @@ elementsDesc: ( //--------- Scene Launch ( key: \scene, - elements: (82..86).collect{ |num, i| + elements: (82..86).reverse.collect{ |num, i| MKtlDesc.notePair( key:((1+i).asSymbol), midiNum:num, shared: ( midiChan:0, style:( row: i, column:8 ) ) ) } ), // ******** Track Control - pan, sends, user ( + key: \control, elements: [87, 88, 89].collect{ |num, i| MKtlDesc.notePair( key:[ 'pan', 'sends', 'user'][i], @@ -106,6 +146,7 @@ elementsDesc: ( // ---------- Bank Select ----------- // ( + key:\bankselect, elements:[ 94, 97, 96, 95 ].collect{ |num, i| MKtlDesc.notePair( key:[ 'up', 'left', 'right', 'down' ][i], midiNum:num, @@ -118,6 +159,7 @@ elementsDesc: ( //--------- Metronome, Tap-Tempo, Nudge -, Nudge + ( + key:\tempo, elements: [ 90, 99, 101, 100 ].collect{ |num, i| MKtlDesc.notePair( key:[ 'metronome', 'tap', 'minus', 'plus' ][i], midiNum:num, shared:( midiChan:0, @@ -132,6 +174,7 @@ elementsDesc: ( // ******** Device Control ** // dev<-, dev->, bank<-, bank->, device on/off, dev lock, clipdev view, detail view ( + key:\device, elements: (0..8).collect{ |chan, i| ( elements: (58..65).collect( { |num, j| MKtlDesc.notePair( @@ -151,6 +194,7 @@ elementsDesc: ( // transport buttons ( + key: \transport, elements:( [91, 93, 102].collect{ |num, i| MKtlDesc.notePair( key:[ 'play', 'rec', 'session' ][i], midiNum:num, @@ -206,13 +250,9 @@ elementsDesc: ( //************** Track Control ( key: \t, - elements: (48..55).clump(4).collect{ |row, i| - ( elements: - row.collect{ |num, j| - ( key:((1..8)[j]).asSymbol, midiChan:0, midiNum:num, - style:( row:i, column:12+j ) ) - } - ) + elements: (48..55).collect{ |num, i| + ( key:(i+1).asSymbol, midiChan:0, midiNum:num, + style:( row:i ) ) } ), @@ -243,6 +283,9 @@ specialMessages: ( makeButtonLEDsWriteable: [ [ \sysex, Int8Array[ 0xF0, 0x7E, 0x00, 0x06, 0x01, 0xF7 ] ], [ \sysex, Int8Array[ 0xF0, 0x47, 0x00, 0x73, 0x60, 0x00, 0x04, 0x41, 0x08, 0x01, 0x01, 0xF7 ] ], + ], + abletonLiveMode: [ + [ \sysex, Int8Array[ 0xF0, 0x47, 0x00, 0x29, 0x60, 0x00, 0x04, 0x41, 0x08, 0x01, 0x01, 0xF7 ] ], ] ); )