I think your problem can be solved with a technique along the following trick : 60::second / bpm => dur tick; tick - (now % tick) => now; if you add this at the start of your script, it will wait just long enough to start on the next beat. that way, you can have several shreds in perfect timing, even though they are triggered from an external event. hope this helps ! tom On Thu, May 03, 2012 at 07:54:01AM -0700, [chriswicks] wrote:
Hello all! I'm quite new to ChucK, and I have a question concerning rhythmic timing. I've got a program that I'm working on that accepts OSC events being sent from a C++ application. Now, the program chugs along, it's quite rhytmic, and I'd like to trigger melodic shreds based on values sent through OSC. No problem doing that. My problem comes from the fact that the C++ app isn't in sync with the ChucK VM, so the times at which it chooses to send data are pretty much never in sync with everything else that's going on, so the melodic shred is triggered but is not lined up rhythmically with everything else that's going on.
Is there any way to hack it so that it waits to add the shred until it's lined up with everything else (quantized, so to speak). I'm not sure if I'm properly expressing the problem, so let me know if there's some way I can further clarify.
Thanks very much!
-crwicks
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users