When I have 2 Keyboards, is there a way to colour them differently, i.e. through Engine.setKeyColour()
?
My problem is that each keyboard has another Samplemap loaded with different missing samples, which I want to highlight with a red colouring. Do you think it's necessary to use CustomGraphics to achieve this?
Here's an example-code, which only colours both Keyboards:
const var Keyboard = Content.addFloatingTile("Keyboard", kbposx, kbposy);
Content.setPropertiesFromJSON("Keyboard", {
"width": kbwidth,
"height": kbheight
});
Keyboard.setContentData({"Type": "Keyboard", "LowKey": 31, "HiKey": 84, "MidiChannel": 1, "CustomGraphics": false});
const var Keyboard2 = Content.addFloatingTile("Keyboard2", kbposx, 450);
Content.setPropertiesFromJSON("Keyboard2", {
"width": kbwidth,
"height": kbheight
});
Keyboard2.setContentData({"Type": "Keyboard", "LowKey": 31, "HiKey": 84, "MidiChannel": 2, "CustomGraphics": false});
const var missing_list_1 = [31, 36, 43, 50, 55, 57, 64, 71, 78, 84];
const var missing_list_2 = [34, 35, 39, 59, 68, 79];
function markMissing(miss_list) {
reg i;
for (i = 0; i < miss_list.length; i++) {
Engine.setKeyColour(miss_list[i], Colours.withAlpha(Colours.red, 0.3));
}
} // this function will be called with one of those arrays as an argument
Thanks in advance, any thoughts on this are appreciated!