[PD] debounce (WAS: Re: [HID] Object - How to Ignore message event...)

Derek Holzer derek at umatic.nl
Fri Aug 17 11:09:54 CEST 2007


Ahhhh! Now I think I understand. Perhaps you want a "debounce", so that
your key can only be triggered once within a certain amount of time?
This is normally handled in the dataflow of your patch, rather than by
the [hid] the object itself. See the attached patch for one method of
debouncing an input.

If this isn't what you need, have a look at the part with the "greater
than or equal to" object [>=]. This gives a "0" or a "1" as output which
can be used to open and close a [spigot].

For example, [>= 100] and [<= 200] would both give "1" if the number
from your counter was between 100 and 200.
Then, [==] could compare the outputs of both and if they are the same,
it would give a "1", and otherwise a "0".

It really pays to learn a bit more about the dataflow within PD, rather
than expecting high level objects to do all the work for you! ;-)

best,
d.


Carlos Caires wrote:
> No, not at all...I have no problems with the amount of information.
> The problem is that, for a certain purpose, a need the "element 10" open 
> for a period of time and "close" for another period. That is to say, I 
> want to create limits to some key events. Let say that I have a [metro 
> 1000] plus a [counter 360], between 100 and 200 the element 10 is 
> opened, otherwise it is closed. Do you see any way to make this work 
> within the HID object?
> C.C.

-- 
derek holzer ::: http://www.umatic.nl ::: http://blog.myspace.com/macumbista
---Oblique Strategy # 34:
"Consider different fading systems"

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: debounce.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070817/f6e2b883/attachment.asc>


More information about the Pd-list mailing list