Toggle Plugins Script

I’m sure this is an easy one - but I haven’t found anything on this, and it would be a great start into GP scripting if you ladies and gents could help me along on this one first, if you don’t mind.

Situation is this: I’d like to route my MIDI input (keyboard) to EITHER ONE of two VST plugin synthies BY FOOTSWITCH. So I can toggle between brass and piano sound by pressing one of the buttons on my Icon G-Board.

It sounds so simple - probably I don’t need no scripting at all, could this be trhe case?

General thoughts: If you actually want to switch the MIDI input, you’d have to take care of not generating hanging notes by cutting the MIDI connection!
If your system can bear the two plugins playing at once, you maybe should go for just muting/unmuting channels of a mixer block where both plugins go into… you could also consider using something like a crossfade - either you can build something like that with internal tools (mixer block / fader widgets) or you could use a ready made plugin, like one from Melda…

1 Like

No scripting needed. Simply add two MIDI In blocks for your keyboard and attach one to your piano plugin and the other one to your brass plugin.

Now drop two buttons on a panel, attache them to the bypass parameter for each plugin respectively, but make sure that:

  • Both buttons are in the same GROUP
  • ONE of the buttons has inverted values

Learn one of the buttons to your footswitch. You may need the “Momentary to latching” option if your footswitch is momwentary.

2 Likes

thx for helping me there :slight_smile:

Did as you said - but the “INVERT” toggle I put on on of the panel buttons doesn’t seem to have any effect - they BOTH go on and off when I press the footswitch.

That is OK, but the values they send are different :wink:

1 Like

Got it! I just kicked one of them (the inverted one) OUT OF the group and learned both to the same foot switch :slight_smile:

Better you create a Widget Group,
Invert on of them and learn one of them to your MIDI controller.

2 Likes

Well, that’s what I did … I think.

Button “PIano”: Plugin A “Bypass Plugin”, Group “A”, “Mom to Latch”, Learned to Footswitch
Button “Brass”: Plugin B “Bypass Plugin”, Group “A”, “Mom to Latch”, “MIDI INVERT”, no learning

→ both switch off/on at the same time, so Plugs A and B are boith on or off

Working solution for now:
Button “PIano”: Plugin A “Bypass Plugin”, Group “None”, “Mom to Latch”,Learned to Footswitch
Button “Brass”: Plugin B “Bypass Plugin”, Group “None”, “Mom to Latch”, “MIDI INVERT”, Learned to Footswitch

→ either Plugin on while other is off

Aaaaand suddelny it doesn’t work any more :slight_smile: Hm.

With a widget group only 1 widget needs to be MIDI learned.

1 Like

May I walk you through this as I go along? Sorry, I’m new at this, I’ll be better in the future!

New toggle switch “Piano”:

  1. Mapped to Plugin A “Bypass Plugin”
  2. “GENERAL” TAB: Group A
  3. MIDI TAB: Mom to Latch ON; Behaviour “Jump”, no sync, no invert, no learning

New toggle switch “Brass”

  1. Mapped to Plugin B “Bypass Plugin”
  2. “GENERAL” Tab: Group A
  3. “MIDI” Tab: Mom to Latch ON, Behaviour “Jump”, no sync, invert ON, learned to footswitch

Both Plugs go on or off at the same time

That is OK and is designed this way.
The trick is that the value a widget sends to the assigned plugin is inverted.

1 Like

I got that. Butt the effect still is that BOTH plugins are switched off/on an the same time even if one of the toggles is inverted - I can hear it in my phones at the output.
I think in my case: the “INVERTED” toggle in the “MIDI” tab doesn’t seem to have any effect.
Is there another way to invert the toggle value?

You inverted the value.
Sure the inverted widget goes on - BUT the value is inverted.

Bildschirmfoto 2021-11-08 um 11.16.29

1 Like

I was seeing there might be some confusion between the ‘Invert’ button on the MIDI tab, and the ‘Reverse’ button on the Value tab. Judging by the first post only, I am thinking the ‘Reverse’ on the second widget is what’s needed?

3 Likes

Ha! That was it! Thanks mate - I inverted in the wrong place:

1 Like

Why are you MIDI inverting a button that’s not even MIDI learned?
Your second button should have its VALUE reverted/inverted, not MIDI and things will work properly

May I suggest at this point to try to go through the GP manual and get familiar with some of the basics. I think it will help you a lot.

1 Like

Yes, they should be saying “VALUE reversed” instead.

Yeah well my bad. Sorry.