On Tuesday 10 December 2002 15.54, Steve Harris wrote:
On Tue, Dec 10, 2002 at 09:14:36 -0500, Paul Davis
wrote:
So time
starts at some point decided by the host. Does the host
pass the current timestamp to process(), so plugins know what
time it is? I assume that if the host loops, or the user jumps
back in song-position, time does not jump with it, it just
keeps on ticking?
I guess my only question is how do plugins know what time it is
now?
in VST and JACK, its done with a function call that retrieves a
struct containing current time info, including both transport,
sample and musical positions, amongst other things.
We want this as well (to allow MTC and MIDI Clock sync if nothing
else), but the timestamp stuff needs to be monotonic, samples
synced, and I guess it makes sense to pass it in with process().
Yes. Event/audio time is one thing, and musical time is something
completely different, although related.
Musical time can be a bit hairy to calculate, so I don't think it's a
good idea to do it all the time, and pass it to all plugins. That
could be acceptable if you did it by publishing a struct in the host
struct - but who is interested in the musical time of the first
sample frame in the buffer? There's nothing special about that sample
frame.
What you want is a callback that gives you the musical time
corresponding to a timestamp, and probably a few other variants as
well. (Timestamp is only good for "short range", since the host
cannot know how many wraps back or ahead you mean, and so has to
assume that you want the one in [now-2G, now+2G].)
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`--------------------------->
http://olofson.net/audiality -'
.- M A I A -------------------------------------------------.
| The Multimedia Application Integration Architecture |
`---------------------------->
http://www.linuxdj.com/maia -'
---
http://olofson.net ---
http://www.reologica.se ---