# Scripting a button to bypass an effect?



## Jvidia (Apr 11, 2012)

How can i go about doing as the title says?

http://i44.tinypic.com/1rrvjm.jpg

I'm wanting to add a switch/ button to my main screen GUI that can toggle this, any help is appreciated![/img]


----------



## Jvidia (Apr 11, 2012)

on init

set_ui_height_px(350)
make_perfview
message("")
declare $count := 0
declare ui_switch $S0
move_control($S0,6,5)

end on
on ui_control($S0)
set_engine_par($ENGINE_PAR_EFFECT_BYPASS,$S0,-1,-1,-1)
end on


What i doing wrong :/


----------



## Big Bob (Apr 11, 2012)

First, Since it's an insert effect, the last par needs to be 1 not -1.

Second, the 2nd last par needs to be the 'slot' the effect is in which, according to your pix would be 5. So, I would start with changing your set_ep line to:

set_engine_par($ENGINE_PAR_EFFECT_BYPASS,$S0,-1,5,1)

Rejoice,

Bob


----------



## Jvidia (Apr 12, 2012)

Thank you Bob, i have alot to learn but this community has given me a lot of help so far!

I think its the numbers i get confused with:

-1(Not sure) 5(Insert Number) 1(Because its an insert?)


----------



## mk282 (Apr 12, 2012)

First number is the group index. So if you're not targeting a group FX from a certain group, that has to be -1 (otherwise, it's 0-based, so group 1 is 0, group 2 is 1, etc). Second number is the slot (from 0 to 7) in which the effect is located. Third number is -1 when you're targeting group FX, 0 when you're targeting send FX, 1 when you're targeting insert FX.


----------



## Jvidia (Apr 12, 2012)

mk282 @ Thu Apr 12 said:


> First number is the group index. So if you're not targeting a group FX from a certain group, that has to be -1 (otherwise, it's 0-based, so group 1 is 0, group 2 is 1, etc). Second number is the slot (from 0 to 7) in which the effect is located. Third number is -1 when you're targeting group FX, 0 when you're targeting send FX, 1 when you're targeting insert FX.



Thank you so much for your help!


----------



## Jvidia (Apr 14, 2012)

So how owuld one go about scripting a ui slider to control a slider the speed knob on a rotator effect?


----------



## Jvidia (Apr 14, 2012)

on ui_control($SL0)
set_engine_par($ENGINE_PAR_RT_MIX,$SL0,-1,7,1)
end on

Worked that out, but when i move the slider it doesnt affect anything, apart from taking the mix to 0%


----------



## Jvidia (Apr 14, 2012)

Figure it out


----------

