Looper control is always kind-of complicated, because as you describe 1 button doesn't control 1 on/off state, but a progression through several states.
Therefore it would be necessary to use a "TRIGGER" button instead of an "EFFECT" button to send the MIDI message and progress through the states. Then you could add a few dummy effect buttons (PLAYING, RECORDING, DUBBING,...) which don't send any MIDI but which you use just to show the current state
EFFECTS =
{
PLAYING
RECORDING
DUBBING
}
TRIGGERS =
{
REC/PLAY
PLAY/STOP
}
VAR $playing = false
VAR $recording = false
VAR $dubbing = false
EFFECT_ON PLAYING = $playing = true
EFFECT_OFF PLAYING = $playing = false
EFFECT_ON RECORDING = $recording = true
EFFECT_OFF RECORDING = $recording = false
EFFECT_ON DUBBING = $dubbing = true
EFFECT_OFF DUBBING = $dubbing = false
TRIGGER_CLICK REC/PLAY =
{
SendMidi MainStage ...
if(!$recording)
{
SwitchOn RECORDING
SwitchOn PLAYING
}
else if(!$dubbing)
{
SwitchOn DUBBING
}
else
{
SwitchOff DUBBING
SwitchOff RECORDING
}
}
TRIGGER_CLICK PLAY/STOP =
{
SendMidi MainStage ...
if($recording)
{
SwitchOff RECORDING
}
else if($playing)
{
SwitchOff PLAYING
}
else
{
SwitchOn PLAYING
}
}