[PD] if not currently recieving a 1 then send 0

Frank Barknecht fbar at footils.org
Thu Dec 9 15:31:59 CET 2010


On Tue, Dec 07, 2010 at 09:07:46PM -0600, Ben Carney wrote:
> I don't think I am very good at asking pure data related questions.
> 
> the 1000 milliseconds is an arbitrary number.
> 
> I am just trying to deduce that  a 1 is not being sent or received. for any
> amount of time.
> 
> so the example I gave was everything that wasn't a 1 in that second would be
> spat out as a zero.

A very useful idiom in Pd is what I'd call an "activity monitor". This is
something which will report whenever an activity stops to happen for a certain
time.

The attached patch has such a monitor. The basic idea is very simple: Just
exploit the fact, that a [delay] object will reset itself whenever it receives
a new bang-message, which means, that it will not produce a bang, until banging
stops for as long as the delay period is.

With some [change] logic you can turn that into a 0/1 activity monitor.

Ciao
-- 
 Frank Barknecht            Do You RjDj.me?          _ ______footils.org__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: monitor-activity.pd
Type: application/puredata
Size: 1573 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20101209/37f2b5d9/attachment.bin>


More information about the Pd-list mailing list