Hey! I have an effect built in scriptfx that i'm using the below code to essentially trigger the effect on and off depending on your DAW's playback state.
This works perfectly fine inside HISE and when the plugin UI is open in your DAW, but the moment you close the plugins UI in your daw, it ceases to work.
What am I missing?
Cheers!
const var HardcodedMasterFX1 = Synth.getEffect("HardcodedMasterFX1");
const var handler = Engine.createTransportHandler();
handler.setOnTransportChange(false, function(playing)
{
if (playing)
{
// DAW is playing
HardcodedMasterFX1.setAttribute(HardcodedMasterFX1.gate, 1);
HardcodedMasterFX1.setAttribute(HardcodedMasterFX1.switchy, 1);
}
else
{
// DAW stopped
HardcodedMasterFX1.setAttribute(HardcodedMasterFX1.gate, 0);
HardcodedMasterFX1.setAttribute(HardcodedMasterFX1.switchy, 0);
}
});