Use Button to Turn Modules on and off at same time



  • Hi guys, I was hoping to script a button that would Bypass 3 Table Envelopes, whilst at the same time Enabling 3 different Table Envelopes (so you can switch between the two shapes).

    I was hoping there would be a .setEnabled function but alas it seems there is only .setBypassed; script below if anyone has any ideas...

    inline function onPITCHSHAPEControl(component, value)
    {
    //pitch
    local TEdx1 = 0 * TE1.BandOffset + TE1.Bypass;
    local TEdx2 = 0 * TE2.BandOffset + TE2.Bypass;
    local TEdx3 = 0 * TE3.BandOffset + TE3.Bypass;
    local TEdx4 = 0 * TE4.BandOffset + TE4.Enabled;
    local TEdx5 = 0 * TE5.BandOffset + TE5.Enabled;
    local TEdx6 = 0 * TE6.BandOffset + TE6.Enabled;
    TE1.setBypassed(value);
    TE2.setBypassed(value);
    TE3.setBypassed(value);
    TE4.setEnabled(value);
    TE5.setEnabled(value);
    TE6.setEnabled(value);
    };

    Content.getComponent("PITCHSHAPE").setControlCallback(onPITCHSHAPEControl);



  • setBypassed(false); = setEnabled 😛



  • So close yet so far 😆

    Thank you!



  • Ah so doing that leaves those 3 modules in a permanent state, rather than being switchable with the button...



  • @DanH

    TE1.setBypassed(value);
    TE2.setBypassed(value);
    TE3.setBypassed(value);
    TE4.setBypassed(1 - value);
    TE5.setBypassed(1 - value);
    TE6.setBypassed(1 - value);
    


  • @Lindon Perfect, thanks!!


Log in to reply
 

28
Online

810
Users

3.0k
Topics

25.5k
Posts