[ << Tweaks and overrides ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Top ] | [ > ] |
Paper and layout
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < Paper and layout ] | [Plus haut: Paper and layout ] | [ > ] |
Alignement des noms d’instrument
L’alignement horizontal des noms d’instrument se gère à l’aide de la
propriété Staff.InstrumentName.self-alignment-X
. Les variables
indent
et short-indent
, attachées au bloc \layout
,
déterminent l’espace alloué à l’alignement des noms d’instrument,
respectivement dans leurs formes développée et abrégée.
\paper { left-margin = 3\cm } \score { \new StaffGroup << \new Staff \with { \override InstrumentName.self-alignment-X = #LEFT instrumentName = \markup \left-column { "Left aligned" "instrument name" } shortInstrumentName = "Left" } { c''1 \break c''1 } \new Staff \with { \override InstrumentName.self-alignment-X = #CENTER instrumentName = \markup \center-column { Centered "instrument name" } shortInstrumentName = "Centered" } { g'1 g'1} \new Staff \with { \override InstrumentName.self-alignment-X = #RIGHT instrumentName = \markup \right-column { "Right aligned" "instrument name" } shortInstrumentName = "Right" } { e'1 e'1 } >> \layout { ragged-right = ##t indent = 4\cm short-indent = 2\cm } }
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Paper and layout ] | [ > ] |
Agencement de paroles séparées sur une seule ligne
On peut vouloir positionner les paroles de différents intervenants sur
une même ligne, notamment pour un dialogue par bribes. Cet extrait
montre comment y parvenir avec l’instruction \override
VerticalAxisGroup.nonstaff-nonstaff-spacing.minimum-distance = ##f
.
\layout { \context { \Lyrics \override VerticalAxisGroup.nonstaff-nonstaff-spacing.minimum-distance = ##f } } aliceSings = \markup { \smallCaps "Alice" } eveSings = \markup { \smallCaps "Eve" } << \new Staff << \new Voice = "alice" { f'4^\aliceSings g' r2 | s1 | f'4^\aliceSings g' r2 | s1 | \break % ... \voiceOne s2 a'8^\aliceSings a' b'4 | \oneVoice g'1 } \new Voice = "eve" { s1 | a'2^\eveSings g' | s1 | a'2^\eveSings g' % ... \voiceTwo f'4^\eveSings a'8 g' f'4 e' | \oneVoice s1 } >> \new Lyrics \lyricsto "alice" { may -- be sec -- ond % ... Shut up, you fool! } \new Lyrics \lyricsto "eve" { that the words are % ... …and then I was like– } >>
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Paper and layout ] | [ > ] |
Partitionnement d’un ouvrage
\bookpart
permet de découper un ouvrage en plusieurs parties.
La dernière page de chaque partie peut être affectée d’un
ragged-last-bottom
. Les routines de formatage font la
distinction entre les markups d’entête et de pied de page selon
qu’ils se rattachent à une partie ou bien à l’ouvrage entier.
#(set-default-paper-size "a6") \book { %% book paper, which is inherited by all children bookparts \paper { ragged-last-bottom = ##t %% Page footer: add a different part-tagline at part last page oddFooterMarkup = \markup { \column { \fill-line { %% Copyright header field only on book first page. \if \on-first-page \fromproperty #'header:copyright } \fill-line { %% Part tagline header field only on each part last page. \if \on-last-page-of-part \fromproperty #'header:parttagline } \fill-line { %% Tagline header field only on book last page. \if \on-last-page \fromproperty #'header:tagline } } } } %% book header, which is inherited by the first bookpart \header { title = "Book title" copyright = "Copyright line on book first page" parttagline = "Part tagline" tagline = "Book tagline" } \bookpart { %% a different page breaking function may be used on each part \paper { page-breaking = #ly:minimal-breaking } \header { subtitle = "First part" } \markup { The first book part } \markup { a page break } \pageBreak \markup { first part last page } \markup \wordwrap { with ragged-last-bottom (see the space below this text) } } \bookpart { \header { subtitle = "Second part" } { c'4 } } }
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Paper and layout ] | [ > ] |
Modification de la taille d’une portée
Bien que le meilleur moyen de définir la taille des portées consiste à
utiliser #(set-global-staff-size xx)
, une portée en particulier
peut se redimensionner en affectant d’un coefficient ses propriétés
staff-space
et fontSize
.
<< \new Staff { \relative c'' { \dynamicDown c8\ff c c c c c c c } } \new Staff \with { fontSize = #-3 \override StaffSymbol.staff-space = #(magstep -3) } { \clef bass c8 c c c c\f c c c } >>
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Paper and layout ] | [ > ] |
Découpe de systèmes
Le code ci-dessous permet de réaliser des découpes à l’emporte pièce, autrement dit d’extraire des fragments, au sein d’une partition.
Dans la mesure où le rendu inclus dans ce manuel pourrait ne pas être
des plus évidents, nous vous conseillons de traiter ce fichier
individuellement, avec l’option -dclip-systems
.
Les fichiers résultants sont de la forme ‘base-from-début-to-fin[-compteur].eps’.
Lorsque sont inclus le début ou la fin d’un système, l’extraction comportera les objets rattachés au système, comme le nom d’instrument.
Les notes d’ornement qui se trouveraient en fin de fragment ne sont pas incluses.
La découpe peut couvrir plusieurs systèmes, auquel cas seront générés plusieurs fichiers EPS.
#(ly:set-option 'clip-systems) #(define output-suffix "1") origScore = \score { \relative c' { \new Staff \with { instrumentName = "Instrument" } c1 d1 \grace c16 e1 \key d \major f1 \break \clef bass g,1 fis1 } } \book { \score { \origScore \layout { % Each clip-region is a (START . END) pair % where both are rhythmic-locations. % (make-rhythmic-locations BAR-NUMBER NUM DEN) % means NUM/DEN whole-notes into bar numbered BAR-NUMBER clip-regions = #(list (cons (make-rhythmic-location 2 0 1) (make-rhythmic-location 4 0 1)) (cons (make-rhythmic-location 0 0 1) (make-rhythmic-location 4 0 1)) (cons (make-rhythmic-location 0 0 1) (make-rhythmic-location 6 0 1)) ) } } } #(ly:set-option 'clip-systems #f) #(define output-suffix #f) \book { \score { \origScore } \markup { \bold \fontsize #6 clips } \score { \lyrics { \markup { from-2.0.1-to-4.0.1-clip.eps } \markup { \epsfile #X #30.0 #(format #f "~a-1-from-2.0.1-to-4.0.1-clip.eps" (ly:parser-output-name)) } } } }
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Paper and layout ] | [ > ] |
Impression de papier à musique
Rien n’est plus simple, pour obtenir une feuille blanche avec des
portées, que de générer des mesures vides, de supprimer le
Bar_number_engraver
du contexte Score
, et les
Time_signature_engraver
, Clef_engraver
et
Bar_engraver
du contexte Staff
.
#(set-global-staff-size 20) \score { { \repeat unfold 12 { s1 \break } } \layout { indent = 0\in \context { \Staff \remove "Time_signature_engraver" \remove "Clef_engraver" \remove "Bar_engraver" } \context { \Score \remove "Bar_number_engraver" } } } % uncomment these lines for "letter" size %{ \paper { #(set-paper-size "letter") ragged-last-bottom = ##f line-width = 7.5\in left-margin = 0.5\in bottom-margin = 0.25\in top-margin = 0.25\in } %} % uncomment these lines for "A4" size %{ \paper { #(set-paper-size "a4") ragged-last-bottom = ##f line-width = 180 left-margin = 15 bottom-margin = 10 top-margin = 10 } %}
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Paper and layout ] | [ > ] |
Champs d’entête
Voici la liste de tous les champs d’entête :
\header { copyright = "copyright" title = "title" subtitle = "subtitle" composer = "composer" arranger = "arranger" instrument = "instrument" meter = "meter" opus = "opus" piece = "piece" poet = "poet" texidoc = "All header fields with special meanings." copyright = "public domain" enteredby = "jcn" source = "urtext" } \layout { ragged-right = ##f } \score { \relative c'' { c1 | c | c | c } } \score { \relative c'' { c1 | c | c | c } \header { title = "localtitle" subtitle = "localsubtitle" composer = "localcomposer" arranger = "localarranger" instrument = "localinstrument" metre = "localmetre" opus = "localopus" piece = "localpiece" poet = "localpoet" copyright = "localcopyright" } }
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Paper and layout ] | [ > ] |
Séparation visuelle entre les systèmes
La séparation entre deux systèmes consécutifs peut être mise en
évidence par n’importe quel markup. LilyPond dispose à cet effet
d’une double oblique inversée : \slashSeparator
.
\paper { system-separator-markup = \slashSeparator line-width = 120 } notes = \relative c' { c1 | c \break c1 | c \break c1 | c } \book { \score { \new GrandStaff << \new Staff \notes \new Staff \notes >> } }
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Paper and layout ] | [ > ] |
Table des matières
L’instruction \markuplist \table-of-contents
permet d’inclure
une table des matières. Ses éléments sont ajoutés à l’aide de la
commande \tocItem
.
#(set-default-paper-size "a6") \book { \markuplist \table-of-contents \pageBreak \tocItem \markup { The first score } \score { { c'1 \pageBreak \mark \default \tocItem \markup { Mark A } d'1 } } \pageBreak \tocItem \markup { The second score } \score { { e'1 } \header { piece = "Second score" } } }
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Paper and layout ] | [ Titles > ] |
Alignement vertical de StaffGroup
s sans SystemStartBar
Cet extrait indique comment obtenir des regroupements StaffGroup
alignés verticalement, disposant chacun de leur indication de groupe
SystemStartBar
, sans qu’il ne soient connectés entre eux.
#(set-global-staff-size 18) \paper { indent = 0 ragged-right = ##f print-all-headers = ##t } \layout { \context { \StaffGroup \consists Text_mark_engraver \consists Staff_collecting_engraver systemStartDelimiterHierarchy = #'(SystemStartBrace (SystemStartBracket a b)) } \context { \Score \remove Text_mark_engraver \remove Staff_collecting_engraver \override SystemStartBrace.style = #'bar-line \omit SystemStartBar \override SystemStartBrace.padding = #-0.1 \override SystemStartBrace.thickness = #1.6 \override StaffGrouper.staffgroup-staff-spacing.basic-distance = #15 } } %%%% EXAMPLE txt = \lyricmode { Wer4 nur den lie -- ben Gott läßt wal2 -- ten4 und4 hof -- fet auf ihn al -- le Zeit2. } % First StaffGroup "exercise" eI = \relative c' { \textMark \markup { \bold Teacher: This is a simple setting of the choral. Please improve it. } \key a \minor \time 4/4 \voiceOne \partial 4 e4 a b c b a b gis2 e4\fermata g! g f e a a gis a2.\fermata \bar ":|." } eII = \relative c' { \key a \minor \time 4/4 \voiceTwo \partial 4 c4 e e e gis a f e2 b4 b d d c c d d c2. \bar ":|." } eIII = \relative c' { \key a \minor \time 4/4 \clef bass \voiceOne \partial 4 a4 c b a b c d b2 gis4 g g b c a f e e2. } eIV = \relative c' { \key a \minor \time 4/4 \clef bass \voiceTwo \partial 4 a,4 a' gis a e a, d e2 e,4\fermata e' b g c f d e a,2.\fermata \bar ":|." } exercise = \new StaffGroup = "exercise" << \new Staff << \new Voice \eI \new Voice \eII >> \new Lyrics \txt \new Staff << \new Voice \eIII \new Voice \eIV >> >> % Second StaffGroup "simple Bach" sbI = \relative c' { \textMark \markup { \bold" Pupil:" Here's my version! } \key a \minor \time 4/4 \voiceOne \partial 4 e4 a b c b a b gis2 e4\fermata g! g f e a a gis a2.\fermata \bar ":|." } sbII = \relative c' { \key a \minor \time 4/4 \voiceTwo \partial 4 c8 d e4 e e8 f g4 f f e2 b4 b8 c d4 d e8 d c4 b8 c d4 c2. \bar ":|." } sbIII = \relative c' { \key a \minor \time 4/4 \clef bass \voiceOne \partial 4 a8 b c4 b a b8 c d4 d8 c b2 gis4 g g8 a b4 b a8 g f4 e e2. } sbIV = \relative c' { \key a \minor \time 4/4 \clef bass \voiceTwo \partial 4 a,4 a' gis a e f8 e d4 e2 e,4\fermata e' b a8 g c4 f8 e d4 e a,2.\fermata \bar ":|." } simpleBach = \new StaffGroup = "simple Bach" << \new Staff << \new Voice \sbI \new Voice \sbII >> \new Lyrics \txt \new Staff << \new Voice \sbIII \new Voice \sbIV >> >> % Third StaffGroup "chromatic Bach" cbI = \relative c' { \textMark \markup { \bold "Teacher:" \column { "Well, you simply copied and transposed a version of J.S.Bach." "Do you know this one?" } } \key a \minor \time 4/4 \voiceOne \partial 4 e4 a b c b a b gis4. fis8 e4\fermata g! g f e a a8 b gis4 a2.\fermata \bar ":|." } cbII = \relative c' { \key a \minor \time 4/4 \voiceTwo \partial 4 c8 d e4 e e8 fis gis4 a8 g! f!4 e2 b4 e e d d8[ cis] d dis e fis e4 e2. \bar ":|." } cbIII = \relative c' { \key a \minor \time 4/4 \clef bass \voiceOne \partial 4 a8 b c[ b] a gis8 a4 d, e8[ e'] d c b4. a8 gis4 b c d8 c b[ a] a b c b b c16 d c2. } cbIV = \relative c' { \key a \minor \time 4/4 \clef bass \voiceTwo \partial 4 a4 c, e a, b c d e2 e4\fermata e a b8 c gis[ g] fis f e dis e4 a,2.\fermata \bar ":|." } chromaticBach = \new StaffGroup = "chromatic Bach" << \new Staff << \new Voice \cbI \new Voice \cbII >> \new Lyrics \txt \new Staff << \new Voice \cbIII \new Voice \cbIV >> >> % Score \score { << \exercise \simpleBach \chromaticBach >> \header { title = \markup \column { \combine \null \vspace #1 "Exercise: Improve the given choral" " " } } \layout { \context { \Lyrics \override LyricText.X-offset = #-1 } } }
[ << Paper and layout ] | [Racine][Table des matières] | [ Titles >> ] |
[ < ] | [Plus haut: Paper and layout ] | [ Titles > ] |