Hallo Joei,
den Versuch am SpacingSpanner rumzuschrauben würde ich mir für gaaaanz zuletzt aufheben.
1. Versuch es erst mal mit \paper-Variablen:
page-count
bzw evtl
system-count
2. Wenn das nicht hilft dann mit einer zweiten Stimme für \breaks
(ist wesentlich einfacher als andauernd \noBreak bzw \break in die Stimme zu schreiben)
Falls Du gänzlich auf manuelle breaks ausweichst so setze
\override NonMusicalPaperColumn #'line-break-permission = ##f
und falls Du die pageBreaks auch manuell machst
\override NonMusicalPaperColumn #'page-break-permission = ##f
in \layout.
3. Es gibt auch
http://lsr.dsi.unimi.it/LSR/Item?u=1&id=838Unter
http://lilypond.1069038.n5.nabble.com/measures-per-system-td136878.html findest Du die soweit ich weiß neueste Fassung.
Dank an David Nalesnik.
Hierdurch wird das Schreiben einer zweiten Stimme überflüssig, vielmehr alles über einen engraver geregelt.
Im Beispiel-Code ist nur das unveränderte Original-Beispiel einkommentiert. Versuch doch mal stattdessen eine der anderen Möglichkeiten einzukommentieren und schau was passiert.
\version "2.16.1"
m =
\relative c' {
\repeat unfold 50 { c4 e8 g c4 e8 g | c4 g8 e c4 g8 e | } \bar "|."
}
breakVoice = {
\repeat unfold 33 { s1*3 \break }
}
groupOriginal =
<<
\new Staff \m
\new Staff \m
>>
groupBreakVoice =
<<
\new Staff << \m \breakVoice >>
\new Staff \m
>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%{
\score {
\groupOriginal
}
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{
\paper {
page-count = 2 % This will return a warning, because the music doesn't fit on 2 pages
% Sometimes alternatively:
%system-count = 3
}
\score {
\groupOriginal
}
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{
\score {
\groupBreakVoice
\layout {
\context {
\Score
% To insist on your manual \break
\override NonMusicalPaperColumn #'line-break-permission = ##f
% To insist on your manual \pageBreak
%\override NonMusicalPaperColumn #'page-break-permission = ##f
}
}
}
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{
#(define (expand-repetitions lst seed)
(if (symbol? (car lst))
(let* ((str (symbol->string (car lst)))
(split (string-split str #\*))
(split (map (lambda (elem) (string->number elem)) split)))
(set! seed (append seed (make-list (cadr split) (car split)))))
(set! seed (append seed (list (car lst)))))
(if (null? (cdr lst))
seed
(expand-repetitions (cdr lst) seed)))
#(define (bars-per-line-systems-per-page-engraver lst)
(let* ((working-copy
(if (pair? (car lst))
(map (lambda (sys) (expand-repetitions sys '()))
lst)
(expand-repetitions lst '())))
(bars-and-systems? (pair? (car lst)))
(systems-per-page
(if bars-and-systems?
(car working-copy)
#f))
(total
(if systems-per-page
(1+ (car systems-per-page))
(1+ (car working-copy))))
(last-measure-seen 0))
`((stop-translation-timestep
. ,(lambda (trans)
(let* ((context (ly:translator-context trans))
(internal-bar (ly:context-property context 'internalBarNumber))
(current-col (ly:context-property context 'currentCommandColumn)))
;; we are only interested in the first NonMusicalPaperColumn of
;; each measure
(if (and (> internal-bar last-measure-seen)
(= (remainder internal-bar total) 0)
(pair? working-copy))
(begin
(set! (ly:grob-property current-col 'line-break-permission) 'force)
(set! last-measure-seen internal-bar)
(if bars-and-systems?
(begin
(if (null? (cdr systems-per-page))
(begin
(set! (ly:grob-property current-col 'page-break-permission) 'force)
(if (pair? (cdr working-copy))
(begin
(set! working-copy (cdr working-copy))
(set! systems-per-page (car working-copy)))
(set! working-copy '())))
(set! systems-per-page (cdr systems-per-page)))
(set! total (+ total (car systems-per-page))))
(begin
(if (null? (cdr working-copy))
(set! working-copy lst)
(begin
(set! working-copy (cdr working-copy))))
(set! total (+ total (car working-copy)))))))))))))
\paper { ragged-last-bottom = ##f }
\score {
\groupOriginal
\layout {
\context {
\Score
% To insist on your manual \break
\override NonMusicalPaperColumn #'line-break-permission = ##f
% To insist on your manual \pageBreak
%\override NonMusicalPaperColumn #'page-break-permission = ##f
}
\context {
\Staff
%% The following override specifies measures per line only
%\consists #(bars-per-line-systems-per-page-engraver '(5 7*5 1 3*3))
%% The following line specifies measures per line and systems per page
\consists #(bars-per-line-systems-per-page-engraver '((6*6) (6*6) (6*6)))
}
}
}
%}HTH,
Harm
P.S. Falls nichts für Dich passend ist können wir immer noch nach dem SpacingSpanner schauen.