[gmpi] Re: Topic 6: Time representation


-----Original Message-----
From: Paul Davis [mailto:paul@xxxxxxxxxxxxxxxxxxxxx]
>    * musical time (ticks, 64 bit integer)
>       (obviously requires nanoseconds-per-tick to be available to
>        make it usable, plus tempo map info to make it useful)


Musical time is not measured in ticks. If you learn violin in a conservatory, 
piano from your neighborhood piano teacher, or rock guitar from a local 
headbanger, you will never learn, hear, or use the concept of a "tick". This 
notion is an implementation detail of Midi and it appears nowhere else. It is 
probably not even familiar to many casual users of Midi.

Musical time, at least in Western music, is measured in beats or in measures. 
These can be subdivided any arbitrary amount without any requirement that there 
be a greatest common divisor called a tick. Because of the possibility for 
arbitrary subdivision, musical time has to be represented as either a rational 
or a real number, or a good approximation thereunto.

Integers could be used to represent fixed point numbers approximating the true 
rational values, but this awkward since C and C++ have no built in support for 
fixed point and since it requires an arbitrary normalization (i.e. the size of 
the tick or the position of the decimal point) that corresponds to nothing 
found in music.

My experience writing algorithmic composition programs is that it is a total 
PITA to choose a PPQN value for a midi file that allows accurate 
representations of the rhythmic values one wants, especially if, God forbid, 
you are using polyrhythms or want to add small displacements for feel or swing. 
The requirement to quantize to an integer PPQN value was an arbitrary and 
annoying constraint that made code more complex and gave nothing in return. 
There is no need to carry this kind of annoyance forward into a new standard.

The straightforward thing to do is to represent musical time, which is a real 
number, with one of the builtin data types that C/C++ provides for real 
numbers, i.e. float or double. Doubles should probably be used to guarantee 
enough precision. The unit should be a traditional one, either beats or 
measures, rather than an artifical technical construct like the tick. I would 
vote for beats.

-Frederick Umminger








----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: