Setting PluginIsBypassed True, then immediately False acts as a toggle

If you set a plugin block’s status to bypassed, then immediately set it unbypassed as a response to a control (for instance, a button push), it behaves like a toggle, flipping on and off with each press of the button. Surely, this is not intended behavior. Code follows. Gif included.
Rackspace attached.

Var
   MidiInput : MidiInBlock
   Impulse : MidiInBlock

On ControlChangeEvent (c: ControlChangeMessage) From Impulse
    Select
    // Inst Set 1
    GetCCNumber(c) == 51 Do
        SetPluginBypassed(MidiInput, True)
        SetPluginBypassed(MidiInput, False)
        Print("Is plugin bypassed NOW? " + IsPluginBypassed(MidiInput))          
    End
End

GP Bug
toggle bug.rackspace (28.9 KB)

On Mac I cannot reproduce.
Which version of Gig Performer are you using?

I can reproduce on Mac, but my question would rather be: what are you trying to achieve?
Having commands to bypass then immediately unbypass would serve no practical purpose, from what I can see.

SetPluginBypassed(MidiInput, True)
SetPluginBypassed(MidiInput, False)

I do not understand:
In the Logger Window it says Plugin Bypassed = false and that is what the code does.
What do you think is wrong?

If you watch the plugin in wiring view, it will alternately bypass then unbypass on each midi message received.

You are right, Thx

The real reason for this has nothing to do with GPScript, but rather with the way things work in the MIDIIn block.

For any other block/plugin this will work properly and you will not even see the plugin being bypassed/unbypassed but for the MIDI In/Out blocks we have to take some special considerations when bypassing which produce this kind of behaviour if you, for some reason, do the above and bypass and unbypass the plugin in within a few milliseconds.

1 Like

What is the real use case which led you to this test Rackspace? Did you face any real life difficult situation?

1 Like

I have arrays of MidiInBlocks that I am considering “instrument sets”. I use a loop to bypass or unbypass every “instrument” (MidiInBlock) in the set. If two different sets contain the same “instrument” and I deactivate one set and activate the other, the “instrument” (MidiInBlock) is effectively cycled, as discussed. The expected output is a net zero change in state for the shared “instrument”. Instead, it toggles.

If I can’t do this then I guess I have to either target a different block type such as the plugin itself (easy enough),
or rework my bypassing function into something more complex that tries to account for whatever instrument is being turned on,
or scour the GP documentation for a recabling command?

And why could’nt you think of different rackspaces to host your “instuments sets”? :thinking:

Yeah, that’s an option. But not my favorite. I’d like to keep one rackspace per song, instead of having several rackspaces I need to switch through per song. This way I can use one program change that both cues up a song in ableton, and gets all the instruments for the song loaded. Then the same 3 or 4 buttons on my midi controller can switch between the appropriate sounds for that song. Less to fool with on stage. Cue song, change between correct instruments.

You know SetList Mode?

I can’t seem to find the option to edit my posts anymore for some reason, so adding in case it was unclear: I may use 3 or 4 instrument sets per song.

Vaguely aware that is exists. Perhaps it does what I want?

Take a look :wink:

…and give the documentation a chance.

2 Likes

The reason is you’re a new user and the discourse platform that we use limits what new users can do until it determines that the user is legitimate and not a spammer.

I’ve been a member of the forum since GP1 though.

But it seems you have not been very busy in the forum?

Used to be more active. I understand the forum backend was changed at some point, at which time I was reset to a new user. Anyway, at what threshold can I edit my posts again? Used to be able to.

Well, we switched from WordPress to Discourse quite a few years ago.
I’ve set your trust level to “Member” so you can now edit posts.

Be aware however that moderators are able to see edit history.