Of course thanks in advance for any help in resolving this case:)
BTW this community is lit.
Of course thanks in advance for any help in resolving this case:)
BTW this community is lit.
Hi there, I am new to programing, I spend almost two weeks of evenings solving, what should be easy in my expectations.
When I map slider to macro, functions that copies value to blank label (design choice) does not work
When I map slider dynamicaly by code, using Synth.setMacroControl everything is fine until I get to macro 8. When I have
Synth.setMacroControl(8, value);
in function it gets me
macroIndex must be between 1 and 8!
I paste whole construction below
Content.makeFrontInterface(1280, 720);
const var SL_MACRO1 = Content.getComponent("SL_MACRO1");
const var SL_MACRO_LABEL1 = Content.getComponent("SL_MACRO_LABEL1");
const var SL_MACRO2 = Content.getComponent("SL_MACRO2");
const var SL_MACRO_LABEL2 = Content.getComponent("SL_MACRO_LABEL2");
const var SL_MACRO8 = Content.getComponent("SL_MACRO8");
const var SL_MACRO_LABEL8 = Content.getComponent("SL_MACRO_LABEL8");
const var SL_MACRO4 = Content.getComponent("SL_MACRO4");
const var SL_MACRO_LABEL4 = Content.getComponent("SL_MACRO_LABEL4");
const var SL_MACRO3 = Content.getComponent("SL_MACRO3");
const var SL_MACRO_LABEL3 = Content.getComponent("SL_MACRO_LABEL3");
const var SL_MACRO7 = Content.getComponent("SL_MACRO7");
const var SL_MACRO_LABEL7 = Content.getComponent("SL_MACRO_LABEL7");
const var SL_MACRO6 = Content.getComponent("SL_MACRO6");
const var SL_MACRO_LABEL6 = Content.getComponent("SL_MACRO_LABEL6");
const var SL_MACRO5 = Content.getComponent("SL_MACRO5");
const var SL_MACRO_LABEL5 = Content.getComponent("SL_MACRO_LABEL5");
inline function onSL_MACRO1Control(component, value)
{
Synth.setMacroControl(1, value);
SL_MACRO_LABEL1.set("text", Math.round(value));
}
SL_MACRO1.setControlCallback(onSL_MACRO1Control);
inline function onSL_MACRO2Control(component, value)
{
Synth.setMacroControl(2, value);
SL_MACRO_LABEL2.set("text", Math.round(value));
}
SL_MACRO2.setControlCallback(onSL_MACRO2Control);
inline function onSL_MACRO3Control(component, value)
{
Synth.setMacroControl(3, value);
SL_MACRO_LABEL3.set("text", Math.round(value));
}
SL_MACRO3.setControlCallback(onSL_MACRO3Control);
inline function onSL_MACRO4Control(component, value)
{
Synth.setMacroControl(4, value);
SL_MACRO_LABEL4.set("text", Math.round(value));
}
SL_MACRO4.setControlCallback(onSL_MACRO4Control);
inline function onSL_MACRO5Control(component, value)
{
Synth.setMacroControl(5, value);
SL_MACRO_LABEL5.set("text", Math.round(value));
}
SL_MACRO5.setControlCallback(onSL_MACRO5Control);
inline function onSL_MACRO6Control(component, value)
{
Synth.setMacroControl(6, value);
SL_MACRO_LABEL6.set("text", Math.round(value));
}
SL_MACRO6.setControlCallback(onSL_MACRO6Control);
inline function onSL_MACRO7Control(component, value)
{
Synth.setMacroControl(7, value);
SL_MACRO_LABEL7.set("text", Math.round(value));
}
SL_MACRO7.setControlCallback(onSL_MACRO7Control);
inline function onSL_MACRO8Control(component, value)
{
Synth.setMacroControl(8, value);
SL_MACRO_LABEL8.set("text", Math.round(value));
}
SL_MACRO8.setControlCallback(onSL_MACRO8Control);
function onMacroControl(index, value)
{
if (index == 0)
{
SL_MACRO1.setValue(value);
SL_MACRO_LABEL1.set("text", Math.round(value));
}
else if (index == 1)
{
SL_MACRO2.setValue(value);
SL_MACRO_LABEL2.set("text", Math.round(value));
}
else if (index == 2)
{
SL_MACRO3.setValue(value);
SL_MACRO_LABEL3.set("text", Math.round(value));
}
else if (index == 3)
{
SL_MACRO4.setValue(value);
SL_MACRO_LABEL4.set("text", Math.round(value));
}
else if (index == 4)
{
SL_MACRO5.setValue(value);
SL_MACRO_LABEL5.set("text", Math.round(value));
}
else if (index == 5)
{
SL_MACRO6.setValue(value);
SL_MACRO_LABEL6.set("text", Math.round(value));
}
else if (index == 6)
{
SL_MACRO7.setValue(value);
SL_MACRO_LABEL7.set("text", Math.round(value));
}
else if (index == 7)
{
SL_MACRO8.setValue(value);
SL_MACRO_LABEL8.set("text", Math.round(value));
}
}
Thanks in advance