What's new

On controller / ui-control - controlling several send knobs on separate buses

KrisY

Noob in frenzy loop
Hello. I have a script that have UI-elements that control different functions. One of them is a switch that (if set to "1") activates a while loop, which is supposed to fade up the volume of several send knobs on an instrument bus. There are several IR convolution reverbs, and each of them is tied to a switch on the UI.

Ok, so one knob controls some send knobs, and another knob controls other send knobs. They are the same send effect knobs, but on different buses. I have several groups that are routed through separate buses to create bigger groupings.

The script is supposed to let one knob control the sends on certain buses. The other switch controls the other buses. They should be able to do their thing separately of each other. Independently of each other´s functions, so to speak. But if one is turned on, the other stops working.

Why??

Here is the script:
(only the on controller part, as I am keeping this issue separate from the rest of the script while testing my errors out.)


Code:
on controller



    if (%CC[64] > 63)                    { just needed for the while loop to stop if pedal is released, IE it stops the loop }
        $susPedalOn := 1                { ... and starts the deceasing vol. This is instead of using the "stop_wait" command, not in earlier versions }

        else

        $susPedalOn := 0

    end if



    {FIRSTLY, A IF STATEMENT FOR WHAT TO HAPPEN ON CONTROLLER IF A SWITCH IS ON, OR OFF, as seen in the "else" statement}

    if ($fxPedalIRstrResonance_MuteButton = 1)

        if (%CC[64] > 63)

            while ($increasingVol < $maxVolumeSendLevel and $susPedalOn # 0)
                wait(2000)

                { send 4(3) - string resonance send fade IN }
                set_engine_par($ENGINE_PAR_SENDLEVEL_3,$increasingVol*1815,-1,7,$NI_BUS_OFFSET + 0)   
                set_engine_par($ENGINE_PAR_SENDLEVEL_3,$increasingVol*1680,-1,7,$NI_BUS_OFFSET + 3)

            inc($increasingVol)
            end while

        end if

        if (%CC[64] < 64)

            while ($increasingVol > $minVolumeSendLevel and $susPedalOn # 1)
                wait(1000)

                { send 4(3) - string resonance send fade OUT }
                set_engine_par($ENGINE_PAR_SENDLEVEL_3,$increasingVol*1800,-1,7,$NI_BUS_OFFSET + 0)
                set_engine_par($ENGINE_PAR_SENDLEVEL_3,$increasingVol*1800,-1,7,$NI_BUS_OFFSET + 3)

            dec($increasingVol)
            end while

        end if

    else

        { send 4(3) - string resonance send fade OUT }
        set_engine_par($ENGINE_PAR_SENDLEVEL_3,0,-1,7,$NI_BUS_OFFSET + 0)
        set_engine_par($ENGINE_PAR_SENDLEVEL_3,0,-1,7,$NI_BUS_OFFSET + 3)


    end if




    {AND NOW ANOTHER IF STATEMENT WITH WHILE LOOPS FOR ANOTHER SET OF FUNCTIONS - IF THAT VARIABLE IS PRESSED...}

    if ($fxIRBox_MuteButton = 1)

        if (%CC[64] > 63)

            while ($increasingVol < $maxVolumeSendLevel and $susPedalOn # 0)
                wait(2000)

                { send 4(3) - string resonance send fade IN }
                set_engine_par($ENGINE_PAR_SENDLEVEL_0,$increasingVol*1815,-1,7,$NI_BUS_OFFSET + 0)
                set_engine_par($ENGINE_PAR_SENDLEVEL_0,$increasingVol*1680,-1,7,$NI_BUS_OFFSET + 3)
                set_engine_par($ENGINE_PAR_SENDLEVEL_0,$increasingVol*1680,-1,7,$NI_BUS_OFFSET + 6)

            inc($increasingVol)
            end while

        end if

        if (%CC[64] < 64)

            while ($increasingVol > $minVolumeSendLevel and $susPedalOn # 1)
                wait(1000)

                { send 4(3) - string resonance send fade OUT }
                set_engine_par($ENGINE_PAR_SENDLEVEL_0,$increasingVol*1800,-1,7,$NI_BUS_OFFSET + 0)
                set_engine_par($ENGINE_PAR_SENDLEVEL_0,$increasingVol*1800,-1,7,$NI_BUS_OFFSET + 3)
                set_engine_par($ENGINE_PAR_SENDLEVEL_0,$increasingVol*1800,-1,7,$NI_BUS_OFFSET + 6)

            dec($increasingVol)
            end while

        end if

    else

        set_engine_par($ENGINE_PAR_SENDLEVEL_0,0,-1,7,$NI_BUS_OFFSET + 0)   
        set_engine_par($ENGINE_PAR_SENDLEVEL_0,0,-1,7,$NI_BUS_OFFSET + 3)
        set_engine_par($ENGINE_PAR_SENDLEVEL_0,0,-1,7,$NI_BUS_OFFSET + 6)


    end if


end on


This seems like a correct method. :/
 
Top Bottom