Button with two functions (hook object help!)


#1

Hey.

So, I've got this axo-based guitar pedal that has two footswitches plus a bunch of knobs. The first footswitch is just an on/off switch (faux bypass), but I want the other one to function as follows:

Single press (short): Turns something on/off

Long press (hold down): While holding this down, I want to be able to control hidden/secondary parameters with the knobs, i.e. I don't want the primary functions to move, nor turn on what gets turned on with a short press. When I release the footswitch, I want to be able to control the primary controls again. Obviously, if the primary function was knob at minimum, and secondary parameter was just set to max, moving the knob to control primary function again would result in a swift skip in whatever the primary function is. That's fine. The secondary functions I have in mind are more of a "set and forget before playing" sort of deal, and not so much something that will be messed with mid-song.

I've read about hook objects, I've tried using them, but I can't for the life of me figure out how to make them work to do what I just wrote. I just don't get the logic to unhooking or what I'm missing for it to work the way I want. Can someone with some knowledge mock up for me an example of the objects needed? I'm sure it's child's play for a bunch of you wizards. I'd really appreciate it, because I'm lost yet also inspired to create. Bad combination.


#2

Did you check 'click hold' or 'axoctrl_button' objects? they both feature separate outs for long and short button press


#3

Yes, but it's all glitchy and inconsistent, still occasionally triggering both bools when I tried it, or triggering the short when releasing the long.

Regardless, I'd still need to understand how what I want works using the hook objects as well.:sweat_smile:


#4

Hmm, if the signal from the button is noisy (switch debounce is causing glitches?) you could try to filter unwanted 'bursts' using low-pass filter :thinking:


#5

That could work. I'll give that a go, thanks! Even so, I would be really pleased if someone could show me how to set it up with the hook object!


#6

Interesting problem, this was fun! I also have a lot of unwanted jitter on connected hardware buttons, getting rid of that is probably a topic all of its own.

I made this construction that's probably way too big and complicated :sweat_smile:. Pressing the button makes a square LFO trigger a counter. If it reaches a certain value a toggle gets triggered that can be connected to hook objects. For short presses that do not get triggered if the toggle was set to 1 I found "logic_change" to somehow work. The "delayedpulseduration" object is only there to make the trigger visible on the "disp/bool" object!

As it grew bigger than expected I'll also include the patch with an example of connecting hook objects: long press shift button.axp (7.9 KB)

Edit: you can of course get rid of the "logic/and" and toggle object at the beginning and directly connect your button to "mux 2":roll_eyes:


#7

You're an absolute beast! Thank you very much! I'll give it a go when I get back home this weekend! Very excited!


#8

I still need some help with this, if there are anyone left here :sweat_smile:


#9

Sure, just ask your question!


#10

How to get the hook objects to act like I described in the first post. :smile:


#11

I'd like to help, but I really need more details. What works, what doesn't? I've read again through your first post and that should work utilizing the connections I showed in the patch that I uploaded. Exept for the potentiometer behavior, that's set by default so you have to catch the value that was selected beforehand instead of jumping to new values, but I guess that's even better.
Maybe just upload your patch?


#12

I have two approaches to pages of controls, one using tables instead of hooks, the other using the MultiPot 3 objects. I've made some examples below.

I usually use the table way because my preset system relies on tables so I need my controls in tables anyway. It works great with jitter free controls (like midi) but jittery hardware knobs can cause issues.

So if I've got jittery knobs I use the multipot method because I like it's 'deadbandsize' feature for handing jitter.

Regarding the footswitch logic, I did it like this - if you release the button within half a second it does the on/off trigger. The control pages are always switched while the switch is held, like a shift button. It shouldn't matter that it switches back and forth quickly on a short button press as it won't change any settings (unless a knob is turning at the same time).

knob banks table.axp (13.2 KB)

knob banks multipot.axp (12.2 KB)


#13

That is simply perfection. Exactly what I needed. Works like a charm. Thanks to both of you for helping out! Hopefully this thread will be useful for other head-scratchers like me!