> Ah, yes, the good ole C64 days! Are the lights kept in sync? By a timer in
> your MacPerl code, or are they triggered by sound input levels, or by Midi,
> or what?

You may not believe the masochism involved here, but they're kept in sync 
by a pre-built file containing (a) indicators of when to change pattern 
("This is a 32-beat pattern, while this is a 24-beat pattern"), and (b) 
the precise time of every beat.  Yes, that's right.  Several hours' worth 
of tapping the return key were involved.

Actually, the results are really cool -- apart from the slight remaining
sync problem, which is caused mainly by the transitions between songs.  
And just maybe I'll get that whipped...

> I hope you didn't include "sleep(1)" in your code.

Definitely not!

> Are you trapping for other events besides "keyDown"?

No, I removed all mention of other events from your example.  The only 
other I/O consists of what's heading out the serial port via Mac::Serial.  
(The "tap file" has been read and processed into arrays full of raw DMX 
data before the show starts.)

> How often are you calling "WaitNextEvent"?

That raises a good point.  I was calling it more or less continuously,
i.e. within the (very small) main loop.  But if my woes are caused by it
sucking up too many resources, it would be trivial to call it only at the
beginning of each new beat pattern.  Judging from the behavior of your 
sample script: if I press and release a key, the keyDown will be queued up 
and caught by the next call to WaitNextEvent, even if it occurs a few 
seconds later.  Correct?

> If you show a little code it might help?

Perhaps I'll try a bit later, if I don't make sufficient progress.  (That 
Mac isn't net-savvy at the moment, so I can't just copy and paste.)

Ethan

Reply via email to