Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
LilyPond wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Specifying number of measures per line
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
If you want to specify the number of measures per line, this Scheme engraver provides an alternative to inserting <code>\break</code>s within your file or using an extra voice for line breaks. This is a convenient method for music that changes meter, and a quick way to duplicate the layout of a model. The function takes a list of numbers describing a pattern which will repeat throughout the score. The example shows how to specify four measures per line. More numbers in the list will create a pattern of greater complexity. For example, <code>\consists #(bars-per-line-engraver '(2 3 4))</code> defines lines of two, three, and four bars in succession. If the lengths add up to the length of the score, you've specified the length of each line individually. The spacing engine will sometimes override your specifications if a line is too cramped as a result. To insist on your pattern, use the override of <code>'line-break-permission</code> which is commented out in the example. <lilypond version="2.24.0" full> %% http://lsr.di.unimi.it/LSR/Item?id=838 %LSR completed by P.P.Schneider on Feb. 2014 for v2.18 #(define ((bars-per-line-engraver bar-list) context) (let* ((working-copy bar-list) (total (1+ (car working-copy)))) `((acknowledgers (paper-column-interface . ,(lambda (engraver grob source-engraver) (let ((internal-bar (ly:context-property context 'internalBarNumber))) (if (and (pair? working-copy) (= (remainder internal-bar total) 0) (eq? #t (ly:grob-property grob 'non-musical))) (begin (set! (ly:grob-property grob 'line-break-permission) 'force) (if (null? (cdr working-copy)) (set! working-copy bar-list) (begin (set! working-copy (cdr working-copy)))) (set! total (+ total (car working-copy)))))))))))) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EXAMPLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% myMusic = \relative c' { \repeat unfold 4 { \time 5/4 c4 c c c c \time 3/4 c c c \time 3/2 c2 c c } } \score { \new Staff { \once\override Score.RehearsalMark.self-alignment-X = #LEFT \mark\markup\small\italic "4 measures per line:" \myMusic } \layout { \context { \Score %use the line below to insist on your layout %\override NonMusicalPaperColumn.line-break-permission = ##f \consists #(bars-per-line-engraver '(4)) } } } \score { \new Staff { \once \override Score.RehearsalMark.self-alignment-X = #LEFT \mark\markup\small\italic "6 measures per line:" \myMusic } \layout { \context { \Score %use the line below to insist on your layout %\override NonMusicalPaperColumn.line-break-permission = ##f \consists #(bars-per-line-engraver '(6)) } } } \paper { tagline = ##f } </lilypond> [[Category:Paper and layout]] [[Category:Breaks]] [[Category:Contexts and engravers]] [[Category:Scheme]]
Summary:
Please note that all contributions to LilyPond wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Meta:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Specifying number of measures per line
Add topic