Xone K2 with 3 decks + 1 effect unit

Hello everyone,

I am working on a mapping for the Xone K2 using Mixxx 2.2.4.

Instead of using the standard configurations with either 2 decks and 2 effect units, or 4 decks/effect units, I want to customise the mapping to have 3 decks on the first 3 columns and an effect unit on the fourth.

I would like to leave the top part of the column as it is, and just change the 4 bottom buttons to assign the effects to Channel1, Channel2, Channel3 and Master (+eventually headphones by pressing shift).

I started by adding an extra configuration at the beginning of the script and setting the Xone to that channel (G):

 XoneK2.oneEffectUnitRight123EMidiChannel = 0x6;

In the init section I also add the corresponding lines to map 3 decks and an effect unit (note the extra parameter in the effect unit, see below)

channel = XoneK2.oneEffectUnitRight123EMidiChannel;
XoneK2.controllers[channel].columns[1] = new XoneK2.Deck(1, 1, channel);
XoneK2.controllers[channel].columns[2] = new XoneK2.Deck(2, 2, channel);
XoneK2.controllers[channel].columns[3] = new XoneK2.Deck(3, 3, channel);
XoneK2.controllers[channel].columns[4] = new XoneK2.EffectUnit(4, 1, channel, false,     true);
XoneK2.decksLayerButton(channel, null, null, 0x90 + channel, null);

I also adapted the EffectUnit to take the 3 decks into account:

this.bottomButtons = new components.ComponentContainer();
var channelString;
libraryEffectUnit.enableOnChannelButtons.addButton('Channel1');
this.bottomButtons[1] = libraryEffectUnit.enableOnChannelButtons.Channel1;
libraryEffectUnit.enableOnChannelButtons.addButton('Channel2');
this.bottomButtons[2] = libraryEffectUnit.enableOnChannelButtons.Channel2;

if (twoDeck === true) {
    print('2 DECKS 2 EFFECT UNITS')
    libraryEffectUnit.enableOnChannelButtons.addButton('Master');
    this.bottomButtons[3] = libraryEffectUnit.enableOnChannelButtons.Master;
    libraryEffectUnit.enableOnChannelButtons.addButton('Headphone');
    this.bottomButtons[4] = libraryEffectUnit.enableOnChannelButtons.Headphone;
} 
else if (threeDeck == true) {
    print('3 DECKS ACTIVE ONE EFFECT UNIT')

    this.bottomButtons[3] = new components.Button({
        group: unitString,
        unshift: function () {
            this.disconnect();
            this.inKey = 'group_[Channel3]_enable';
            this.outKey = 'group_[Channel3]_enable';
            this.color = XoneK2.color.red;
            this.connect();
            this.trigger();
        },
        shift: function () {
       
         },
        type: components.Button.prototype.types.toggle,
    });
    this.bottomButtons[4] = new components.Button({
        group: unitString,
        unshift: function () {
            this.disconnect();
            this.inKey = 'group_[Headphone]_enable';
            this.outKey = 'group_[Headphone]_enable';
            this.color = XoneK2.color.red;
            this.connect();
            this.trigger();
        },
        shift: function () {
            this.disconnect();
            this.inKey = 'group_[Master]_enable';
            this.outKey = 'group_[Master]_enable';
            this.color = XoneK2.color.amber;
            this.connect();
            this.trigger();
        },
        type: components.Button.prototype.types.toggle,
    });
}
else {
    print('ELSE')
    this.bottomButtons[3] = new components.Button({
        group: unitString,
        unshift: function () {
            this.disconnect();
            this.inKey = 'group_[Channel3]_enable';
            this.outKey = 'group_[Channel3]_enable';
            this.color = XoneK2.color.red;
            this.connect();
            this.trigger();
        },
        shift: function () {
            this.disconnect();
            this.inKey = 'group_[Master]_enable';
            this.outKey = 'group_[Master]_enable';
            this.color = XoneK2.color.amber;
            this.connect();
            this.trigger();
        },
        type: components.Button.prototype.types.toggle,
    });
    this.bottomButtons[4] = new components.Button({
        group: unitString,
        unshift: function () {
            this.disconnect();
            this.inKey = 'group_[Channel4]_enable';
            this.outKey = 'group_[Channel4]_enable';
            this.color = XoneK2.color.red;
            this.connect();
            this.trigger();
        },
        shift: function () {
            this.disconnect();
            this.inKey = 'group_[Headphone]_enable';
            this.outKey = 'group_[Headphone]_enable';
            this.color = XoneK2.color.amber;
            this.connect();
            this.trigger();
        },
        type: components.Button.prototype.types.toggle,
    });
}

I have been playing around for a while with this but something isn’t still quite right. Is this the right way to go or am I missing something important?

Any hints will be greatly appreciated :slight_smile:

Thanks a lot!

attached the .js file for more information

Allen-and-Heath-Xone-K2-scripts.js (39.9 KB)

Hello everybody,

is there any news regarding this? For me just knowing if I am pointed in the right direction would be more than enough

Thanks!