lilypond-user
[Top][All Lists]
Advanced

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

compiling irrational time signatures with \scaleDurations


From: Adrian Kleinlosen
Subject: compiling irrational time signatures with \scaleDurations
Date: Wed, 18 Oct 2023 14:09:39 +0200

Hello to all,


for quite some time now I've been trying to solve a problem concerning the output of LilyPond code - unfortunately in vain. Maybe someone can help me here?


About the "back story": I have written two algorithms in Python. First one, with which I generate time signatures and metronome markings. I use "normal" as well as irrational time signatures (like 7/23 or 5/12) and metronome markings with up to three decimal places. The second algorithm then converts the lists of time signatures and metronome markings into LilyPond code. 


The values of the individual functions of the code (attched) are calculated as follows:


\scaleDurations = (notated note value * 60000) / (note value * (metronome marking * 1000)). Notated note value is the note value that is notated for irrational note values (for example, 12th notes are commonly notated as 8th notes, etc.); note value is the actual note value (e.g., 12th notes); and the metronome marking has up to three decimal places. For a 7/23 measure with a metronome marking of eight note = 62.375, if 23rd notes are notated as 16th notes, this gives (16*60000) / (23*(62.375*1000)).


\time = \scaleDurations * time signature 


Now the output of the code works fine - but always only up to a certain point. After a certain measure the output simply stops. I'm not sure now if the problem is with my code or with Frescobaldi after all. (I am using LilyPond version 2.24.2 in Frescobaldi 3.3.0 on a macOS Ventura 13.4.1).


Attached now is the code for a total of 24 such bars (once as a LilyPond file and once as a text file). (I know, minimal examples are better in principle, but in this case it would not make sense, because the output stops after a couple of bars). Frescobaldi outputs the code correctly up to the first note of the 4th bar, nothing more. An error message is not generated. 


How is it with you? Does the output work correctly or does it also break off somewhere? I have already asked the same question in the German LilyPond forum. A LilyPond user pointed out to me that the code seems to work only in version 2.20.0, but not in any other version. 


Thanks a lot for any help!


Kind regards,

Adrian Kleinlosen

Attachment: scaleDurations.txt
Description: Text document

Attachment: scaleDurations.ly
Description: Binary data


reply via email to

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