Using conditional statements with Effects - UnO2


Mike Watkinson
 

It would be great to get some advice on using conditional statements, as I can express in English what I need but not figure out the correct syntax for expressing this in UnO2 Control Centre.
I am attempting to use two switches on the 1010 to control two buttons on a plugin, which are Record and Play (it's a looper plugin). When you click Record on the plugin the Play button also comes on, so I want the 1010/Uno2 to 'recognise' this.
So I'm using effect_on and _off so the two 1010 switches turn Rec and Play on and off and currently these are not related by conditions but what I'm thinking is:
When sending effect_on to the Rec switch, if the Play switch is 'off' turn it on, and if the Play switch is On, leave it On.

Also when sending effect_off to the Rec switch, same conditions (if the Play switch is 'off' turn it on, and if the Play switch is On, leave it On)

Is that even possible? In the manual it only illustrates conditionals with Presets (not Effects)

Thanks in advance


ossandust
 

VAR $playing   = false
VAR $recording = false

EFFECT_ON PLAY =
{
   // SendMidi MainStage ...
   $playing  = true
}
 
EFFECT_OFF PLAY = 
{
   // SendMidi MainStage ...
   $playing = false
}
 
EFFECT_ON RECORD = 
{
   // SendMidi MainStage ...
   if(!$playing)
      SwitchOn PLAY 
}
 
EFFECT_OFF RECORD =
{
   // SendMidi MainStage ...
   if(!$playing)
      SwitchOn PLAY 


ossandust
 

In a future UnO2 firmware release you will be able to use the effect states in conditional commands. At that moment it will no longer be necessary to store the effect state in variables. The code could then become something like this : 

EFFECT_ON PLAY  = SendMidi MainStage ...
EFFECT_OFF PLAY = SendMidi MainStage ...
 
EFFECT_ON RECORD = 
{
   SendMidi MainStage ...
   if(EFFECT_OFF PLAY) 
      SwitchOn PLAY 
}
 
EFFECT_OFF RECORD =
{
   SendMidi MainStage ...
   if(EFFECT_OFF PLAY) 
      SwitchOn PLAY 
}  


Mike Watkinson
 

Now - I knew this might be tricky to get the hang of - but your reply might take me a little while to unpick: see image 😂
Possibly my browser?


Mike Watkinson
 

It is my browser - I was in Safari, now in Chrome - all good. Thanks for the swift reply. I'll give this a go - much appreciated.