[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Event Timing Offset
On Dec 30, 2005, at 11:26 PM, Esben Stien wrote:
What I'm
really after is some way to set an offset in realtime from the
original designated time.
In my drum sequencer, I use server messaging latency to allow time
offsets for notes. Basically, each process has a latency value that
ensures correct timing. By default I have it set to 0.5 beats (this
requires me to divide the latency value by the clock's tempo when I
send the message, but that's another story). I schedule the task to
start 0.5 beats early (if it's to start on the next four-beat boundary,
it will actually be scheduled for clock.elapsedBeats.roundUp(4) - 0.5),
then each message goes to the server with a time stamp to play 0.5
beats later so that the sound happens exactly in sync with the clock.
If I add or subtract a small value from the latency on a note-by-note
basis, then I can make individual notes happen slightly earlier or
later. It works perfectly while avoiding the more involved arithmetic
to adjust the actual time between events.
The only limitation is that you can't subtract more than the base
latency, but for what you're talking about, -0.03 or +0.04, not a
problem.
If this sounds interesting, I can help you with implementation details.
Just let me know.
Latency may sound a little scary, but it's really your friend. I note
that you're concerned about timing on the hundredth of a beat level,
but you're still using Synth(...) which is guaranteed to introduce
timing inaccuracies. Messaging latency solves that problem. See the
server timing help file.
hjh
: H. James Harkins
: jamshark70@xxxxxxxxxxxxxxxxx
: http://www.dewdrop-world.net
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman