Rob;

*Whew* -- thanks -- I was worried that I was suffering a dissociative fugue (not to be confused with a counter-fugue).

Just because ChucK has bugs doesn't mean you're not insane, these two factors might be independent :¬p.
 

A hint to the hunting party: the "wrong" time returned by now always seems to be an integer.  It's as if the fractional part is getting lopped off - either by truncation or rounding, I'm not sure which.

There is definitely some rounding error going on. Here is a edit of the code that lops off some zeros. This version never prints "bang" in 1.2.1.2.

=================
Event _e;
time _t;
time foo;

spork ~ beatProcess();

while (true) {
   now + 1.01::second => _t;
   _e => now;
   if (foo > now) <<<"bang">>>;
   now => foo;
  
   <<< "returned from _e => now at", now >>>;
}

fun void beatProcess() {
   while (true) {
       _t => now;
       if (foo > now) <<<"bang">>>;
       now => foo;
       <<< "broadcasting at", now >>>;
       _e.broadcast();
       //me.yield();
       samp => now;
   }
}
==========================

 

Fetch me my halberd!

I think it's hiding in rounding in the Shreduler, let's set fire to the shreduler and see if it comes out!

In all seriousness; this sounds tricky, I reported a hard to pinpoint execution order error to Ge before and said I suspected something had changed in the shreduler since last version. Ge replied he couldn't remember changing anything to it. The odd thing is that the bug I saw would come and go with using different samples (as in .wav files) but clearly samples only come in integer durations if we express them in samp's.

Grumble. Oh, well, at least we've got it cornered.

Kas.