Hey,
I made a hardware box with some arcade style buttons.
Everything works well but they double trigger a lot.
I wanted to use a gate so that after i hit the button that the signal get's cut off for a fraction of a second to disable the double triggering.
Since i did not find a gate object , i tried to make something myself and it works but when you hold the button it acts like a repeater cause everytime the toggle object toggles the table play interprets it as a new pulse and plays the sample again.
I'm going to keep this to use as an effect later but i don't want it for the double trigger problem .
Any idea's to fix this?
I included a picture.
Thanks
Stop double triggering on hardware button
Sounce like your button is bouncing.
Very common.
What you need is "Debounce" method.
2 options available, hardware, using a simple debounce circuit, software, a debounce code.
If you search debounce in the forum, you will find a few items, if you search debounce on the web, you will find months of reading and learning from simple options to some rather complex ones.
Your picture shows the objects might not be placed in the right order. You need to place them in their logical order otherwise the signal won't process correctly.
It processes the objects from left to right, top to bottom.
Hey gavin.
Thanks for the reply.
I'll try the software debounce method first.
That's probably the easiest and cheapest method.
Greetings...
Ok so after some searching i found this image of a hardware debounce with a 1uF capacitor.
I took a brake for working on my box too
Will this work?
It seems to be the easiest solution.
There seem to be a few different methods of hardware debouncing.
Anyone know how long the delay will be with this 1uF capacitor , if there's any at all ?
Thanks again
That looks incomplete to me, since it needs VDD to be connected to get voltage for input.
This page has something that looks right.
Just to note, I have not yet experienced any bouncing issues on the GPIO digital inputs on the Axo, maybe its the momentary switches I am using. I do believe toggle switches are more likely to bounce then momentary, this might be something you want to consider, you just apply an object to make a momentary rising edge toggle.
I have many objects already that can provide many options here I hope to eventually contribute to the community.
There are many debounce methods and theories. Some are very detailed, I steer away from these ones.
I guess the best option is to test it and see if it meets your needs.
Trial and error.
I got to thinking a little more about this, there could be a simple object solution that will allow the triggering from the beginning without delay by coding an object that once triggered, it will not allow any further changes until a period of time has passed.
So trigger arrives being a condition of different from previous, have an integer start from zero, every krate pass it increases by 1, while integer is less then 60 (my guess of maybe 1/50th of a second, or make it an adjustable parameter for fine tuning), the input is not again read until it reaches 60.
Would this work with your setup ?
thanks thetechnobear , i'll make a note of it.
I'm putting together a list of things to place an order and i'm still looking for a couple of things.
Hey gavin,
That was what i was trying to do with the example i posted in the first post.
When you press the button it goes through a mux and straight to the table play , but it also goes to a delay and a toggle. So pressing the button triggers the toggle that then switches the mux so it changes to the unconnected input so nothing from the button gets through anymore. Then the delayed pulse triggers the toggle and sets the mux back to the connected input .
This works but if you hold the button too long it keeps on triggering the sound because everytime the mux switches , the table/play see's that as a new trigger.
I just need an object that let's through one trigger, turns off for a set time and then back on.
No worries,
I built an object that does what you want in reverse, which means its a momentary for a period of time, once the time has passed it becomes a toggle. So its like two switches in one. All I need to do is reverse it.
Its morning here in AUS at the moment so I won't get to look at it till late tonight, but I should be able to come up with something.
Will let you know.
After trying to strip it back to the basics, I wanted to ensure stock objects did what was required.
Following should meet your needs or get you started.. All are factory objects..
The timer/pulselength parameter is to set the time for the pulse to remain high during the period of when the bouncing will occur. Once the period passes, it will default to the switch / button state.
Ensure to keep the objects or your equivalent ones in the same order I show.
Let us know how you go.
Hey gavin,
Good work
That's exactly what i need right now and really easy too
I still have a lot of things to learn about all the different objects.
Thank god for all the helpfull people on this forum
Right now i built my axoloti into a lunchbox and connected 4 buttons for drums , 1 for bass , 1 for sample select and 6 dials to change the sound.
The things i spent most time on is to find a way to send the 6 dials to the parameters of the sound that was last triggered and offcourse this double triggering problem.
Another step closer to the finish of my first project.
Right now i'd really like to add a way to live record a sequence and overdub.
Something easy like a four bar loop and a button to start/stop record/overdub, a metronome and a clear button.
Time to look into table's i guess
Thanks
This works great, thank you!
Could you explain what the OR is doing here? I assume it has something to do with processing speed or execution order?
There are 2 signals going into the OR, one from the momentary switch, the other from the pulse length.
For the OR to go high, one of these needs to be high.
So for the steps..
- Press the momentary switch.
- pulselength triggered, goes high and remain high for the given period of time.
- at the same time the pulselength is high, the momentary switch can either be high or low which is what happens during bouncing, but the logic OR will still output high.
- when the pulse length finishes, then the logic OR will rely totaly on the momentary switch to remain high, with at which point you can release the switch returning to the low state of the switch.
In summary, it just tries to give a little wait time for the bounce to finish before returning to the switches natural state while being pressed.
All switches function differently, as in different bounce characteristics, so by adjusting the pulse length, you can fine tune your debounce.