From 096a3c955956ad09914869353f3fbcd99e870eac Mon Sep 17 00:00:00 2001 From: Gil Fuser Date: Sun, 19 Mar 2017 13:32:38 +0100 Subject: [PATCH 1/3] Update to new Modality In the device the same midi channel / numbers are used by more than one element. This would make the description of all four "Programs" messy and the use confuse. So I left to the user to edit the programs settings in the MPK MiniMKII editor to avoid the problem. Just choosing different midi channels for the different element types should do it. Changed midiMsgType: \noteOnOff to the new way of having the same functionality using groupType: \noteOnOffBut --- .../MKtlDescriptions/akai-mpkmini2.desc.scd | 145 ++++++++++-------- 1 file changed, 77 insertions(+), 68 deletions(-) diff --git a/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd b/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd index 18bf97dd..052c72fc 100755 --- a/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd +++ b/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd @@ -1,12 +1,12 @@ // contributed by gil fuser - /* * todo: * test on osx -* add gui layout -MKtl(\x, "*mpk*2").gui; -MKtl(\x).trace; +m = MKtl(\mpk2, "akai-mpkmini2"); +m.gui; +m.trace; +m.trace(false); */ ( @@ -15,84 +15,93 @@ protocol: 'midi', deviceType: 'midiKeyboard', elementTypes: [\knob, \key, \pad, \bend], status: ( - linux: "tested and working", - osx: "tested desc only, looks ok, no gui info yet. 2016-03-17, adc", - win: "tested and working"), + linux: "tested and working", + osx: "unknown", + win: "tested and working"), idInfo: "MPKmini2", // hardwarePages: [1, 2, 3, 4], deviceInfo: ( - vendorURI: 'http://www.akaipro.com/product/mpk-mini-mkii', - manualURI: 'http://6be54c364949b623a3c0-4409a68c214f3a9eeca8d0265e9266c0.r0.cf2.rackcdn.com/988/documents/MPK%20mini%20-%20User%20Guide%20-%20v1.0.pdf', - features: [\pianoKey, \pad, \knob, \bender], - notes: - "Uses default presets.\n" - "Every key was mapped, with the exception of ```Prog Change```.\n" - "Accidental ```Prog-Change``` activation on the device needs to be reverted by ```Bank A/B```.\n" - "For more flexibility use the [MPK MiniMKII editor](http://www.akaipro.com/product/mpk-mini-mkii#downloads).", + vendorURI: 'http://www.akaipro.com/product/mpk-mini-mkii', + manualURI: 'http://6be54c364949b623a3c0-4409a68c214f3a9eeca8d0265e9266c0.r0.cf2.rackcdn.com/988/documents/MPK%20mini%20-%20User%20Guide%20-%20v1.0.pdf', + features: [\pianoKey, \pad, \knob, \bender], + notes: + "Uses only ```Program 1```.\n" + "To use the other programs use first: [MPK MiniMKII editor](http://www.akaipro.com/product/mpk-mini-mkii#downloads)\n" + "avoiding more mapping overlaping as occours in the defaults.\n" + "Accidental ```Prog-Change``` activation on the device needs to be reverted by ```Bank A/B```.\n", longName: "AKAI MPKmini mk2" ), + elementsDesc: ( - elements: [ + shared: (midiChan: 0), + elements:[ // ------- bend ------------ - ( key: \bend, - \midiChan: 0, \midiMsgType: \bend, \elementType: \bender, \spec: \midiBend - ), - // ------ pad ------------- - ( - key: \pad, - shared: (\midiMsgType: \noteOnOff, \midiChan: 9, \spec: \midiCC, \elementType: \pad), - elements: ((36..38)++(40)++(42..53)++(55)++(57)++(59..75)++(82)).collect { |i| - (key: (i).asSymbol, \midiNum: i) - } - ), - // ------ pad into button ------------- - ( - key: \bt, - shared: (\midiMsgType: \cc, \elementType: \button, \spec: \midiCC ), - elements: [ + ( key: \bend, + midiMsgType: \bend, elementType: \bender, spec: \midiBend, style: (row: 0, column:0, width: 1.01) + ), - ( - shared: (\midiChan: 0), - elements: (28..35).collect { |i| - (key: (i).asSymbol, \midiNum: i) - } - ), - ( - shared: (\midiChan: 9), - elements: (0..16).collect { |i| - (key: (i).asSymbol, \midiNum: i) - } - ), + // ------ pad BANK A ------------- + ( + key: \padA, + shared: ( elementType: \pad, spec: \midiVel, midiMsgType: \noteOn, groupType: \noteOnOffBut ), + elements: ( 44..51 ).collect{ |num, i| + ( + key: (i+1).asSymbol, + shared: ( midiNum: num, style:( row: 1 - (i div:4), column: 1 + (i % 4)) ) + ) + } + ), + // ------ pad BANK B ------------- + ( + key: \padB, + shared: ( elementType: \pad, spec: \midiVel, midiMsgType: \noteOn, groupType: \noteOnOffBut ), + elements: ( 32..39 ).collect{ |num, i| + ( + key: (i+1).asSymbol, + shared: ( midiNum: num, style:( row: 3.5 - (i div:4), column: 1 + (i % 4)) ) + ) + } + ), + // ------ knob ------------- + ( + key: \kn, + shared: ( elementType: \knob, spec: \midiCC, midiMsgType: \cc ), + elements: ( 1..8 ).collect{ |num, i| + ( + key: (i+1).asSymbol, + midiNum: num, style:( row: i div:4, column: i % 4 + 5 ) + ) + } + ), - ] - ), - // ------ knob ------------- - ( - key: \kn, - shared: (\midiMsgType: \cc, \elementType: \knob, - \midiChan: 0, \spec: \midiCC), - elements: ((1..8)++(16..27)).collect { |i, item| - item = item + 1; - (key: (i).asSymbol, \midiNum: i) - } - ), - // ------ piano key ------------- - ( - key: \key, - shared: (\midiMsgType: \noteOnOff, \elementType: \pianoKey, - \midiChan: 0, \spec: \midiVel), - elements: (0..120).collect { |i| - (key: (i).asSymbol, \midiNum: i) - } - ), - ] -) + //////// piano key ////////// + ( + key: \pkey, + shared: ( elementType: \pianoKey, groupType: \noteOnOff, spec: \midiVel ), + elements: + (0..120).collect { |num, i| + var pos = Piano.pos( num % 48, 0); + ( + key: i.asSymbol, + shared: ( + midiNum: num, groupType: \noteOnOff, + style: ( + row: (9 - (i div: 48 * 2)) + (pos.y * 0.9), + column: pos.x * 0.8 % 25, + color: pos.color, + height: 1.2, + ) + ) + ) + } + ), + ] +) ); - From 3a46003334c36873f67ea1d4a2abab0327f493ea Mon Sep 17 00:00:00 2001 From: Gil Fuser Date: Mon, 22 May 2017 17:35:47 +0200 Subject: [PATCH 2/3] cc pads added --- .../MKtlDescriptions/akai-mpkmini2.desc.scd | 160 ++++++++++-------- 1 file changed, 94 insertions(+), 66 deletions(-) diff --git a/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd b/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd index 052c72fc..b31ac394 100755 --- a/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd +++ b/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd @@ -36,72 +36,100 @@ deviceInfo: ( ), elementsDesc: ( - shared: (midiChan: 0), - elements:[ - + + elements: + [ + + // ------ pad BANK A note on-off------------- + ( + key: \pnA, + shared: ( elementType: \pad, midiChan: 0, spec: \midiVel, midiMsgType: \noteOn, groupType: \noteOnOffBut ), + elements: ( 44..51 ).collect{ |num, i| + ( + key: i.asSymbol, + shared: ( midiNum: num, style:( row: 1 - (i div:4), column: 2 + (i % 4)) ) + ) + } + ), + + // ------ pad BANK B note on-off ------------- + ( + key: \pnB, + shared: ( elementType: \pad, midiChan: 0, spec: \midiVel, midiMsgType: \noteOn, groupType: \noteOnOffBut ), + elements: ( 32..39 ).collect{ |num, i| + ( + key: i.asSymbol, + shared: ( midiNum: num, style:( row: 2.25 + (1 - (i div:4)), column: 2 + (i % 4)) ) + ) + } + ), + + // ------ pad BANK A cc ------------- + ( + key: \pcA, + shared: ( midiChan: 0, midiMsgType: \cc, elementType: \pad, spec: \midiCC ), + elements: ( 20..27 ).collect{ |num, i| + ( + key: i.asSymbol, + midiNum: num, + style:( row: 4.5 + (1 - (i div:4)), column: 2 + (i % 4)) + ) + } + ), + + // ------ pad BANK B cc ------------- + ( + key: \pcB, + shared: ( elementType: \pad, midiChan: 0, spec: \midiCC, \ioType: \inout, midiMsgType: \cc ), + elements: ( 28..35 ).collect{ |num, i| + ( + key: i.asSymbol, + midiNum: num, + style:( row: 6.75 + (1 - (i div:4)), column: 2 + (i % 4)) + ) + } + ), + + + // ------ knob ------------- + ( + key: \k, + shared: ( elementType: \knob, midiChan: 0, spec: \midiCC, midiMsgType: \cc ), + elements: ( 1..8 ).collect{ |num, i| + ( + key: i.asSymbol, + midiNum: num, style:( row: i div:4, column: 6 + (i % 4) ), + ) + } + ), + + //////// piano key ////////// + ( + key: \pkey, + shared: ( midiChan: 0, elementType: \pianoKey, groupType: \noteOnOff, spec: \midiVel ), + elements: + (0..120).collect { |i| + var pos = Piano.pos( i % 25, 0); + ( + key: i.asSymbol, + shared: ( + midiNum: i, groupType: \noteOnOff, + style: ( + row: ( i div: 25 * 1.5 ) + (pos.y * 0.6), + column: 10 + (pos.x * 0.65 % 25), + color: pos.color, + width: 0.9, + height: 0.75, + ) + ) + ) + } + ), // ------- bend ------------ - ( key: \bend, - midiMsgType: \bend, elementType: \bender, spec: \midiBend, style: (row: 0, column:0, width: 1.01) - ), - - // ------ pad BANK A ------------- - ( - key: \padA, - shared: ( elementType: \pad, spec: \midiVel, midiMsgType: \noteOn, groupType: \noteOnOffBut ), - elements: ( 44..51 ).collect{ |num, i| - ( - key: (i+1).asSymbol, - shared: ( midiNum: num, style:( row: 1 - (i div:4), column: 1 + (i % 4)) ) - ) - } - ), - - // ------ pad BANK B ------------- - ( - key: \padB, - shared: ( elementType: \pad, spec: \midiVel, midiMsgType: \noteOn, groupType: \noteOnOffBut ), - elements: ( 32..39 ).collect{ |num, i| - ( - key: (i+1).asSymbol, - shared: ( midiNum: num, style:( row: 3.5 - (i div:4), column: 1 + (i % 4)) ) - ) - } - ), - - // ------ knob ------------- - ( - key: \kn, - shared: ( elementType: \knob, spec: \midiCC, midiMsgType: \cc ), - elements: ( 1..8 ).collect{ |num, i| - ( - key: (i+1).asSymbol, - midiNum: num, style:( row: i div:4, column: i % 4 + 5 ) - ) - } - ), - - //////// piano key ////////// - ( - key: \pkey, - shared: ( elementType: \pianoKey, groupType: \noteOnOff, spec: \midiVel ), - elements: - (0..120).collect { |num, i| - var pos = Piano.pos( num % 48, 0); - ( - key: i.asSymbol, - shared: ( - midiNum: num, groupType: \noteOnOff, - style: ( - row: (9 - (i div: 48 * 2)) + (pos.y * 0.9), - column: pos.x * 0.8 % 25, - color: pos.color, - height: 1.2, - ) - ) - ) - } - ), - - ] + ( key: \bY, + midiChan: 0, \midiNum: 2, midiMsgType: \cc, elementType: \slider, spec: \midiCC, style: (row: 0, column:0.5, width: 0.84, height: 1.75 ) ), + ( key: \bX, + midiChan: 0, midiMsgType: \bend, elementType: \xfader, spec: \midiBend, style: (row: 1.66, column:0, width: 1.9 ) ), + ] ) ); From 08c3eb8d79dac676e26a0c3633ff1046913d496c Mon Sep 17 00:00:00 2001 From: Gil Fuser Date: Thu, 25 May 2017 16:07:08 +0200 Subject: [PATCH 3/3] making a group for all pads Changing again to name properly pads as 'pad'. I was trying to make the path to the elements shorter, so to access and element, i.e a pad in the hardware Bank A from the midi cc message type, one could just write elAt(\pcA, x). The two problems with that are: there's no "pcA" anywhere else in the Modality descs, and also would not be easy to treat all the pads, or all the pads from the bank A as a group, so it is less modal. I'm then reintroducing a longer path, but I think is for the better. I accept suggestions about naming the pads. I'm calling them \note for the midi-note-type ones and \ccm for the cc-midi-type. --- .../MKtlDescriptions/akai-mpkmini2.desc.scd | 217 +++++++++--------- 1 file changed, 114 insertions(+), 103 deletions(-) diff --git a/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd b/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd index b31ac394..ff3943db 100755 --- a/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd +++ b/Modality/MKtlDescriptions/akai-mpkmini2.desc.scd @@ -1,8 +1,5 @@ -// contributed by gil fuser /* -* todo: -* test on osx - +* todo: test on osx m = MKtl(\mpk2, "akai-mpkmini2"); m.gui; m.trace; @@ -29,107 +26,121 @@ deviceInfo: ( features: [\pianoKey, \pad, \knob, \bender], notes: "Uses only ```Program 1```.\n" - "To use the other programs use first: [MPK MiniMKII editor](http://www.akaipro.com/product/mpk-mini-mkii#downloads)\n" - "avoiding more mapping overlaping as occours in the defaults.\n" - "Accidental ```Prog-Change``` activation on the device needs to be reverted by ```Bank A/B```.\n", - longName: "AKAI MPKmini mk2" + "To use the other hardware programs is it suggested to first edit the midi mapping in the device in order to avoid overlapping as occours in the defaults.\n" + "Use the MKP Mini Editor for that. Download link here: : [MPK MiniMKII editor](http://www.akaipro.com/product/mpk-mini-mkii#downloads)\n", + longName: "AKAI MPKmini mk2" ), elementsDesc: ( - - elements: - [ - - // ------ pad BANK A note on-off------------- - ( - key: \pnA, - shared: ( elementType: \pad, midiChan: 0, spec: \midiVel, midiMsgType: \noteOn, groupType: \noteOnOffBut ), - elements: ( 44..51 ).collect{ |num, i| - ( - key: i.asSymbol, - shared: ( midiNum: num, style:( row: 1 - (i div:4), column: 2 + (i % 4)) ) - ) - } - ), - - // ------ pad BANK B note on-off ------------- - ( - key: \pnB, - shared: ( elementType: \pad, midiChan: 0, spec: \midiVel, midiMsgType: \noteOn, groupType: \noteOnOffBut ), - elements: ( 32..39 ).collect{ |num, i| - ( - key: i.asSymbol, - shared: ( midiNum: num, style:( row: 2.25 + (1 - (i div:4)), column: 2 + (i % 4)) ) - ) - } - ), - - // ------ pad BANK A cc ------------- - ( - key: \pcA, - shared: ( midiChan: 0, midiMsgType: \cc, elementType: \pad, spec: \midiCC ), - elements: ( 20..27 ).collect{ |num, i| - ( - key: i.asSymbol, - midiNum: num, - style:( row: 4.5 + (1 - (i div:4)), column: 2 + (i % 4)) - ) - } - ), - - // ------ pad BANK B cc ------------- - ( - key: \pcB, - shared: ( elementType: \pad, midiChan: 0, spec: \midiCC, \ioType: \inout, midiMsgType: \cc ), - elements: ( 28..35 ).collect{ |num, i| - ( - key: i.asSymbol, - midiNum: num, - style:( row: 6.75 + (1 - (i div:4)), column: 2 + (i % 4)) - ) - } - ), - - - // ------ knob ------------- - ( - key: \k, - shared: ( elementType: \knob, midiChan: 0, spec: \midiCC, midiMsgType: \cc ), - elements: ( 1..8 ).collect{ |num, i| - ( - key: i.asSymbol, - midiNum: num, style:( row: i div:4, column: 6 + (i % 4) ), - ) - } - ), - - //////// piano key ////////// - ( - key: \pkey, - shared: ( midiChan: 0, elementType: \pianoKey, groupType: \noteOnOff, spec: \midiVel ), - elements: - (0..120).collect { |i| - var pos = Piano.pos( i % 25, 0); - ( - key: i.asSymbol, - shared: ( - midiNum: i, groupType: \noteOnOff, - style: ( - row: ( i div: 25 * 1.5 ) + (pos.y * 0.6), - column: 10 + (pos.x * 0.65 % 25), - color: pos.color, - width: 0.9, - height: 0.75, - ) - ) - ) - } - ), - // ------- bend ------------ - ( key: \bY, - midiChan: 0, \midiNum: 2, midiMsgType: \cc, elementType: \slider, spec: \midiCC, style: (row: 0, column:0.5, width: 0.84, height: 1.75 ) ), - ( key: \bX, - midiChan: 0, midiMsgType: \bend, elementType: \xfader, spec: \midiBend, style: (row: 1.66, column:0, width: 1.9 ) ), - ] + + shared: (midiChan: 0), + elements: + [ + ( + // ------ pad ------------- + key: \pad, + shared: ( elementType: \pad ), + elements: + [ + ( + // ------ bank A ------------- + key: \bA, + elements: + [ + ( + key: \note, + shared: ( spec: \midiVel, midiMsgType: \noteOn, groupType: \noteOnOffBut ), + elements: ( 44..51 ).collect{ |num, i| + ( + key: i.asSymbol, + shared: ( midiNum: num, style:( row: 1 - (i div:4), column: 2 + (i % 4)) ) + ) + } + ), + ( + key: \ccm, + shared: ( spec: \midiCC, midiMsgType: \cc ), + elements: ( 20..27 ).collect{ |num, i| + ( + key: i.asSymbol, + midiNum: num, + style:( row: 4.5 + (1 - (i div:4)), column: 2 + (i % 4)) + ) + } + ), + ] + ), + ( + // ------ bank B ------------- + key: \bB, + elements: + [ + ( + key: \note, + shared: ( spec: \midiVel, midiMsgType: \noteOn, groupType: \noteOnOffBut ), + elements: ( 32..39 ).collect{ |num, i| + ( + key: i.asSymbol, + shared: ( midiNum: num, style:( row: 2.25 + (1 - (i div:4)), column: 2 + (i % 4)) ) + ) + } + ), + ( + key: \ccm, + shared: ( spec: \midiCC, midiMsgType: \cc ), + elements: ( 28..35 ).collect{ |num, i| + ( + key: i.asSymbol, + midiNum: num, + style:( row: 6.75 + (1 - (i div:4)), column: 2 + (i % 4)) + ) + } + ), + ] + ), + ] + ), + + // ------ knob ------------- + ( + key: \kn, + shared: ( spec: \midiCC, midiMsgType: \cc, elementType: \knob ), + elements: ( 1..8 ).collect{ |num, i| + ( + key: i.asSymbol, + midiNum: num, style:( row: i div:4, column: 6 + (i % 4) ), + ) + } + ), + + //////// piano key ////////// + ( + key: \pkey, + shared: ( spec: \midiVel, groupType: \noteOnOff, elementType: \pianoKey ), + elements: + (0..120).collect { |i| + var pos = Piano.pos( i % 25, 0); + ( + key: i.asSymbol, + shared: ( + midiNum: i, groupType: \noteOnOff, + style: ( + row: ( i div: 25 * 1.5 ) + (pos.y * 0.6), + column: 10 + (pos.x * 0.65 % 25), + color: pos.color, + width: 0.9, + height: 0.75, + ) + ) + ) + } + ), + + // ------- bend ------------ + ( key: \bY, + spec: \midiCC, midiMsgType: \cc, midiNum: 2, elementType: \slider, style: (row: 0, column:0.5, width: 0.84, height: 1.75 ) ), + ( key: \bX, + spec: \midiBend, midiMsgType: \bend, elementType: \xfader, style: (row: 1.66, column:0, width: 1.9 ) ), + ] ) );