Is it possible to program the Lich buttons as toggle buttons? So you press or trigger them and the light and value go on and you press again for off?
Well, detecting gate changes and generating trigger as events in your patch is not hard, obviously. But as for actual physical button / LED, they behave as button, not switches. And you canât have both at the same time.
Itâs possible to customize firmware to have different behavior if you think that you really need it. Just changing button click processing is not hard (as in editing 2 lines of code), but there could be other issues caused by this change. For example, if thereâs no hardware debouncing for buttons on Lich, you would be getting multiple events on button press. So you would need a few extra lines of code to ignore triggers coming faster than every 10-20ms.
Would it instead be possible to have the button LED available as a separate output, instead of it being hard-linked to the button and gate input? This way, I could implement the toggle functionality in patch itself, simply by making the button LED go on or off based on whatever condition I want in my patch.
It should be possible to do this in the patch, using output BUTTON_A and BUTTON_B to control the LEDs. So for each incoming âonâ button event you toggle your internal state, and set the LED correspondingly.
Itâs a bit of an edge use case so not sure we have any demo patches
And this should already work now?
Yes, try it out! What language are you using, FAUST?
Yes, faust. Iâll try later today. I guess it would be by using attach to a button?
You can use ba.impulsify to convert gates to trigger. But Iâm not sure about getting and setting the same button - it might work if there wonât be problems using both slider and bargraph + attach with it. I donât think it ever got tested before.
Actually, FAUST handles buttons and checkboxes separately, so we could handle checkbox widgets as switches, while button would behave the same way as currently.
The checkbox vs button would be great!
So I gave it s shot but it doesnât seem to work. There is a short flash of the LED when pressing it, but thatâs all.
It works when I use one button to toggle the other (change the button on line 11 to B1).
See here: https://www.rebeltech.org/patch-library/patch/lich_toggle_button
I would say that even if it worked, it would be too ugly compared to just using checkbox. Iâll try to get this working with a native widget. My Lich didnât arrive yet, but I can use OWL1 for testing using its pushbutton.
Itâs indeed quite ugly. If you want me to test something on the Lich, just send it over!
Sorry to say this, but it looks like itâs impossible to implement this kind of switch with a patch in current OWL firmware. Iâve discussed this with Martin and weâll see if it can be solved in a new firmware release.
Currently patch can set CV gate value, but not internal button state. This is why youâve only seen a flash when you toggle button value. Button would be reset on each UI update. The same happens if I set it from the FAUST integration code.
I think that firmware will eventually be updated to allow user patches to fully control internal button state, but no idea when it would happen.
I can set the state of one button with the other button though. In the patch I linked above, if one of the OWL:B2âs is changed to B1, it works as expected. Of course, it is quite a waste to use one button to toggle the other.
I am trying to get this to work with Gen~ right now - a bit different actually - holding the button would switch a knob to modify another parameter after 2 seconds. Works in Max but no dice on the lich so far. Will update with findings on why it wasnât a simple 1:1 translation
Dang, i think âLatchâ is not supported - it works like gate but keeps the last value that passed before output is switched. Am I missing it or was there a reason it wasnât included?
*edit: is Counter also not supported? I think it creates definitions for âcountâ and âcarryâ but I am not seeing them in genlib_ops.h
Is it correct that the compiler definitions are circa 2012?
quicklook makes me think Cycling 74 never defined these objects in the genlib - even the one from 2016 - yet it exports them in the cpp for the patch. Or they donât need to be since they are so simple?
edit: dont mean to spam - but might as well document.
Latch works correctly!
Counter seems to be an issue at the moment, will continue to investigate
edit2: looks like C++ awesomeness - in gen~ you can scale 0. 1. to 1. 0. to flip the range. Seems like this wasnât working correctly. Will look into it more and then post a button example. This thread got me thinking on minimal interfaces with 2 buttons modifying knobs or entering sub menus of sorts ala Mutable Instruments - love it
AFAIK they should all work. Let me know if that is not correct.
I just did it !
The solution is in the « problem » !
If the led do not stay « ON » because of the Lichâs refresh thing, just refresh the LED !