[linux-audio-dev] XAP: a polemic

Tim Hockin thockin at hockin.org
Tue Dec 17 21:14:00 UTC 2002


> Just one issue: Is float32 sufficient for tempo? (We'd need to switch 
> to 64 byte events, or use double events to handle 64 bits + 
> ramping...)
> 
> 
> Position could just be double, and no ramping, right? (No problem 
> fitting that in a 32 byte event.) Provided that adding a float to a 
> double should extend the float to double first, you'd actually have 
> to *make* this go wrong explicitly, to break anything.
> 
> 
> > the METER event needs to include
> >
> >      beats-per-measure (floating point value) [ 3, 5, 7, 9.5 etc ]
> >      beat-note-value (floating point value) [quarter,1/16th, etc]
> 
> Would two floats (32 bit) do?


Just to play devils advocate:

METER: uint32_t

meter & 0xffc00000 = beats-per-measure whole (0-1024)
meter & 0x003ff000 = beats-per-measure decimal (1/1000 increments)
meter & 0x00000fff = beat-note denominator  (0-4096)

Obviously any of those field widths can be adjusted.  I just wanted to point
out that we CAN transport that data in a single 32 bit field.  Especially
since the 'float' values we're talking about tend towards simple fractions.

Now is someone going to tell me they have PI beats per measure?

I need to go eat.  I'll read the remaining 30 emails when I get home :)



More information about the Linux-audio-dev mailing list