Hello,
I am a bit stuck with getting the LEDs to work. I am quite a newbie to Javascript, so please forgive the shallowness of this question.
The HC1000S has the same midi-channel for left and right. Since I am porting from the MC6000 which uses another channel for each deck I need to change the script a bit.
so what I am trying to do is use a different base address to turn on the LED depending if I am on the right or left side. But I am not sure how the syntax is to query this.
so in the XML the hotcue entry looks something like this. How can I say in the script if what’s written in the group equals something like channel2 use a different base address for the LEDs:
<control>
<group>[Channel2]</group>
<key>DenonHC1000S.rightDeck2.hotcueButtons[1].input</key>
<status>0x80</status>
<midino>0x75</midino>
<options>
<script-binding/>
</options>
</control>
the section in the javascript looks something like:
DenonHC1000S.Deck = function(number, channel) {
DenonHC1000S.logDebug("Creating deck: " + number);
components.Deck.call(this, number);
//left or right buttons //DenonHC1000S.sidesByGroup
this.hotcueButtons = [];
if (channel == 1 || 3) {
for (var i = 1; i <= 5; i++) {
this.hotcueButtons[i] = new components.HotcueButton({
midi: [0xB0 + channel, 0x11 + 2 * (i - 1)],
number: i,
});
}
} else {
for (var i = 1; i <= 5; i++) {
this.hotcueButtons[i] = new components.HotcueButton({
midi: [0xB0 + channel, 0x61 + 2 * (i - 1)],
number: i,
});
}
}
// Set the group properties of the above Components and connect their output callback functions
var thisDeck = this;
this.reconnectComponents(function(component) {
if (component.group === undefined) {
component.group = thisDeck.currentDeck;
}
});
};
currently it always starts the lights with 0x11 for both sides, as my condition seems not to make sense or my else is never reached. Any help would be very appreciated. thank you! 