Hello,
I'm currently prototyping out a UI, which I'll refactor and clean up the code later, but I wanted to at least test it with a subset of the instrument's samples: Simple round robin selector and label.
The problem that I am running into right now is that the UI will not update unless I hit compile.
After that, everything works fine; however, I tested the vst3 of the instrument and all the underlying instrument logic (the important stuff) works except that the UI will not update as it should—like after I hit compile.
gGroupCounter is a global variable on a script beneath the interface where all my GroupTracking logic is occuring.
Init:
Content.makeFrontInterface(600, 600);
Synth.deferCallbacks(true);
const var Keyboard1 = Content.getComponent("Keyboard1");
const var Label1 = Content.getComponent("Label1");
for(i = 48; i < 79 + 1; i++ )
{
Engine.setKeyColour(i, Colours.withAlpha(Colours.aquamarine, 0.5));
}
//Black keys within range.
Engine.setKeyColour(49, 0x00);
Engine.setKeyColour(51, 0x00);
Engine.setKeyColour(54, 0x00);
Engine.setKeyColour(56, 0x00);
Engine.setKeyColour(58, 0x00);
Engine.setKeyColour(61, 0x00);
Engine.setKeyColour(63, 0x00);
Engine.setKeyColour(66, 0x00);
Engine.setKeyColour(68, 0x00);
Engine.setKeyColour(70, 0x00);
Engine.setKeyColour(73, 0x00);
Engine.setKeyColour(75, 0x00);
Engine.setKeyColour(78, 0x00);
Engine.setKeyColour(36, Colours.withAlpha(Colours.gold, 0.5));
Engine.setKeyColour(37, Colours.withAlpha(Colours.red, 0.5));
Engine.setKeyColour(38, Colours.withAlpha(Colours.red, 0.5));
Label1.set("text", gGroupCounter + 1);
Note On:
function onNoteOn()
{
Label1.set("text", gGroupCounter + 1);
switch(gGroupCounter)
{
case 0:
Engine.setKeyColour(36,
Colours.withAlpha(Colours.gold, 0.5));
Engine.setKeyColour(37,
Colours.withAlpha(Colours.red, 0.5));
Engine.setKeyColour(38,
Colours.withAlpha(Colours.red, 0.5));
break;
case 1:
Engine.setKeyColour(37,
Colours.withAlpha(Colours.gold, 0.5));
Engine.setKeyColour(38,
Colours.withAlpha(Colours.red, 0.5));
Engine.setKeyColour(36,
Colours.withAlpha(Colours.red, 0.5));
break;
case 2:
Engine.setKeyColour(38,
Colours.withAlpha(Colours.gold, 0.5));
Engine.setKeyColour(36,
Colours.withAlpha(Colours.red, 0.5));
Engine.setKeyColour(37,
Colours.withAlpha(Colours.red, 0.5));
break;
}
}