[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compilation time (was: Generate \scaleDurations procedurally)
From: |
Valentin Petzel |
Subject: |
Re: Compilation time (was: Generate \scaleDurations procedurally) |
Date: |
Tue, 13 Jun 2023 11:13:52 +0200 |
Hello Lib,
this slowdown appears to be induced by
forbidBreakBetweenBarLines = ##f
This might be understandable: Your code will division at 30/1, 30/2, ..., 30/88,
which might induce a relatively large number of potential break points.
This appears to be too much for the line breaking algorithm. Instead you could
add a sort of common break grid:
\version "2.25.5"
#(set-default-paper-size "a0")
#(set-global-staff-size 15)
mus = { \relative c''''' \repeat unfold 40 { c c c c }} % modify the \repeat
unfold value for testing, final version should be 40
#(define my-semitone->pitch
(make-semitone->pitch
(music-pitches #{ { c cis d ees e f fis g gis a bes b } #})))
bargrid =
#(define-music-function (d type mus) (pair? string? ly:music?)
(let* ((mus-len (ly:music-length mus))
(mus-len (/ (ly:moment-main-numerator mus-len)
(ly:moment-main-denominator mus-len)))
(d (/ (car d) (cdr d)))
(n (floor (/ mus-len d))))
#{
<<
#mus
{
$@(apply
append
(make-list n
(list
(make-music 'SkipEvent 'duration (ly:make-duration 0
0 d))
(make-music 'BarEvent 'bar-type type))))
}
>>
#}))
\new StaffGroup <<
#@(map (lambda (i)
#{
\new Staff {
\bargrid 1/1 ""
\scaleDurations #(cons 120 i) {
\transpose c' #(my-semitone->pitch (- (- 120 i))) {
#(cond
((<= 108 i 120) #{ \ottava 2 #})
((<= 97 i 107) #{ \ottava 1 #})
((<= 72 i 96) #{ \ottava 0 #})
((<= 48 i 71) #{ \clef bass #})
((<= 33 i 47) #{ \clef bass \ottava -1 #} )
(else #{ #}))
\mus
}
}
}
#})
(iota 88 120 -1))
>>
\layout {
indent = #0
\context {
\Score
\override SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/4)
proportionalNotationDuration = #(ly:make-moment 1/10)
\override SpacingSpanner.uniform-stretching = ##t
\override SpacingSpanner.strict-note-spacing = ##t
%forbidBreakBetweenBarLines = ##f
\cadenzaOn
}
\context {
\Staff
\remove Time_signature_engraver
}
\context {
\Voice
\remove Forbid_line_break_engraver
}
}
Cheers,
Valentin
Am Dienstag, 13. Juni 2023, 09:16:15 CEST schrieb Lib Lists:
> Hello,
> When trying to compile the complete score of the piece below (88
> staves and 120 quarter notes), I noticed it was taking many hours (I
> didn't finish the compilation). Trying with shorter versions, I got
> the following compilation times:
> - 2x quarter notes -> 16.7",
> - 4x quarter notes -> 1'17",
> - 8x quarter notes -> > 57'47" (!)
>
> Is there anything that could be optimised to reduce the compilation
> time? I'm afraid the final version could potentially take many days to
> compile.
>
> I'm on a MacBook Air M2 with macOS Ventura 13.4, Lilypond 2.25.5
>
> Thank you for any hint,
> Lib
>
> - - -
>
> \version "2.25.5"
>
> #(set-default-paper-size "a0")
> #(set-global-staff-size 15)
>
> mus = { \relative c''''' \repeat unfold 1 { c c c c }} % modify the
> \repeat unfold value for testing, final version should be 40
>
> #(define my-semitone->pitch
> (make-semitone->pitch
> (music-pitches #{ { c cis d ees e f fis g gis a bes b } #})))
>
> \new StaffGroup <<
> #@(map (lambda (i)
> #{
> \new Staff {
> \scaleDurations #(cons 120 i) {
> \transpose c' #(my-semitone->pitch (- (- 120 i))) {
> #(cond
> ((<= 108 i 120) #{ \ottava 2 #})
> ((<= 97 i 107) #{ \ottava 1 #})
> ((<= 72 i 96) #{ \ottava 0 #})
> ((<= 48 i 71) #{ \clef bass #})
> ((<= 33 i 47) #{ \clef bass \ottava -1 #} )
> (else #{ #}))
> \mus
> }
> }
> }
> #})
> (iota 88 120 -1))
>
>
> \layout {
> indent = #0
> \context {
> \Score
> \override SpacingSpanner.base-shortest-duration = #(ly:make-moment
> 1/4) proportionalNotationDuration = #(ly:make-moment 1/10)
> \override SpacingSpanner.uniform-stretching = ##t
> \override SpacingSpanner.strict-note-spacing = ##t
> forbidBreakBetweenBarLines = ##f
> \cadenzaOn
> }
> \context {
> \Staff
> \remove Time_signature_engraver
> }
> \context {
> \Voice
> \remove Forbid_line_break_engraver
> }
> }
signature.asc
Description: This is a digitally signed message part.
- How to generate \scaleDurations values procedurally, Lib Lists, 2023/06/11
- Re: How to generate \scaleDurations values procedurally, Jean Abou Samra, 2023/06/11
- Re: How to generate \scaleDurations values procedurally, Lib Lists, 2023/06/12
- Re: How to generate \scaleDurations values procedurally, Jean Abou Samra, 2023/06/12
- Message not available
- Re: How to generate \scaleDurations values procedurally, Jean Abou Samra, 2023/06/12
- Re: How to generate \scaleDurations values procedurally, Lib Lists, 2023/06/12
- Re: How to generate \scaleDurations values procedurally, Jean Abou Samra, 2023/06/12
- Re: How to generate \scaleDurations values procedurally, Lib Lists, 2023/06/12
- Compilation time (was: Generate \scaleDurations procedurally), Lib Lists, 2023/06/13
- Re: Compilation time (was: Generate \scaleDurations procedurally), Jean Abou Samra, 2023/06/13
- Re: Compilation time (was: Generate \scaleDurations procedurally),
Valentin Petzel <=
- Re: Compilation time (was: Generate \scaleDurations procedurally), Jean Abou Samra, 2023/06/13
- Re: Compilation time (was: Generate \scaleDurations procedurally), Lib Lists, 2023/06/13
- Re: How to generate \scaleDurations values procedurally, Valentin Petzel, 2023/06/12