[CM] Timing drift

Heinrich Taube taube at uiuc.edu
Wed Apr 8 12:07:03 PDT 2009


odd i just tried my version of the c code and using a normal wait in  
the process and i dont hear any drift at all at least for a few minutes.

On Apr 8, 2009, at 11:42 AM, Neil Baylis wrote:

>
>
> On Wed, Apr 8, 2009 at 9:02 AM, Heinrich Taube <taube at uiuc.edu> wrote:
> this might do it, at least it sounds better in chicken. the problem  
> is that it may screw up other things
>
>
>
>           else
>            {
>               double after=Time::getMillisecondCounterHiRes();
>               delta*=1000.0; // convert user's wait value to  
> milliseconds
>               delta-=(after-curtime); // subtract out scheme's  
> overhead
>               //time=(delta>0.0) ? (after+delta) : after;
>               time=(delta>0.0) ? (curtime+delta) : curtime;
>             }
>
>
> Rick,
>
> I applied this patch (with Chicken 3.4.0) and it seems to work. I  
> listened for many minutes and couldn't detect the phase drifting  
> between the two processes.
>
> I'm using this process:
>
> (define (note-cycle endtime keys rate)
>  (process with pat = (make-cycle keys)
> 	   for t from rate by rate
> 	   while (< (elapsed) endtime)
> 	   do
> 	   (send "mp:midi" key: (next pat) dur: rate)
> 	   (wait (- t (elapsed)))))
>
> With your patch and the original process that doesn't attempt to  
> compensate for the overhead, I still saw phase drift, although it  
> may have taken longer to become apparent:
>
> (define (note-cycle endtime keys rate)
>  (process with pat = (make-cycle keys)
> 	   while (< (elapsed) endtime)
> 	   do
> 	   (send "mp:midi" key: (next pat) dur: rate)
> 	   (wait rate)))
>
> Thanks,
>
> Neil
>
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist



More information about the Cmdist mailing list