Se Connecter:     


Forum: General Discussion

Sujet: Script School - Page: 54
Hello!

I have a question about the display behavior of buttons or pads. (on/off)

I tried creating pads with these:
(browser_window 'remixes' && show_splitpanel 'sideview')
(browser_window 'automix' && show_splitpanel 'sideview')


If the remixes tab is active, then my remixes pad will be on, and the automix one will be off as expected.

Unfortunately, the action is not exactly what I wanted so I did this instead:
(browser_window 'remixes' && show_splitpanel 'sideview') ? show_splitpanel 'sideview' off : (show_splitpanel 'sideview' on & browser_window 'remixes' on)

(browser_window 'automix' && show_splitpanel 'sideview') ? show_splitpanel 'sideview' off : (show_splitpanel 'sideview' on & browser_window 'automix' on)


The action is now fine but the pad status is now reversed?? I don't undersant why and I'm running in circles trying to fix it.

Thanks in advance for your help!
 

locoDog wrote :
deck 'side' will work, best practice depends on case.

Thanks!
 

(browser_window 'remixes' && show_splitpanel 'sideview') ? on & show_splitpanel 'sideview' off :  off & (show_splitpanel 'sideview' on & browser_window 'remixes' on)


common mistake when first dealing with button led logic, the reply to the query to turn the thing off should first tell the led to be on [because it is on], LED queries happen constantly, unlike button press triggered queries that only happen when button pressed.
 

@Yan Duval:

A lot of times it's easier (and preferable) to "unlink" the led query (when the led is on) from the action of the pad.

Take a look at these examples:
<pad1 name="`get_effect_name 1`" color="effect_active 1 on ? var_equal &apos;FX1MomPush&apos; 0 ? color &apos;green&apos; : color &apos;blue&apos; : color &apos;blue&apos;" query="var_equal &apos;FX1MomPush&apos; 0 ? effect_active 1" autodim="false">effect_active 1</pad1>
<pad5 name="^ MP" color="effect_active 1 on ? var_equal &apos;FX1MomPush&apos; 1 ? color &apos;green&apos; : color &apos;blue&apos; : color &apos;blue&apos;" query="var_equal &apos;FX1MomPush&apos; 1 ? effect_active 1" autodim="false">effect_active 1 on while_pressed &amp; set &apos;FX1MomPush&apos; 1 while_pressed</pad5>
 

Thank you both for your help.

I'll try these and come back to you!