Hello,

I'm currently finishing up tuplet support and I'm wondering about the interaction of tuplets and the overall part <divisions> element.

Since tuplets essentially change the time base, you can end up with non-integer duration values for notes if you try to use one default value for the <divisions> element.

For example, if you use a value like 24 for your divisions, you're ok with triplet eighth notes, which are 3 notes in the space of 2, or 2/3 the length of normal eight notes, since 24 is divisible by 3. But if you have 5 eighths in the space of 2 or something, each note is 2/5 of normal length, so you'll end up with a non-integer duration value unless you change the divisions setting.

As far as I can see, there are three elements that must be specified properly for a tuplet: the duration, the time-modification element, and the tuplet notation element. Assuming the latter two are correct (they are independent of division issues), I can think of 4 approaches to figuring out the durations value and its corresponding divisions setting

1) Just use integer division and don't worry whether the durations values add up all the way to the full notes, since (I think) they're just for playback anyway and the nearest integer should be close enough if you use a reasonably high default divisions setting.

2) Output decimal numbers for durations. I think this defeats the whole purpose of having the divisions element, and is against spec, so it's probably out.

3) Output a new <attributes> element with a new <divisions> element before and after each tuplet. If you've only got one tuplet to worry about, it's easy to switch to a divisions value that will allow you to specify full durations as an integer. However, I don't know if changing the divisions value mid-measure is asking for trouble.

4) Make two passes through all the notes, keeping track of all the denominators for the notes (the 5s and 3s from above), then do a Least Common Multiple calculation to find the one divisions value that works for everything. This has the added benefit of finding the smallest divisions value that will work for a tune, whether tuplets exist or not. However it requires maintaining a list of all notes, since you don't really know each one's durations value until you know the final divisions setting.

Currently, I'm doing number 1. Number 3 would be the next easiest to implement, but I'm worried about changing the divisions attribute all over the place. Number 4 is obviously the

"right" answer, but I'm currently doing the translation in one pass and would prefer to avoid adding another if I could.

Is there another approach that I'm missing? Which of these approaches are workable?

Thanks, John