Converting momentary MIDI CC to toggle

Not sure how to best phrase this question, but here goes:

I’ve got a MIDI controller set to send MIDI CC toggle messages to trigger some switches in my plugins. This works great, as long as the state of the plugin doesn’t change.

However, when I switch states, the toggle state of the footswitch no longer (necessarily) reflects the toggled state of the plugin, so now I have to press the footswitch twice to get back in sync.

Does anyone have a solution for converting momentary messages to toggles? My assumption is that this will depend on the plugin, not Cantabile, but maybe there’s something I haven’t thought of yet.

What I would probably need is for the plugin to accept a “switch current state” command, instead of just a 0/127 value, right?

The plugin that receives my MIDI CCs at the moment is Blue Cat Remote Control, which I don’t think supports this type of “switch state” behaviour. However, it does support sending the current state of all switches when its state changes, so maybe that can be used for something?

I’ve got the latest version of Cantabile Performer, in case that matters.

If I remember correctly, then bindings read the state of the binding point when trying to use them as toggle. I know there is a thread somewhere about it, but I can’t figure out what to search for.

Anyway, my suggestion would be to try to use a binding to connect to the value you want to toggle and see if you can toggle it that way. I’ll see if I can find the thread, though.

Edit, found it: Feature Request: "toggle" binding for VST parameters

1 Like

Hi Eskil,

I hope I understood the question and am throwing this out there in hopes it will help. :slight_smile: If you use “Entire Bank” as the state behavior for the plugin in question here it causes each switch to be remembered for each state and could explain why it will toggle on a state change with no manual input from you. If you use “Selected Program” the plugin state remains as it was when first loaded throughout song state changes and so if you change or toggle a switch it will remain as you switched it through out the states in the song. If you want the toggle switches in the song set at the load you set them in the GUI and save the song with the preset unlocked. Lock it when done and it will always load as it was saved before locking. Once the song is loaded you can manually change toggled switches in the plugin and they should remain as set throughout any song state changes you might make.

Monentary switch to plugin toggle switch binding example:

Cheers,

Dave

3 Likes

Thanks so much for that last screenshot, that solved it. I had set mine to “Controller”, which meant I didn’t have the “Command to value” mapping available. Setting it do “Controller (No Edge Button)” fixed it.

Not sure what “Controller (No Edge Button)” actually means, but I guess that’s for further research down the line :smile:

Looks like this requires me to “hard code” all the CCs that are forwarded to the MIDI Remote plugin (and not just pass them on “as is”), but that’s fine. It’ll never be more than 10-12 commands, so adding a few manual mappings is perfectly fine. One incoming CC gets translated to one plugin switch toggle, which is what I need.

1 Like

No problem :slight_smile: , a no edge switch is also more commonly called a momentary switch. It produces a value of 127 when pressed and 0 when released and 0 is also the value where it rests. The edge is the transition from 0 to 127 most commonly but it can also be the transition from 127 to 0 if you set it up that way.

1 Like

Not quite: a “no edge” button binding differentiates from the normal button behavior as follows:

  • a “normal” button binding will fire every time the value of the CC crosses the “edge” from below 64 to 64 and above. This means that a Button binding will not fire when receiving repeated values above 64; values need to return to below 64 before that button is able to trigger again. You would typically use these for buttons that send CC values of 127 when pressed and 0 when released. But you can also abuse that binding for other things (see below)

  • a “no edge” button will trigger every time it receives a non-zero CC value

If you have buttons or pedals that send 127 on being pressed and 0 on being released, the behavior of “Button” and “No Edge Button” is exactly the same

You can use the “button binding” not only with two-value buttons, but also with continuous controllers like pedals or dials. E.g. using a volume pedal to trigger something every time you depress the pedal beyond its mid-point. You’ll need to use a “normal” button binding, since you only want that binding to fire when the volume pedal crosses the threshold from below to above. If you used “no edge button”, you would get multiple firings of the binding whenever you move the pedal (since it will send multiple CC values during that move) - not good for controlled triggering…

I typically use “no edge” bindings with my controller keyboard buttons which only send CC values of 127 when pressed - and nothing when released. With a normal “button” binding, these would only fire exactly once and then wait for the CC value to drop below 64 again (which never happens). No-edge bindings will fire on every press of the button.

1 Like

Exactly, this functionality is working as you describe. When you create a toggling binding to a VST parameter (or a Cantabile parameter like output volume) that Cantabile can read, it will check that parameter before switching and if it is on one of the values in its value list, change to the next value in the list to avoid re-applying the same value.

Reminder: a toggle binding is one with two values in its value field, like the following example:

This one will switch the output volume of the Dexed plugin between half and full value whenever you press the sustain pedal (whatever use this might have :wink: - it’s just an example…). And it will read the current value, so if volume is currently at 0.5, it will immediately go to 1 when triggered.

I use this typically with my Hammond organ plugins - I bind a button or pedal to the Leslie speed and toggle it between fast and slow. By reading the current value, Cantabile can save me having to hit the pedal twice to re-sync…

But note: this only works with values that Cantabile can actually read - it will not work with bindings where the target is a MIDI value. So if you are toggling a parameter via MIDI, Cantabile can’t read the current state, so this will simply follow the list:

2 Likes