[PD-dev] getting Pd logical time in C

Hans-Christoph Steiner hans at eds.org
Sat Jun 3 00:21:32 CEST 2006


Actually, I think logical time would work perfectly for what I am  
trying to do.  I want to have the first instance that is executed in  
any given cycle run a function, but none of the rest.  As far as I  
understand, the instance that is created first is not necessarily the  
first one to execute in each cycle.

So if I run the function, then set a global variable to the logical  
time, then next instance would check the logical time against that  
global variable.  If it was equal, it would skip that function.  That  
should guarantee that the first instance to execute in a given cycle  
will execute that function, rather than just using instance 0.

Any comments or suggestions appreciated, as usual.  So... how do I  
get the logical time?  Time to dig...

.hc

On May 19, 2006, at 5:02 PM, Miller Puckette wrote:

> Logical time wouldn't work for that, as two objects in the same  
> patch are
> created at teh same logical time.  I'd suggest code like:
>
> {
>   static int initted = 0;
>   if  (!initted)
>   {
>     .. this code only runs once ..
>     initted = 1;
>   }
> }
>
> cheers
> M
>
> On Fri, May 19, 2006 at 11:37:45AM +0200, Hans-Christoph Steiner  
> wrote:
>>
>> I want to get the logical time so I can make the first instance of
>> the object execute something while the rest do not execute.
>>
>> Any suggestions as how to do this?
>>
>> .hc
>>
>> _____________________________________________________________________ 
>> ___
>> ____
>>
>> If you are not part of the solution, you are part of the problem.
>>                                                               -
>> Eldridge Cleaver
>>
>>
>> _______________________________________________
>> PD-dev mailing list
>> PD-dev at iem.at
>> http://lists.puredata.info/listinfo/pd-dev


________________________________________________________________________ 
____

If you are not part of the solution, you are part of the problem.
                                                               -  
Eldridge Cleaver





More information about the Pd-dev mailing list