[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] What is the duration of a measure
From: |
Richard Shann |
Subject: |
Re: [Denemo-devel] What is the duration of a measure |
Date: |
Wed, 23 Sep 2009 10:18:21 +0100 |
On Tue, 2009-09-22 at 19:11 +0100, Richard Shann wrote:
>
> Thanks for this - it sounds like you have all the pieces to hand -
> I'll
> try to get to it, unless you tell me you are connecting them all up
> for
> me!
Mulling this over, given your formula
gint barlength = ppqn * 4 * numerator / denominator;
it should be possible to generate a rest of this duration rather simply,
starting at a small value and doubling until the barlength is achieved.
If the barlength is exceeded and then you would back up and add a
half-value (for one dot).
If an exact match is achieved at that point then the job is done,
otherwise you are into the less-interesting (to me) cases of 5/4 etc; I
think these could be then done as a collection of other sized rests (by
recursion actually).
I'll try to find time for this later today.
Richard