[LAD] 64 bit tempo-based time stamp

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-audio-dev@...>
Date: Tuesday, February 7, 2012 - 12:29 am

Hi all, seeking opinions:

I have to choose a way to represent beat-based tempo time in 64 bits.
Uses are many, but the main one is event time stamps for plugins.

Requirements:
* No odd data sizes (for performance / programmer ease)
* High precision (ideally close to sample accurate for most tempos)
* Fits in the same space as two uint32_t's

Questions:
* Is "bar" needed?
* Use floating point? Rounding errors an issue?

Options:

/* A (moderate range, ultra precise) */
struct {
uint16_t bar;
uint16_t beat;
uint32_t tick;
};

/* B (high range, moderate precision) */
struct {
uint32_t bar;
uint16_t beat;
uint16_t tick;
};

/* C (high range, good precision?) */
struct {
uint32_t bar
float beat;
};

/* D (high range/precision, but no bar) */
double beat;

I havn't run the math on precision yet, but I am leaning towards C. I
actually hadn't considered mixing int and float before writing this
email, but it seems the best trade-off, and working with float is
certainly more pleasant than fixed point.

Thoughts?

-dr

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] 64 bit tempo-based time stamp, David Robillard, (Tue Feb 7, 12:29 am)
Re: [LAD] 64 bit tempo-based time stamp, Pedro Lopez-Cabanillas, (Tue Feb 7, 6:29 pm)
Re: [LAD] 64 bit tempo-based time stamp, David Robillard, (Tue Feb 7, 6:37 pm)
Re: [LAD] 64 bit tempo-based time stamp, Harry van Haaren, (Tue Feb 7, 12:40 am)
Re: [LAD] 64 bit tempo-based time stamp, David Robillard, (Tue Feb 7, 1:48 am)