<br><br><div class="gmail_quote">On Tue, Jun 5, 2012 at 3:44 PM, David Robillard <span dir="ltr"><<a href="mailto:d@drobilla.net" target="_blank">d@drobilla.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Tue, 2012-06-05 at 06:34 -0400, Jeremy Salwen wrote:<br>
> Hi All,<br>
><br>
> From what I can tell, it looks like the LV2 Atom Sequence<br>
> specification allows you to send events with arbitrary units for the<br>
> timestamp.<br>
><br>
> I have a few questions about this:<br>
><br>
> 1. How are we to know whether a particular unit uses the double field<br>
> in the timestamp union, or the uint64_t field in the timestamp union.<br>
<br>
</div>Context.  When used as event ports in the run() callback, it is always<br>
frames, like everything else.<br>
<br>
I deliberately avoided complicating it with a bunch of stuff to handle<br>
beat-based time stamps in this context since this would almost certainly<br>
be unused (learned that lesson with the event extension).  It can be<br>
added later if need be.<br>
<div class="im"><br>
> 2. The specification says "The unit field is either a URID that<br>
> described an appropriate time stamp type, or may be 0 where a default<br>
> stamp type is known."  In what circumstances would the timestamp be<br>
> known?  When can I expect to see a zero in that field?<br>
<br>
</div>See above.<br>
<div class="im"><br>
> 3. Are the timestamps absolute times?  Or relative to the previous<br>
> event?  Or relative to the start of the audio chunk? Does it depend on<br>
> the units used?<br>
<br>
</div>Absolute from the start of the Sequence.<br>
<div class="im"><br>
> 4. Why does the documentation show |FRAMES |SUBFRMS| as the timestamp<br>
> field? From what I can tell, there is no unit which includes frames<br>
> and subframes subdivided that way, and the sampler example just uses<br>
> the full 64 bits as a frames field.  Is this just a relic from the old<br>
> event port documentation? (the diagram seems familiar).<br>
<br>
</div>Oops, relic.  I will fix this.<br>
<div class="im"><br>
> 5. How are hosts/plugins supposed to deal with the multiplicity of<br>
> units?  For example, suppose I'm a plugin or host that wants to<br>
> receive MIDI data. How am I supposed to know what timestamp unit to<br>
> expect?  Is there a facility for converting between different units<br>
> automatically?  The only extra information required to convert between<br>
> any two time units would be the bpm and sample rate.  It would be<br>
> rather annoying to have to implement a bunch of unit conversion code<br>
> in every host/plugin you write in order to make sure it can handle any<br>
> unit which is tossed at it.<br>
<br>
</div>Indeed it would be.  Hence why none of this is there, so the extension<br>
does not imply you are expected to have to deal with any of that.  I<br>
suppose the fact that it is audio frames in this context needs to be<br>
more clear.<br>
<br>
In short, when used as port buffers, it's always frames, don't worry<br>
about it.  The potential for other time stamp types is there for other<br>
cases, since it's possible to use Sequences in other non-port-buffer<br>
ways (e.g. you could send around events with entire sequences as their<br>
payloads)<br>
<br>
Cheers,<br>
<br>
-dr<br>
<br>
P.S. lv2-dev is a better place for this sort of thing<br>
<br>
</blockquote></div>Thanks David,<br><br>If the timestamps are absolute, are they reset on every call to activate()?<br><br>I thought lv2-dev was for developing the lv2 spec and extensions, but my questions were more about implementation of plugins/hosts.<br>

<br>Jeremy<br>