LV2 Momentary Pushbutton Switch Port

I have a use-case where I would like to have a momentary normally-open push-button switch in my plugin.

The idea is that while someone holds their foot on the switch (or button holds done using mouse click in GUI), the plugin sees an ON for the port, and when they release the footswitch, the plugin sees an OFF for the port.

Based on Define Footswitch as hold button - #26 by Pablo it is possible for physical foot-switches by assigning the momentary on/momentary off in the button assignment page as per image below.

image

However, I also want this to work in the auto assigned buttons page. The only way I can get a non-latching boolean control is by using a pprop:trigger (like the image below) but this is doing down edge trigger event and doesn’t support something like the “hold”

If I don’t use a pprop:trigger, then I get a normal latching switch like in the following image:

So it seems we can change the way the physical foot-switches are assigned to the latching bool ports, but I cant find a way to just specify the LV2 port is a momentary NO switch.

Does anyone know a way for this to work or would I need to create a new feature request?

1 Like

This is how I declare the REC/DUB button for the LP3:

 [
		a lv2:InputPort, lv2:ControlPort;
		lv2:index 22;
		lv2:symbol "rec_dub";
		lv2:name "Rec/Dub";
		lv2:minimum 0;
		lv2:default 0;
		lv2:maximum 1;
		lv2:portProperty lv2:integer, lv2:toggled, pp:trigger ;
	]
2 Likes

Thanks for the info, but it seems it behaves the same as “pprop:trigger” alone. That is also how I declare my quick adjust at the moment. Its just that it is edge triggered and can’t seem to support “hold” like functionality. I.e. Keep quick adjusting while I am holding the button down. Instead it just does it once

        a lv2:InputPort , lv2:ControlPort ;
        lv2:index 10 ;
        lv2:symbol "quick_adjust" ;
        lv2:name "Quick Adjust" ;
        lv2:default 0 ;
        lv2:minimum 0 ;
        lv2:maximum 1;
        lv2:portProperty lv2:integer, pprop:trigger, lv2:toggled ;

        # lv2:toggled : Makes a stateful switch can be flicked either side, not momentary but latched
        # pprop:trigger : Makes a momentary switch *cant* be held down but is down-edge triggered
        # lv2:toggled + pprop:trigger : Seems the same as "pprop:trigger" on its own
        # @todo I really want something that is on while it is down and off when it is up. Seems it isn't possible.
        # The goal is it is in quick adjust mode while you are standing on the footswitch but normal mode otherwise
1 Like

Sorry. Posted the wrong one. My software is able to distinguish a long press from a short press on this button.

[
		a lv2:InputPort, lv2:ControlPort;
		lv2:index 20;
		lv2:symbol "loop_multi";
		lv2:name "Loop";
		lv2:minimum 0;
		lv2:default 1;
		lv2:maximum 1;
		lv2:portProperty lv2:integer, lv2:toggled, mod:preferMomentaryOnByDefault ;
	]
5 Likes

Thanks. That works!

It gives a sideways sliding button image instead of a push-button but it works correctly as a momentary switch and I can always add a push button to the pedal GUI anyway. Thanks!

5 Likes