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 * 6) / (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*6) / (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
\version "2.24.2"
musicone = {
%%% MEASURE : 1 %%%
\scaleDurations 49/50 {
\time 98/400
\set Staff.timeSignatureFraction = #'(2 . 8)
\set baseMoment = #(ly:make-moment 49/50)
\textMark \markup {\left-column {\line { \smaller \general-align #Y #DOWN \note
{8} #1 " = 61.213 " } } }
% The music will later be put here. For now, use the \repeat unfold expression
\repeat unfold 2 { c'8*8/8 }
|
}
\once \set Staff.whichBar = "|"
%%% MEASURE : 2 %%%
\scaleDurations 2/3 {
\time 18/141
\set Staff.timeSignatureFraction = #'(9 . 47)
\set baseMoment = #(ly:make-moment 2/3)
% The music will later be put here. For now, use the \repeat unfold expression
\repeat unfold 9 { c'32*32/47 }
|
}
\once \set Staff.whichBar = "|"
%%% MEASURE : 3 %%%
\scaleDurations 35/38 {
\time 70/304
\set Staff.timeSignatureFraction = #'(2 . 8)
\set baseMoment = #(ly:make-moment 35/38)
\textMark \markup {\left-column {\line { \smaller \general-align #Y #DOWN \note
{8} #1 " = 65.073 " } } }
% The music will later be put here. For now, use the \repeat unfold expression
\repeat unfold 2 { c'8*8/8 }
|
}
\once \set Staff.whichBar = "|"
%%% MEASURE : 4 %%%
\scaleDurations 37/33 {
\time 296/1683
\set Staff.timeSignatureFraction = #'(8 . 51)
\set baseMoment = #(ly:make-moment 37/33)
\textMark \markup {\left-column {\line { \smaller \general-align #Y #DOWN \note
{8} #1 " = 67.176 " } } }
% The music will later be put here. For now, use the \repeat unfold expression
\repeat unfold 8 { c'64*64/51 }
|
}
\once \set Staff.whichBar = "|"
%%% MEASURE : 5 %%%
\scaleDurations 25/42 {
\time 100/504
\set Staff.timeSignatureFraction = #'(4 . 12)
\set baseMoment = #(ly:make-moment 25/42)
% The music will later be put here. For now, use the \repeat unfold expression
\repeat unfold 4 { c'8*8/12 }
|
}
\once \set Staff.whichBar = "|"
%%% MEASURE : 6 %%%
\scaleDurations 15/13 {
\time 30/104
\set Staff.timeSignatureFraction = #'(2 . 8)
\set baseMoment = #(ly:make-moment 15/13)
\textMark \markup {\left-column {\line { \smaller \general-align #Y #DOWN \note
{8} #1 " = 52.0 " } } }
% The music will later be put here. For now, use the \repeat unfold expression
\repeat unfold 2 { c'8*8/8 }
|
}
\once \set Staff.whichBar = "|"
%%% MEASURE : 7 %%%
\scaleDurations 15/13 {
\time 30/104
\set Staff.timeSignatureFraction = #'(2 . 8)
\set baseMoment = #(ly:make-moment 15/13)
% The music will later be put here. For now, use the \repeat unfold expression
\repeat unfold 2 { c'8*8/8 }
|
}
\once \set Staff.wh