The modified version is here: https://github.com/joelarson/mpk261-bitwig
Basically I want to know if it's possible implement a follow MIDI input function so when I hit a pad on the hardware the Drum Machine in Bitwig updates to the last pad I hit like an Ableton's Drum Racks. In other words, it selects it as if I were selecting it with the mouse thus displaying the chain following that particular pad.
Also, there's something funky in the script. I'll try and explain. When using the Drum Machine and adding samples the hardware will show where the samples are by lighting up that pad. That's cool and useful, but if I leave the Drum Machine track and come back to it all the pads light up to the color of the track (give or take due to the limited amount of colors), I realize this is part of the script when selecting a track in general. If I add another sample to Drum Machine, it will light up that pad alone leaving the rest dark, even if other pads have samples on them already. Ideally, if I return to a track with a Drum Machine on it, only the pads with samples should light up. Adding another sample would simply update the pads to reflect Drum Machine. Is this possible?
If for whatever reason no one can help, where can I look into this without learning JS over the next year?
The js files are:
MPK2_common.js
MPK2_PadClipLaunch.js
MPK2_PadInstrument.js
MPK2_PadSceneLaunch.js
MPK261.control.js
If it helps, this is what is on the "MPK2_PadInstrument.js". I'm assuming this where I'd be looking to add or fix things but I actually don't know. Script linked above.
Code: Select all
PadInstrument = new PadMode();
PadInstrument.handleMIDI = function(data1,data2) {
}
PadInstrument.handleNavKeys = function (data1) {
if (data1 == NAVKeys.LEFT) {
shifted ? cursorTrack.selectPrevious() : cursorDevice.selectPrevious();
}
else if (data1 == NAVKeys.RIGHT) {
shifted ? cursorTrack.selectNext() : cursorDevice.selectNext();
}
else if (data1 == NAVKeys.UP) {
shifted ? cursorDevice.switchToNextPreset() : cursorDevice.nextParameterPage();
}
else if (data1 == NAVKeys.DOWN) {
shifted ? cursorDevice.switchToPreviousPreset() : cursorDevice.previousParameterPage() ;
}
}
PadInstrument.init = function() {
if (displayHelpText) {
host.showPopupNotification("Pads: Instrument/Drum Rack Mode");
}
usingDrumMachine ? PadInstrument.lightPadsForDrumRack(CursorTrackColor) : lightAllPads(CursorTrackColor,"Off");
PadNotes.setKeyTranslationTable(PadMIDITable.ON);
}
PadInstrument.cursorTrackColorObs = function(red,green,blue) {
PadMode.prototype.cursorTrackColorObs(red,green,blue);
if (usingDrumMachine) {
PadInstrument.lightPadsForDrumRack (CursorTrackColor);
}
else {
lightAllPads(CursorTrackColor,"Off");
}
}
PadInstrument.cursorTrackInstrumentNameObs = function(track,text) {
PadMode.prototype.cursorTrackInstrumentNameObs(track,text);
usingDrumMachine ? PadInstrument.lightPadsForDrumRack(CursorTrackColor) : lightAllPads(CursorTrackColor,"Off");
}
PadInstrument.lightPadsForDrumRack = function(color) {
padIdent = minimumPadOff;
var MidiOut = "F0 47 00 " + uint7ToHex(PRODUCT_ID) + " 31 00 43 40 " + uint7ToHex(getMSB(padIdent)) + " " + uint7ToHex(getLSB(padIdent));
for (var x = 36; x < 100; x++ ) {
if (drumKeys[x] == false) {
MidiOut+= " " + uint7ToHex(padColors['Off']);
}
else {
MidiOut+= " " + uint7ToHex(color);
}
}
MidiOut+= " F7";
host.getMidiOutPort(1).sendSysex(MidiOut);
}
PadInstrument.cursorTrackpitchObs = function(key,name) {
PadMode.prototype.cursorTrackpitchObs(key,name);
PadInstrument.lightPadsForDrumRack(CursorTrackColor)
}