On Sunday 15 December 2002 03.25, David Gerard Matthews wrote:
[...]
I would like to
clarify something here: musical time as used in an
API is not by definition "periodic". (That's just an
interpretation of it, normally based of the time signature.)
The APIs that don't use audio frames for timestamps and song
position generally use "ticks". 1.0 per quarter note is a fine
unit, for example, if we (like practically everyone else) decide
to use the quarter note as the base. It's rather handy, because a
quarter note is always a quarter note, but a bar might be
anything...
Well, not necessarily! A quarter note is not always the unit of a
single beat.
Well, I never said it was the unit of a *beat*. ;-)
In traditional
music theory, 6/8 meter is frequently thought of in 2 - the
dotted-quarter note gets the beat.
Well, yes - I've actually used that sometimes.
Half-note based meters (2/2, 3/2) are also very
common, and things
like 5/16 are not
uncommon in modern music. That said, I think what you mean by
quarter-note is
what I would call "counting unit" or "durational unit" or something
like that.
Yes. And either way, even if you never *use* a quarter note, or the
corresponding distance, in your music, quarters, dotted quarters,
16ths or whatever still have a fixed relation. Just tell the plugin
to do 16ths, and it'll get the idea.
while you can
just modulate some audio with
(sin(musical_time * M_PI * 2.0) + 1.0) or whatever. ;-)
Nice. Sounds like fun.
Or maybe not...
out = in * (1.0 - fmod(musical_time * 4.0, 1.0));
would be more fun, although you'd need some filtering on the
modulator to kill that awfull clicking. Or just use it to index an
interpolated "envelope waveform" of some 16 points or so. (*Now* it
starts to get interesting. :-)
//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 -'
---
http://olofson.net ---
http://www.reologica.se ---