[PD-dev] Calling a method periodically

2008-03-17 Thread Greg Surges
Hi all, Is there any way to have an external call a method periodically, without being triggered? I'm thinking of a histogram with a decay function, where the values are decremented every second (or other time value). Thanks! -Greg -- http://www.uwm.edu/~gssurges/ _

Re: [PD-dev] Calling a method periodically

2008-03-17 Thread Claude Heiland-Allen
Greg Surges wrote: > Hi all, > > Is there any way to have an external call a method periodically, without > being triggered? Clocks. Check the C API in "m_pd.h".. > I'm thinking of a histogram with a decay function, where the values are > decremented every second (or other time value). I've

Re: [PD-dev] Calling a method periodically

2008-03-17 Thread Georg Holzmann
Hallo! Greg Surges schrieb: > Hi all, > > Is there any way to have an external call a method periodically, without > being triggered? > I'm thinking of a histogram with a decay function, where the values are > decremented every second (or other time value). Clocks can be used to do that. Look

Re: [PD-dev] Calling a method periodically

2008-03-17 Thread Greg Surges
Thanks Claude and Georg, It looks like this is the right track... Looking at the metro code, I'm a little confused as to how the object continues to output bangs after the first. What does it mean that clock_delay "calls back"? Thanks On Mon, Mar 17, 2008 at 3:13 PM, Claude Heiland-Allen < [EM

Re: [PD-dev] Calling a method periodically

2008-03-17 Thread Frank Barknecht
Hallo, Greg Surges hat gesagt: // Greg Surges wrote: > It looks like this is the right track... > > Looking at the metro code, I'm a little confused as to how the object > continues to output bangs after the first. What does it mean that > clock_delay "calls back"? When you create a new clock wi

Re: [PD-dev] Calling a method periodically

2008-03-17 Thread Hans-Christoph Steiner
First, you register a function with clock_set(). Usually that function is called myobjectname_tick(). Then when it runs, you call clock_delay() to schedule when myobjectname_tick() will get called again. .hc On Mar 17, 2008, at 4:49 PM, Greg Surges wrote: Thanks Claude and Georg, It

Re: [PD-dev] Calling a method periodically

2008-03-21 Thread Greg Surges
Thanks all, I'm still stuck. Is there a way to interleave calls to clock_delay()? I'll explain what I mean: I'm coding (trying to, anyway) a histogram object. I'm using integers from input to increment the values stored in an array. For example, if 76 is received as input, the value in the array

Re: [PD-dev] Calling a method periodically

2008-03-22 Thread Hans-Christoph Steiner
If you post the code, it would be much easier to tell what's happening. My guess is that you can only have one delay set for a given clock, so like this: - 76 sets the timer - 32 resets the timer with new info Therefore the timer callback set by 76 never gets called. (Something like th

Re: [PD-dev] Calling a method periodically

2008-03-22 Thread Greg Surges
Thanks, I've posted the code at http://www.uwm.edu/~gssurges/histogram.c Hope it makes sense... -Greg On Sat, Mar 22, 2008 at 11:06 AM, Hans-Christoph Steiner <[EMAIL PROTECTED]> wrote: > > If you post the code, it would be much easier to tell what's