Ignore repeated bangs when using Toggle and Timer

Dec 2, 2010 at 3:32pm

Ignore repeated bangs when using Toggle and Timer

I am using this patch to get midi values from a ‘touchpad’ (essentially a webcam looking at a sheet of paper). With careful setting of the threshold value, I *should be* able to accurately trigger the toggle box so that it is 1 when my finger is on the pad, and 0 when it is not.

But I need to time how long this lasts so I can send these values to a vst plugin (in real time when inputting, and non real time when entered into a sequencer). If you are able to look at the patch, my qmetro object sends a bang out every 250, which is then picked up at the other end by the toggle box. How do I stop the toggle from refreshing it’s value if it doesn’t change? I can think of a few (probably inefficient) ways of doing it, but I suspect there is a more straightforward way I am not aware of.

Cheers

– Pasted Max Patch, click to expand. –
#53687
Dec 2, 2010 at 4:05pm

looked at the patch, but have no webcam set up so can’t test it, but if i understand your question, a solution would appear to be the [togedge] object. You will continue to get bangs from your [> 170] so stick [togedge] directly after this condition

– Pasted Max Patch, click to expand. –

Brendan

#193099
Dec 2, 2010 at 4:21pm

Thats the one! Greatly appreciated Brendan

#193100

You must be logged in to reply to this topic.