lilypond-user
[Top][All Lists]
Advanced

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

Algorithm to calculate tuplets?


From: Myron Marston
Subject: Algorithm to calculate tuplets?
Date: Tue, 3 Jun 2008 15:09:21 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

I'm working on an application that generates music.  I'd like to use Lilypond to
generate my scores, but I'm having difficulty figuring out the best way to
produce the proper lilypond notation for the durations of the notes. 
Internally, all of my rhythmic durations are represented as fractions (i.e. 1/4
for a quarter note, 3/8 for a dotted quarter, 1/6 for one note of a quarter note
triplet, etc).  As long as my durations have a power of 2 in the denominator,
it's not difficult to figure out the correct lilypond notation.  But tuplets are
much more difficult, especially when you get into nested tuplets, tuplets that
mix durations (i.e. 8ths and 16ths in the same tuplet), etc.  

Does anyone know of an algorithm to convert from fractional representations of
durations to the lilypond format?

Thanks!
Myron





reply via email to

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