denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] (d-GetDurationInTicks) bug


From: Richard Shann
Subject: Re: [Denemo-devel] (d-GetDurationInTicks) bug
Date: Wed, 27 Oct 2010 08:57:07 +0100

Denemo has 384 hard-wired in and stores ticks only as an integer.
d-GetDurationInTicks is just returning a value that Denemo has stored.
The value 384 was chosen (I think orginally by MIDI people) to allow a
practical range of dots and tuplets, I don't think there is any prospect
of changing it.
Hmm, maybe I am sliding over something here ... d-GetDurationInTicks is
the duration after taking into account tupleting and dotting. I think we
could also have d-GetBaseDurationInTicks which would be the duration
before taking these into account. What use that might be I am uncertain,
but the bottom line is: if you try to generate a note with a duration
which has a component less than 1/384 of a quarter note that bit of the
duration will compute as zero.

Richard

On Wed, 2010-10-27 at 01:05 +0200, Nils Gey wrote:
> Hello list,
> 
> (d-GetDurationInTicks) has a bug. Backstory: I wrote a function that can 
> calculate the Ticks if given a base duration (in ticks) and the number of 
> dots (0 is valid, too). More important: I wrote a function that knows only 
> from the ticks alone which note it is and how many dots it has. (to be honest 
> I did not test it with tuplets yet, maybe this will break things).
> 
> But more important: d-GetDurationInTicks only returns integers but should 
> return fractions, too.
> It happens if you add too many dots (each dot adds baseticks/2^dots to the 
> tick-count) the added value gets too small so you get float numbers.
> 
> Longer durations do not suffer from this (except dotted tuplets may) until 
> they get around 8 or 9 dots, which I  have never seen. But the lower 
> durations cannot stand even one dot and the GetDurationInTicks goes off. 
> Well, to be honest again its not a real problem since even for 1/128 notes 
> you need three dots to make it break.
> 
> But still its a theoretical bug. We offer unlimited dots, even for 1/128 and 
> 1/256 (which needs only 2 dots to break :)) so it should work. And I have the 
> feeling it will get less theoretical once I look into tuplet values.
> 
> Can you make GetDurationInTicks let return floats (Scheme displays them as 
> 21/2 and not as float, don't know how the internals work).
> 
> Nils
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]