Re: My progress on converting MIDI files to a music score with MIDI::Perl

[email protected] ("Sean M. Burke") Sat, 26 Jul 2003 06:00:36 -0800
Newsgroups perl.midi
Message-ID <[email protected]>
At 08:36 AM 2003-07-25 +1000, Charles Cave wrote:
>How does the duration of the note (in ticks) relate to the Ticks paramater 
>192 at the header?

My memory is hazy on this point, but here goes:  I think that there's two 
layers of indirection involved in having to figure out how ticks (the units 
of delta-times) map to real time:

* the opus's Ticks parameter (also known as "Tempo parameter", and both 
names are sort of confusing), which gives tells you how to map ticks to 
quarter notes;

* and the current tempo, which tells you how to map quarter notes to 
microseconds (initially 500,000 microseconds/qn, which is better known as 
120 beats-per-minute).

Now, usually Ticks is 96, because this number (3 * 2**5) gives you enough 
resolution that you can evenly represent all normally notated divisions of 
a note, even arcane things like triplet 64th note, which would be 4 ticks long.
However, some applications want even more resolution (presumably for the 
sake of better representing captured data), so they use 2*96, 192.  So a 
tick in a 192-Tick file would last only half as long as a tick in a 96-Tick 
file, if everything else is the same.

I'd give you some example values of ticks, Ticks, and tempo, but I don't 
have any on hand, and I don't trust myself to just make them up.

--
Sean M. Burke    http://search.cpan.org/~sburke/