[MEI-L] dur.ges / midi.div question

Roland, Perry (pdr4h) pdr4h at eservices.virginia.edu
Sat Aug 8 23:12:22 CEST 2009


Hi Craig,

> I could be posting these sorts of questions to mei-l
> if you want, or you could post the response there if
> it is of general interest. (or CC to anyone involved in
> creating documentation to add the Q/A to it).

Yes, please post your questions to mei-l.  I'll probably be the one to answer them, but then at least there's a record of them that's not on my computer only.  And everyone else will get to see and comment on the answers too.

> What are the units of dur.ges?  Do they reference
> to the scoredef/@midi.div which is the number of
> subdivisions per quarter note?

If midi.div is present, the presumption is that dur.ges is specified in clicks per quarter.

> At least in the Bach examples, they seem to be
> related to scoredef/@midi.div. However, in the
> mei19b-full.dtd file, you say:

> <<The dur.ges attribute (performed duration) may be
> expressed in several forms, such as measures[s]+
> beat[s].beatpart, ppq (MIDI clicks), Humdrum *recip
> values, or MusicXML 'divisions', etc.>>

Just to answer the question you're going to ask next, I should have said "The dur.ges attribute (performed duration) may be expressed in *one* of several forms, ..."  because dur.ges may only contain a single value.

> [*recip should be **recip]

Ok.

> How would someone know which unit is being used
> for dur.ges when reading an MEI file?  And can the
> units for dur.ges change during a file?

The units of dur.ges are midi clicks per quarter if midi.div is present.  If it's not present, then the units are something else, but there's not yet a way to specify any other units.  Basically, if you don't use midi clicks, you're on your own right now.  But that would be easy to remedy by adding a dur.ges.units attribute on scoredef, I think.  Again, allowing only one value at a time.

The units may change by including another scoredef or staffdef element later in the document.

> With regards to midi.div, does it have an upper limit?

The only expectation is that the value of midi.div will be a positive integer.  There's no upper limit.  A value of 10689384893193489034890 would be silly, but perfectly acceptable right now.  Its upper bound can be limited (to 32767?) if that's your recommendation.

> In other words, the MIDI ticks per quarter note is
> stored in a 16-bit number.  These 16-bits actually encode
> two types of data:
> * When the top bit is zero, the value is ticks per quarter note.
> (so ticks per quarter note can go up to 32767 or so, and
> there are occasionally pieces of music which will exceed
> that value as the smallest integer time unit).
> * When the top bit is zero, then this TPQ field in a
> MIDI file stores a SMPTE time code which is in reference to
> absolute time rather than relative time.  When that happens,
> the highest 8-bits of the divisions field specifies the
> (negative) SMPTE frame count per second, and the
> lower 8-bits of the divisions field specifies the divisions
> per frame.

I had only planned on allowing ticks per quarter values in dur.ges, not a SMPTE time code.  Would midi.frames and midi.frames.div be useful additions?  

> When you say that
>  "The dur.ges attribute (performed duration)"
> You probably don't mean that it is related to the
> literal performer's duration for the note, but rather the
> duration implied by the rhythms of the score, right?
> In other words, if a quarter note has dur.ges-="4", then
> a stacatto on the note would not change that value, even
> though what musicians consider the "performed duration"
> of the note would be shorter.

I actually meant, as you say, the literal performer's duration for the note.  So a staccato dot would shorten the dur.ges value to '4' if the ticks per quarter were at '8'.  There's no reason to store the "duration implied by the rhythm of the score" because that can be computed from @dur.  The purpose of @dur.ges is to record the duration when *it doesn't match* @dur.

--
p.

__________________________
Perry Roland
Digital Curation Services
University of Virginia Library
P. O. Box 400155
Charlottesville, VA 22904- 4155
434-982-2702 (w)
pdr4h at virginia.edu


More information about the mei-l mailing list