[ << Simultaneous notes ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Top ] | [ > ] |
Staff notation
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < Staff notation ] | [ Amunt : Staff notation ] | [ > ] |
Afegir un àmbit per veu
Es pot afegir un àmbit per cada veu. En aquest cas, l’àmbit s’ha de desplaçar manualment per evitar col·lisions.
\new Staff << \new Voice \with { \consists "Ambitus_engraver" } \relative c'' { \override Ambitus.X-offset = #2.0 \voiceOne c4 a d e f1 } \new Voice \with { \consists "Ambitus_engraver" } \relative c' { \voiceTwo es4 f g as b1 } >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Afegir un pentagrama nou
Es pot afegir (possiblement de forma temporal) un pentagrama nou un cop la peça ha començat.
\score { << \new Staff \relative c'' { c1 | c | c | c | c } \new StaffGroup \relative c'' { \new Staff { c1 | c << { c1 | d } \new Staff { \once \omit Staff.TimeSignature c1 | b } >> c1 } } >> }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Afegir un pentagrama addicional a un salt de línia
En afegir un pentagrama nou a un salt de línia, per desgràcia
s’afegeix un espai addicional al final de la línia abans del
salt (reservat per fer lloc a un canvi d’armadura que de totes
formes no s’imprimirà). La solució alternativa és afegir un
ajustament per a Staff.explicitKeySignatureVisibility
com es mostra a l’exemple.
\score { \new StaffGroup \relative c'' { \new Staff \key f \major c1 c^"Unwanted extra space" \break << { c1 | c } \new Staff { \key f \major \once \omit Staff.TimeSignature c1 | c } >> c1 | c^"Fixed here" \break << { c1 | c } \new Staff { \once \set Staff.explicitKeySignatureVisibility = #end-of-line-invisible \key f \major \once \omit Staff.TimeSignature c1 | c } >> } }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Afegir indicadors als pentagrames que es divideixen després d’un salt de línia
Aquest fragment de codi defineix les ordres
\splitStaffBarLine
, convUpStaffBarLine
i
convDownStaffBarLine
, que afegeix una fletxa doble a
l’últim compàs d’un pentagrama, indicant que les diverses veus
disposaran d’un pentagrama propi a la línia següent.
#(define-markup-command (arrow-at-angle layout props angle-deg length fill) (number? number? boolean?) (let* ( (PI-OVER-180 (/ (atan 1 1) 34)) (degrees->radians (lambda (degrees) (* degrees PI-OVER-180))) (angle-rad (degrees->radians angle-deg)) (target-x (* length (cos angle-rad))) (target-y (* length (sin angle-rad)))) (interpret-markup layout props (markup #:translate (cons (/ target-x 2) (/ target-y 2)) #:rotate angle-deg #:translate (cons (/ length -2) 0) #:concat (#:draw-line (cons length 0) #:arrow-head X RIGHT fill))))) splitStaffBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) { \combine \arrow-at-angle #45 #(sqrt 8) ##t \arrow-at-angle #-45 #(sqrt 8) ##t } splitStaffBarLine = { \once \override Staff.BarLine.stencil = #(lambda (grob) (ly:stencil-combine-at-edge (ly:bar-line::print grob) X RIGHT (grob-interpret-markup grob splitStaffBarLineMarkup) 0)) \break } convDownStaffBarLine = { \once \override Staff.BarLine.stencil = #(lambda (grob) (ly:stencil-combine-at-edge (ly:bar-line::print grob) X RIGHT (grob-interpret-markup grob #{ \markup\with-dimensions #'(0 . 0) #'(0 . 0) { \translate #'(0 . -.13)\arrow-at-angle #-45 #(sqrt 8) ##t }#}) 0)) \break } convUpStaffBarLine = { \once \override Staff.BarLine.stencil = #(lambda (grob) (ly:stencil-combine-at-edge (ly:bar-line::print grob) X RIGHT (grob-interpret-markup grob #{ \markup\with-dimensions #'(0 . 0) #'(0 . 0) { \translate #'(0 . .14)\arrow-at-angle #45 #(sqrt 8) ##t }#}) 0)) \break } \paper { ragged-right = ##t short-indent = 10\mm } separateSopranos = { \set Staff.instrumentName = "AI AII" \set Staff.shortInstrumentName = "AI AII" \splitStaffBarLine \change Staff = "up" } convSopranos = { \convDownStaffBarLine \change Staff = "shared" \set Staff.instrumentName = "S A" \set Staff.shortInstrumentName = "S A" } sI = { \voiceOne \repeat unfold 4 f''2 \separateSopranos \repeat unfold 4 g''2 \convSopranos \repeat unfold 4 c''2 } sII = { s1*2 \voiceTwo \change Staff = "up" \repeat unfold 4 d''2 } aI = { \voiceTwo \repeat unfold 4 a'2 \voiceOne \repeat unfold 4 b'2 \convUpStaffBarLine \voiceTwo \repeat unfold 4 g'2 } aII = { s1*2 \voiceTwo \repeat unfold 4 g'2 } ten = { \voiceOne \repeat unfold 4 c'2 \repeat unfold 4 d'2 \repeat unfold 4 c'2 } bas = { \voiceTwo \repeat unfold 4 f2 \repeat unfold 4 g2 \repeat unfold 4 c2 } \score { << \new ChoirStaff << \new Staff = up \with { instrumentName = "SI SII" shortInstrumentName = "SI SII" } { s1*4 } \new Staff = shared \with { instrumentName = "S A" shortInstrumentName = "S A" } << \new Voice = sopI \sI \new Voice = sopII \sII \new Voice = altI \aI \new Voice = altII \aII >> \new Lyrics \with { alignBelowContext = up } \lyricsto sopII { e f g h } \new Lyrics \lyricsto altI { a b c d e f g h i j k l } \new Staff = men \with { instrumentName = "T B" shortInstrumentName = "T B" } << \clef F \new Voice = ten \ten \new Voice = bas \bas >> \new Lyrics \lyricsto bas { a b c d e f g h i j k l } >> >> \layout { \context { \Staff \RemoveEmptyStaves \override VerticalAxisGroup.remove-first = ##t } } }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Afegir notes guia orquestrals a una partitura vocal
Aquest exemple mostra una forma de simplificar l’addició de
moltes notes guia orquestrals a la reducció de piano a una partitura vocal.
La funció musical \cueWhile
agafa quatre arguments: la
música de la qual es pren la citació, com ve definida per
\addQuote
, el nom a inserir abans de la notes guia, i
després #UP
o #DOWN
per especificar \voiceOne
amb el nom a sobre del pentagrama o bé \voiceTwo
amb el nom
a sota del pentagrama, i finalment la música de piano amb la qual les
notes guia han d’aparèixer en paral·lel. El nom de l’instrument
citat es posiciona a l’esquerra de les notes guia. Es poden
citar molts passatges com a guia, però no es poden superposar en
el temps entre ells.
cueWhile = #(define-music-function (instrument name dir music) (string? string? ly:dir? ly:music?) #{ \cueDuring $instrument #dir { \once \override TextScript.self-alignment-X = #RIGHT \once \override TextScript.direction = $dir <>-\markup { \tiny #name } $music } #}) flute = \relative c'' { \transposition c' s4 s4 e g } \addQuote "flute" { \flute } clarinet = \relative c' { \transposition bes fis4 d d c } \addQuote "clarinet" { \clarinet } singer = \relative c'' { c4. g8 g4 bes4 } words = \lyricmode { here's the lyr -- ics } pianoRH = \relative c'' { \transposition c' \cueWhile "clarinet" "Clar." #DOWN { c4. g8 } \cueWhile "flute" "Flute" #UP { g4 bes4 } } pianoLH = \relative c { c4 <c' e> e, <g c> } \score { << \new Staff { \new Voice = "singer" { \singer } } \new Lyrics { \lyricsto "singer" \words } \new PianoStaff << \new Staff { \new Voice { \pianoRH } } \new Staff { \clef "bass" \pianoLH } >> >> }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Afegir marques de temps a glissandos llargs
Els temps que se salten a glissandos molt llargs s’indiquen a vegades mitjançant marques de temps, que sovint consisteixen en figures sense cap. Aquestes pliques es poden usar també per allotjar indicacions expressives intermèdies.
Si les pliques no queden ben alineades amb el glissando, podria caldre recol·locar-les lleugerament.
glissandoSkipOn = { \override NoteColumn.glissando-skip = ##t \hide NoteHead \override NoteHead.no-ledgers = ##t } glissandoSkipOff = { \revert NoteColumn.glissando-skip \undo \hide NoteHead \revert NoteHead.no-ledgers } \relative c'' { r8 f8\glissando \glissandoSkipOn f4 g a a8\noBeam \glissandoSkipOff a8 r8 f8\glissando \glissandoSkipOn g4 a8 \glissandoSkipOff a8 | r4 f\glissando \< \glissandoSkipOn a4\f \> \glissandoSkipOff b8\! r | }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Numeració de compassos alternativa
Es poden seleccionar dos mètodes alternatius per a la numeració de compassos, especials quan hi ha repeticions.
\relative c'{ \set Score.alternativeNumberingStyle = #'numbers \repeat volta 3 { c4 d e f | } \alternative { { c4 d e f | c2 d \break } { f4 g a b | f4 g a b | f2 a | \break } { c4 d e f | c2 d } } c1 \break \set Score.alternativeNumberingStyle = #'numbers-with-letters \repeat volta 3 { c,4 d e f | } \alternative { { c4 d e f | c2 d \break } { f4 g a b | f4 g a b | f2 a | \break } { c4 d e f | c2 d } } c1 }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Ambitus after key signature
By default, ambitus are positioned at the left of the clef. The
\ambitusAfter
function allows for changing this
placement. Syntax is \ambitusAfter grob-interface
(see
Graphical Object Interfaces for a list of possible values for
grob-interface
.)
A common use case is printing the ambitus between key signature and time signature.
\new Staff \with { \consists Ambitus_engraver } \relative { \ambitusAfter key-signature \key d \major es'8 g bes cis d2 }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Nombres de compàs centrats
Sovint, les partitures d’obres per a conjunts grnas tenen els
nombres de compàs a sota del sistems i centrats horitzontalment
sobre l’amplada del compàs. Aquest fragment de codi mostra com
pot usar-se el gravador Measure_counter_engraver
per simular
aquesta pràctica de notació. Aquí hem afegit el gravador a un
context Dynamics
.
\layout { \context { \Dynamics \consists #Measure_counter_engraver \override MeasureCounter.direction = #DOWN \override MeasureCounter.font-encoding = #'latin1 \override MeasureCounter.font-shape = #'italic % to control the distance of the Dynamics context from the staff: \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = #2 } \context { \Score \remove "Bar_number_engraver" } } pattern = \repeat unfold 7 { c'4 d' e' f' } \new StaffGroup << \new Staff { \pattern } \new Staff { \pattern } \new Dynamics { \startMeasureCount s1*7 \stopMeasureCount } >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Changing the default bar lines
Default bar lines can be changed when re-defined in a score context.
% http://lsr.di.unimi.it/LSR/Item?id=964 %%=> http://lists.gnu.org/archive/html/lilypond-user/2014-03/msg00126.html %%=> http://lilypond.1069038.n5.nabble.com/Changing-the-default-end-repeat-bracket-tc169357.html \layout { \context { \Score %% Changing the defaults from engraver-init.ly measureBarType = #"!" startRepeatBarType = #"[|:" endRepeatBarType = #":|]" doubleRepeatBarType = #":|][|:" } } %% example: { c'1 \repeat volta 2 { \repeat unfold 2 c' } \repeat volta 2 { \repeat unfold 2 c' } \alternative { { c' } { %% v2.18 workaround \once\override Score.VoltaBracket.shorten-pair = #'(1 . -1) c' } } \bar "|." }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Canvi del nombre de línies d’una pauta
El nombre de línies d’una pauta es pot modificar sobreescrivint la
propietat line-count
de l’objecte StaffSymbol
.
upper = \relative c'' { c4 d e f } lower = \relative c { \clef bass c4 b a g } \score { \context PianoStaff << \new Staff { \upper } \new Staff { \override Staff.StaffSymbol.line-count = #4 \lower } >> }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Modificar la mida de la pauta
Tot i que la manera més senzilla de redimensionar els pentagrames és
usar #(set-global-staff-size xx)
, la mida d’una pauta
individual es pot canviar escalant les propietats de
'staff-space
i de 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 } >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Crear pentagrames en blanc
Per crear pentagrames en blanc, genereu compassos buits i després
elimineu el gravador de números de compàs Bar_number_engraver
del context Score
, i els gravadors de la indicacó de compàs
Time_signature_engraver
, de la clau Clef_engraver
i
dels compassos Bar_engraver
del context de 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 } %}
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Creació d’armadures personalitzades
El LilyPond accepta armadures personalitzades. En aquest exemple, es mostra l’armadura de re menor amb una rang estès de bemolls.
\new Staff \with { \override StaffSymbol.line-count = #8 \override KeySignature.flat-positions = #'((-7 . 6)) \override KeyCancellation.flat-positions = #'((-7 . 6)) % presumably sharps are also printed in both octaves \override KeySignature.sharp-positions = #'((-6 . 7)) \override KeyCancellation.sharp-positions = #'((-6 . 7)) \override Clef.stencil = # (lambda (grob)(grob-interpret-markup grob #{ \markup\combine \musicglyph "clefs.C" \translate #'(-3 . -2) \musicglyph "clefs.F" #})) clefPosition = #3 middleCPosition = #3 middleCClefPosition = #3 } { \key d\minor f bes, f bes, }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Crear digitacions de dues xifres
És possible crear digitacions amb el nombre més gran de 5.
\relative c' { c1-10 c1-50 c1-36 c1-29 }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Pliques de pentagrama creuat
Aquest fragment de codi mostra l’ús del gravador
Span_stem_engraver
i de \crossStaff
per connectar
automàticament pliques d’un pentagrama a un altre. No cal
especificar la longitud de la plica perquè la distància variable
entre els caps de les notes i els pentagrames es calcula automàticament.
\layout { \context { \PianoStaff \consists "Span_stem_engraver" } } { \new PianoStaff << \new Staff { <b d'>4 r d'16\> e'8. g8 r\! e'8 f' g'4 e'2 } \new Staff { \clef bass \voiceOne \autoBeamOff \crossStaff { <e g>4 e, g16 a8. c8} d \autoBeamOn g8 f g4 c2 } >> }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Mostrar claudàtor o clau en grups d’un sol pentagrama
Si hi ha un sols pentagrama en un dels tipus de sistema
ChoirStaff
o StaffGroup
, el comportament
predeterminat és que no s’imprimeixi el claudàtor a la barra inicial. Això
es pot canviar sobreescrivint collapse-height
per fixar el seu
valor de manera que sigui menor que el nombre de línies a la pauta.
Observeu que en contextos com PianoStaff
i
GrandStaff
en els quals els sistemes comencen amb una clau en
comptes d’un claudàtor, s’ha d’establir el valor d’una propietat
diferent, com es veu al segon sistema de l’exemple.
\score { \new StaffGroup << % Must be lower than the actual number of staff lines \override StaffGroup.SystemStartBracket.collapse-height = #4 \override Score.SystemStartBar.collapse-height = #4 \new Staff { c'1 } >> } \score { \new PianoStaff << \override PianoStaff.SystemStartBrace.collapse-height = #4 \override Score.SystemStartBar.collapse-height = #4 \new Staff { c'1 } >> }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Extending a TrillSpanner
For TrillSpanner
, the minimum-length
property becomes
effective only if the set-spacing-rods
procedure is called
explicitly.
To do this, the springs-and-rods
property should be set to
ly:spanner::set-spacing-rods
.
\relative c' { \key c\minor \time 2/4 c16( as') c,-. des-. \once\override TrillSpanner.minimum-length = #15 \once\override TrillSpanner.springs-and-rods = #ly:spanner::set-spacing-rods \afterGrace es4 \startTrillSpan { d16[( \stopTrillSpan es)] } c( c' g es c g' es d \hideNotes c8) }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Estendre glissandos sobre repeticions
Es pot simular un glissando que s’estén fins a l’interior de diversos
blocs \alternative
de primera i segona vegada mitjançant
l’addició d’una nota d’adorn oculta amb un glissando al començament de
cada bloc \alternative
. La nota d’adorn ha d’estar a la
mateixa alçada que la nota que dona inici al primer glissando., Això
s’implementa aquí amb una funció musical que agafa com a argument
l’altura de la nota d’adorn.
Observeu que a la música polifònica la nota d’adorn ha de coincidir amb les notes d’adorn corresponents en totes les altres veus.
repeatGliss = #(define-music-function (grace) (ly:pitch?) #{ % the next two lines ensure the glissando is long enough % to be visible \once \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods \once \override Glissando.minimum-length = #3.5 \once \hideNotes \grace $grace \glissando #}) \score { \relative c'' { \repeat volta 3 { c4 d e f\glissando } \alternative { { g2 d } { \repeatGliss f g2 e } { \repeatGliss f e2 d } } } } music = \relative c' { \voiceOne \repeat volta 2 { g a b c\glissando } \alternative { { d1 } { \repeatGliss c \once \omit StringNumber e1\2 } } } \score { \new StaffGroup << \new Staff << \new Voice { \clef "G_8" \music } >> \new TabStaff << \new TabVoice { \clef "moderntab" \music } >> >> }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Flat Ties
The function takes the default Tie.stencil
as an argument,
calculating the result relying on the extents of this default.
Further tweaking is possible by overriding
Tie.details.height-limit
or with \shape
. It’s also
possible to change the custom-definition on the fly.
%% http://lsr.di.unimi.it/LSR/Item?id=1031 #(define ((flared-tie coords) grob) (define (pair-to-list pair) (list (car pair) (cdr pair))) (define (normalize-coords goods x y dir) (map (lambda (coord) ;(coord-scale coord (cons x (* y dir))) (cons (* x (car coord)) (* y dir (cdr coord)))) goods)) (define (my-c-p-s points thick) (make-connected-path-stencil points thick 1.0 1.0 #f #f)) ;; outer let to trigger suicide (let ((sten (ly:tie::print grob))) (if (grob::is-live? grob) (let* ((layout (ly:grob-layout grob)) (line-thickness (ly:output-def-lookup layout 'line-thickness)) (thickness (ly:grob-property grob 'thickness 0.1)) (used-thick (* line-thickness thickness)) (dir (ly:grob-property grob 'direction)) (xex (ly:stencil-extent sten X)) (yex (ly:stencil-extent sten Y)) (lenx (interval-length xex)) (leny (interval-length yex)) (xtrans (car xex)) (ytrans (if (> dir 0)(car yex) (cdr yex))) (uplist (map pair-to-list (normalize-coords coords lenx (* leny 2) dir)))) (ly:stencil-translate (my-c-p-s uplist used-thick) (cons xtrans ytrans))) '()))) #(define flare-tie (flared-tie '((0 . 0)(0.1 . 0.2) (0.9 . 0.2) (1.0 . 0.0)))) \layout { \context { \Voice \override Tie.stencil = #flare-tie } } \paper { ragged-right = ##f } \relative c' { a4~a \override Tie.height-limit = 4 a'4~a a'4~a <a,, c e a c e a c e>~ q \break a'4~a \once \override Tie.details.height-limit = 14 a4~a \break a4~a \once \override Tie.details.height-limit = 0.5 a4~a \break a4~a \shape #'((0 . 0) (0 . 0.4) (0 . 0.4) (0 . 0)) Tie a4~a \break a4~a \once \override Tie.stencil = #(flared-tie '((0 . 0)(0.1 . 0.4) (0.9 . 0.4) (1.0 . 0.0))) a4~a a4~a \once \override Tie.stencil = #(flared-tie '((0 . 0)(0.06 . 0.1) (0.94 . 0.1) (1.0 . 0.0))) a4~a }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Forçar l’amplada dels compassos perquè s’adaptin a l’amplada de les indicacions metronòmiques
De forma predeterminada, les indicacions metronòmiques no influeixen l’espaiat horitzontal. Això es pot resoldre per mitjà d’una senzilla sobreescriptura, com pot veure’s a la segona meitat de l’exemple.
example = { \tempo "Allegro" R1*6 \tempo "Rall." R1*2 \tempo "A tempo" R1*8 } { \compressMMRests { \example R1 R1 \override Score.MetronomeMark.extra-spacing-width = #'(-3 . 0) \example } }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Glissando per sota d’una objecte gràfic
Els objectes gràfics de columna de nota (els grobs NoteColumn
)
poder ser sobrepassats pels glissandos.
\relative c' { a2 \glissando \once \override NoteColumn.glissando-skip = ##t f''4 d, }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Incipit
En transcriure música mensural, és útil posar un incipit al començament de la peça per indicar la tonalitat i el compàs originals. Actualment els músics estan acostumats a les línies del pentagrama, però en el període de la música mensural encara no s’utilitzaven. Com a compromís, amb freqüència s’imprimeixen línies divisòries entre els pentagrames, un estil de disseny conegut com mensurstriche.
%% With 2.23. this throws: %% programming error: Loose column does not have right side to attach to. %% Likely "Hidden BarLine during note yields programming error" %% https://gitlab.com/lilypond/lilypond/-/issues/4084 %% --Harm %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % A short excerpt from the Jubilate Deo by Orlande de Lassus %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% global = { \set Score.skipBars = ##t \key g \major \time 4/4 % the actual music \skip 1*8 % let finis bar go through all staves \override Staff.BarLine.transparent = ##f % finis bar \bar "|." } discantusIncipit = { \clef "neomensural-c1" \key f \major \time 2/2 c''1. } discantusNotes = { \transpose c' c'' { \clef "treble" d'2. d'4 | b e' d'2 | c'4 e'4.( d'8 c' b | a4) b a2 | b4.( c'8 d'4) c'4 | \once \hide NoteHead c'1 | b\breve | } } discantusLyrics = \lyricmode { Ju -- bi -- la -- te De -- o, om -- nis ter -- ra, __ om- "..." -us. } altusIncipit = { \clef "neomensural-c3" \key f \major \time 2/2 r1 f'1. } altusNotes = { \transpose c' c'' { \clef "treble" r2 g2. e4 fis g | a2 g4 e | fis g4.( fis16 e fis4) | g1 | \once \hide NoteHead g1 | g\breve | } } altusLyrics = \lyricmode { Ju -- bi -- la -- te De -- o, om -- nis ter -- ra, "..." -us. } tenorIncipit = { \clef "neomensural-c4" \key f \major \time 2/2 r\longa r\breve r1 c'1. } tenorNotes = { \transpose c' c' { \clef "treble_8" R1 | R1 | R1 | % two measures r2 d'2. d'4 b e' | \once \hide NoteHead e'1 | d'\breve | } } tenorLyrics = \lyricmode { Ju -- bi -- la -- te "..." -us. } bassusIncipit = { \clef "mensural-f" \key f \major \time 2/2 r\maxima f1. } bassusNotes = { \transpose c' c' { \clef "bass" R1 | R1 | R1 | R1 | g2. e4 | \once \hide NoteHead e1 | g\breve | } } bassusLyrics = \lyricmode { Ju -- bi- "..." -us. } \score { << \new StaffGroup = choirStaff << \new Voice = "discantusNotes" << \set Staff.instrumentName = "Discantus" \incipit \discantusIncipit \global \discantusNotes >> \new Lyrics \lyricsto discantusNotes { \discantusLyrics } \new Voice = "altusNotes" << \set Staff.instrumentName = "Altus" \global \incipit \altusIncipit \altusNotes >> \new Lyrics \lyricsto altusNotes { \altusLyrics } \new Voice = "tenorNotes" << \set Staff.instrumentName = "Tenor" \global \incipit \tenorIncipit \tenorNotes >> \new Lyrics \lyricsto tenorNotes { \tenorLyrics } \new Voice = "bassusNotes" << \set Staff.instrumentName = "Bassus" \global \incipit \bassusIncipit \bassusNotes >> \new Lyrics \lyricsto bassusNotes { \bassusLyrics } >> >> \layout { \context { \Score %% no bar lines in staves or lyrics \hide BarLine } %% the next two instructions keep the lyrics between the bar lines \context { \Lyrics \consists "Bar_engraver" \consists "Separating_line_group_engraver" } \context { \Voice %% no slurs \hide Slur %% Comment in the below "\remove" command to allow line %% breaking also at those bar lines where a note overlaps %% into the next measure. The command is commented out in this %% short example score, but especially for large scores, you %% will typically yield better line breaking and thus improve %% overall spacing if you comment in the following command. %%\remove "Forbid_line_break_engraver" } indent = 6\cm incipit-width = 4\cm } }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Inserir fragments de partitures a sobre del pentagrama com elements de marcatge
L’ordre \markup
és molt versàtil. En aquest fragment de
codi, hi ha un bloc \score
amb una partitura completa en
comptes de textos o altra marcatge.
tuning = \markup { \score { \new Staff \with { \remove "Time_signature_engraver" } { \clef bass <c, g, d g>1 } \layout { ragged-right = ##t indent = 0\cm } } } \header { title = "Solo Cello Suites" subtitle = "Suite IV" subsubtitle = \markup { Originalstimmung: \raise #0.5 \tuning } } \layout { ragged-right = ##f } \relative c'' { \time 4/8 \tuplet 3/2 { c8 d e } \tuplet 3/2 { c d e } \tuplet 3/2 { c8 d e } \tuplet 3/2 { c d e } g8 a g a g8 a g a }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Let TabStaff print the topmost string at bottom
In tablatures usually the first string is printed topmost. If you want
to have it at the bottom change the
stringOneTopmost
-context-property. For a context-wide setting
this could be done in layout
as well.
%\layout { % \context { % \Score % stringOneTopmost = ##f % } % \context { % \TabStaff % tablatureFormat = #fret-letter-tablature-format % } %} m = { \cadenzaOn e, b, e gis! b e' \bar "||" } << \new Staff { \clef "G_8" <>_"default" \m <>_"italian (historic)"\m } \new TabStaff { \m \set Score.stringOneTopmost = ##f \set TabStaff.tablatureFormat = #fret-letter-tablature-format \m } >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Donar format a tabulatures amb lletres
Es pot donar format a la tabulatura usant lletres en comptes de nombres.
music = \relative c { c4 d e f g4 a b c d4 e f g } << \new Staff { \clef "G_8" \music } \new TabStaff \with { tablatureFormat = #fret-letter-tablature-format } { \music } >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Making glissandi breakable
Si s’ajusta la propietat breakable
al valor #t
en
combinació amb after-line-breaking
, podem fer que un
glissando es divideixi en el salt de línia:
glissandoSkipOn = { \override NoteColumn.glissando-skip = ##t \hide NoteHead \override NoteHead.no-ledgers = ##t } \relative c'' { \override Glissando.breakable = ##t \override Glissando.after-line-breaking = ##t f1\glissando | \break a4 r2. | f1\glissando \once \glissandoSkipOn \break a2 a4 r4 | }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Fer unes línies del pentagrama més gruixudes que les altres
Es pot fer una línia de pentagrama més gruixuda amb fins
pedagògics (per exemple la tercera línia o la de la clau de sol).
Això es pot aconseguir afegint més línies molt a prop de la línia
que es vol destacar, utilitzant la propietat line-positions
de l’objecte StaffSymbol
.
{ \override Staff.StaffSymbol.line-positions = #'(-4 -2 -0.2 0 0.2 2 4) d'4 e' f' g' }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Comptador de compassos
Aquest fragment de codi proporciona una solució alternativa a la producció de comptadors de compàs utilitzant repeticions transparents de tipus percentatge.
<< \context Voice = "foo" { \clef bass c4 r g r c4 r g r c4 r g r c4 r g r } \context Voice = "foo" { \set countPercentRepeats = ##t \hide PercentRepeat \override PercentRepeatCounter.staff-padding = #1 \repeat percent 4 { s1 } } >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Disposició Mensurstriche (línies divisòries entre pentagrames)
La disposició «mensurstriche» en els quals les línies divisòries
no estan dibuixades sobre els pentagrames, sinó entre ells, es pot
aconseguir amb un StaffGroup
en comptes d’un ChoirStaff
.
La línia divisòria sobre els pentagrames s’esborra usant \hide
.
\layout { \context { \Staff measureBarType = "-span|" } } music = \fixed c'' { c1 d2 \section e2 f1 \fine } \new StaffGroup << \new Staff \music \new Staff \music >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Modifying the Ottava spanner slope
It is possible to change the slope of the Ottava spanner.
\relative c'' { \override Staff.OttavaBracket.stencil = #ly:line-spanner::print \override Staff.OttavaBracket.bound-details = #`((left . ((Y . 0) (attach-dir . ,LEFT) (padding . 0) (stencil-align-dir-y . ,CENTER))) (right . ((Y . 5.0) ; Change the number here (padding . 0) (attach-dir . ,RIGHT) (text . ,(make-draw-dashed-line-markup (cons 0 -1.2)))))) \override Staff.OttavaBracket.left-bound-info = #ly:horizontal-line-spanner::calc-left-bound-info-and-text \override Staff.OttavaBracket.right-bound-info = #ly:horizontal-line-spanner::calc-right-bound-info \ottava #1 c1 c'''1 }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Niuat de grups de pentagrames
Es pot utilitzar la propietat
systemStartDelimiterHierarchy
per crear grups de
pentagrames niuats de forma més complexa. L’ordre
\set StaffGroup.systemStartDelimiterHierarchy
pren una
llista alfabètic del nombre de pentagrames produïts. Es pot
proporcionar abans de cada pentagrama un delimitador de
començament del sistema. Es pot envoltar entre corxets i admetre
tants pentagrames com envoltin els corxets. Es poden ometre els
elements de la llista, però el primer corxet sempre abasta tots
els pentagrames. Les possibilitat són SystemStartBar
,
SystemStartBracket
, SystemStartBrace
SystemStartSquare
.
\new StaffGroup \relative c'' << \override StaffGroup.SystemStartSquare.collapse-height = #4 \set StaffGroup.systemStartDelimiterHierarchy = #'(SystemStartSquare (SystemStartBrace (SystemStartBracket a (SystemStartSquare b) ) c ) d) \new Staff { c1 } \new Staff { c1 } \new Staff { c1 } \new Staff { c1 } \new Staff { c1 } >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Armadures de tonalitat no tradicional
La molt utilitzada ordre \key
estableix la propietat
keyAlterations
, dins del context Staff
.
Per crear armadures de tonalitat no estàndard, ajusteu aquesta propietat directament. El format d’aquesta ordre és una llista:
\set Staff.keyAlterations = #`(((octava . pas) . alteració)
on, per cada element dins de la llista octava
especifica
l’octava (sent zero l’octava des del Do central fins al
Si per sobre), pas
especifica la nota dins de l’octava
(zero significa Do i 6 significa Si), i
alteració
és ,SHARP ,FLAT ,DOUBLE-SHARP
etc. (observeu la coma precedent).
De forma alternativa, per a cada element de la llista l’ús del
format més concís (pas. alteració)
especifica que la
mateixa alteració ha d’estar en totes les octaves.
Vet aquí un exemple d’una possible armadura per generar una escala exàtona:
\include "arabic.ly" \relative do' { \set Staff.keyAlterations = #`((0 . ,SEMI-FLAT) (1 . ,SEMI-FLAT) (2 . ,FLAT) (5 . ,FLAT) (6 . ,SEMI-FLAT)) %\set Staff.extraNatural = ##f re reb \dwn reb resd dod dob dosd \dwn dob | dobsb dodsd do do | }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Numerar grups de compassos
Aquest fragment de codi mostra l’ús del gravador
Measure_counter_engraver
per numerar grups de compassos
successius. Es pot numerar qualsevol període de compassos tant
si té repeticions com si no.
S’ha d’afegir el gravador al context adequat. Aquí s’usa un
context Staff
; una altra possibilitat seria un context
Dynamics
.
El comptador s’inicia amb \startMeasureCount
i finalitza amb
\stopMeasureCount
. La numeració comença amb 1
, de
forma predeterminada, però es pot modificar aquest comportament
sobreescrivint la propietat count-from
.
Quan un compàs s’estén més enllà d’un salt de línia, el número apareix dues vegades, la segona vegada entre parèntesi.
\layout { \context { \Staff \consists #Measure_counter_engraver } } \new Staff { \startMeasureCount \repeat unfold 7 { c'4 d' e' f' } \stopMeasureCount \bar "||" g'4 f' e' d' \override Staff.MeasureCounter.count-from = #2 \startMeasureCount \repeat unfold 5 { g'4 f' e' d' } g'4 f' \bar "" \break e'4 d' \repeat unfold 7 { g'4 f' e' d' } \stopMeasureCount }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Plantilla d’orquestra amb cor i piano
Aquesta plantilla mostra l’ús de contextos StaffGroup
i
GrandStaff
niuats per sub-agrupar instruments del mateix
tipus, i una forma d’usar \transpose
de manera que unes
variables continguin la música per a instruments transpositors en
afinació de concert.
#(set-global-staff-size 17) \paper { indent = 3.0\cm % add space for instrumentName short-indent = 1.5\cm % add less space for shortInstrumentName } fluteMusic = \relative c' { \key g \major g'1 b } % Pitches as written on a manuscript for Clarinet in A % are transposed to concert pitch. clarinetMusic = \transpose c' a \relative c'' { \key bes \major bes1 d } trumpetMusic = \relative c { \key g \major g''1 b } % Key signature is often omitted for horns hornMusic = \transpose c' f \relative c { d'1 fis } percussionMusic = \relative c { \key g \major g1 b } sopranoMusic = \relative c'' { \key g \major g'1 b } sopranoLyrics = \lyricmode { Lyr -- ics } altoIMusic = \relative c' { \key g \major g'1 b } altoIIMusic = \relative c' { \key g \major g'1 b } altoILyrics = \sopranoLyrics altoIILyrics = \lyricmode { Ah -- ah } tenorMusic = \relative c' { \clef "treble_8" \key g \major g1 b } tenorLyrics = \sopranoLyrics pianoRHMusic = \relative c { \key g \major g''1 b } pianoLHMusic = \relative c { \clef bass \key g \major g1 b } violinIMusic = \relative c' { \key g \major g'1 b } violinIIMusic = \relative c' { \key g \major g'1 b } violaMusic = \relative c { \clef alto \key g \major g'1 b } celloMusic = \relative c { \clef bass \key g \major g1 b } bassMusic = \relative c { \clef "bass_8" \key g \major g,1 b } \score { << \new StaffGroup = "StaffGroup_woodwinds" << \new Staff = "Staff_flute" \with { instrumentName = "Flute" } \fluteMusic \new Staff = "Staff_clarinet" \with { instrumentName = \markup { \concat { "Clarinet in B" \flat } } } % Declare that written Middle C in the music % to follow sounds a concert B flat, for % output using sounded pitches such as MIDI. %\transposition bes % Print music for a B-flat clarinet \transpose bes c' \clarinetMusic >> \new StaffGroup = "StaffGroup_brass" << \new Staff = "Staff_hornI" \with { instrumentName = "Horn in F" } % \transposition f \transpose f c' \hornMusic \new Staff = "Staff_trumpet" \with { instrumentName = "Trumpet in C" } \trumpetMusic >> \new RhythmicStaff = "RhythmicStaff_percussion" \with { instrumentName = "Percussion" } << \percussionMusic >> \new PianoStaff \with { instrumentName = "Piano" } << \new Staff { \pianoRHMusic } \new Staff { \pianoLHMusic } >> \new ChoirStaff = "ChoirStaff_choir" << \new Staff = "Staff_soprano" \with { instrumentName = "Soprano" } \new Voice = "soprano" \sopranoMusic \new Lyrics \lyricsto "soprano" { \sopranoLyrics } \new GrandStaff = "GrandStaff_altos" \with { \accepts Lyrics } << \new Staff = "Staff_altoI" \with { instrumentName = "Alto I" } \new Voice = "altoI" \altoIMusic \new Lyrics \lyricsto "altoI" { \altoILyrics } \new Staff = "Staff_altoII" \with { instrumentName = "Alto II" } \new Voice = "altoII" \altoIIMusic \new Lyrics \lyricsto "altoII" { \altoIILyrics } >> \new Staff = "Staff_tenor" \with { instrumentName = "Tenor" } \new Voice = "tenor" \tenorMusic \new Lyrics \lyricsto "tenor" { \tenorLyrics } >> \new StaffGroup = "StaffGroup_strings" << \new GrandStaff = "GrandStaff_violins" << \new Staff = "Staff_violinI" \with { instrumentName = "Violin I" } \violinIMusic \new Staff = "Staff_violinII" \with { instrumentName = "Violin II" } \violinIIMusic >> \new Staff = "Staff_viola" \with { instrumentName = "Viola" } \violaMusic \new Staff = "Staff_cello" \with { instrumentName = "Cello" } \celloMusic \new Staff = "Staff_bass" \with { instrumentName = "Double Bass" } \bassMusic >> >> \layout { } }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Print ChordNames with same root and different bass as slash and bass-note
To print subsequent ChordNames
only differing in its bass note
as slash and bass note use the here defined engraver. The behaviour may
be controlled in detail by the chordChanges
context property.
#(define Bass_changes_equal_root_engraver (lambda (ctx) "For sequential @code{ChordNames} with same root, but different bass, the root markup is dropped: D D/C D/B -> D /C /B The behaviour may be controlled by setting the @code{chordChanges} context-property." (let ((chord-pitches '()) (last-chord-pitches '()) (bass-pitch #f)) (make-engraver ((initialize this-engraver) (let ((chord-note-namer (ly:context-property ctx 'chordNoteNamer))) ;; Set 'chordNoteNamer, respect user setting if already done (ly:context-set-property! ctx 'chordNoteNamer (if (procedure? chord-note-namer) chord-note-namer note-name->markup)))) (listeners ((note-event this-engraver event) (let* ((pitch (ly:event-property event 'pitch)) (pitch-name (ly:pitch-notename pitch)) (pitch-alt (ly:pitch-alteration pitch)) (bass (ly:event-property event 'bass #f)) (inversion (ly:event-property event 'inversion #f))) ;; Collect notes of the chord ;; - to compare inversed chords we need to collect the bass note ;; as usual member of the chord, whereas an added bass must be ;; treated separate from the usual chord-notes ;; - notes are stored as pairs containing their ;; pitch-name (an integer), i.e. disregarding their octave and ;; their alteration (cond (bass (set! bass-pitch pitch)) (inversion (set! bass-pitch pitch) (set! chord-pitches (cons (cons pitch-name pitch-alt) chord-pitches))) (else (set! chord-pitches (cons (cons pitch-name pitch-alt) chord-pitches))))))) (acknowledgers ((chord-name-interface this-engraver grob source-engraver) (let ((chord-changes (ly:context-property ctx 'chordChanges #f))) ;; If subsequent chords are equal apart from their bass, ;; reset the 'text-property. ;; Equality is done by comparing the sorted lists of this chord's ;; elements and the previous chord. Sorting is needed because ;; inverted chords may have a different order of pitches. ;; `chord-changes' needs to be true (if (and bass-pitch chord-changes (equal? (sort chord-pitches car<) (sort last-chord-pitches car<))) (ly:grob-set-property! grob 'text (make-line-markup (list (ly:context-property ctx 'slashChordSeparator) ((ly:context-property ctx 'chordNoteNamer) bass-pitch (ly:context-property ctx 'chordNameLowercaseMinor)))))) (set! last-chord-pitches chord-pitches) (set! chord-pitches '()) (set! bass-pitch #f)))) ((finalize this-engraver) (set! last-chord-pitches '())))))) myChords = \chordmode { %\germanChords \set chordChanges = ##t d2:m d:m/cis d:m/c \set chordChanges = ##f d:m/b e1:7 \set chordChanges = ##t e \break \once \set chordChanges = ##f e1/f e2/gis e/+gis e e:m/f d:m d:m/cis d:m/c \set chordChanges = ##f d:m/b } << \new ChordNames \with { \consists #Bass_changes_equal_root_engraver } \myChords \new Staff \myChords >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Posar lletra dins del pentagrama
Es poden moure les línies de lletra verticalment per imprimir-les dins
del pentagrama. Les lletres es mouen amb \override
LyricText.extra-offset = #'(0 . dy)
i hi ha instruccions per
moure les línies d’extensió i els guions. El desplaçament necessari
s’estableix mitjançant un procés d’assaig i error.
<< \new Staff << \new Voice = "voc" \relative c' { \stemDown a bes c8 b c4 } >> \new Lyrics \with { \override LyricText.extra-offset = #'(0 . 8.6) \override LyricExtender.extra-offset = #'(0 . 8.6) \override LyricHyphen.extra-offset = #'(0 . 8.6) } \lyricsto "voc" { La la -- la __ _ la } >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Citació d’una altra veu
La propietat quotedEventTypes
determina els tipus
d’esdeveniments musicals que resulten citats. El valor predeterminat
és (note-event rest-event tie-event beam-event
tuplet-span-event)
, que significa que sols apareixen en l’expressió
\quoteDuring
les notes, silencis, lligadures, barres i grups
especials. A l’exemple següent, el silenci de semicorxera no apareix
en el fragment citat perquè rest-event
no està dins
quotedEventTypes
.
Per veure una llista dels tipus d’esdeveniment, consulteu la secció “Music classes” de la Referència de funcionament intern.
quoteMe = \relative c' { fis4 r16 a8.-> b4\ff c } \addQuote quoteMe \quoteMe original = \relative c'' { c8 d s2 \once \override NoteColumn.ignore-collision = ##t es8 gis8 } << \new Staff \with { instrumentName = "quoteMe" } \quoteMe \new Staff \with { instrumentName = "orig" } \original \new Staff \with { instrumentName = "orig+quote" quotedEventTypes = #'(note-event articulation-event) } \relative c'' << \original \new Voice { s4 \set fontSize = #-4 \override Stem.length-fraction = #(magstep -4) \quoteDuring "quoteMe" { \skip 2. } } >> >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Citació d’una altra veu amb transposició
Els passatges citats tenen en compte la trasnposició de la font tant
com la del destí. En aquest exemple, tots els instruments interpreten
una nota amb el so de Do central; el destí d’un instrument
transpositor en Fa. La part de destí es pot transportar utilitzant
\transpose
. En aquest cas les notes citades romanen sense
canvis.
\addQuote clarinet { \transposition bes \repeat unfold 8 { d'16 d' d'8 } } \addQuote sax { \transposition es' \repeat unfold 16 { a8 } } quoteTest = { % french horn \transposition f g'4 << \quoteDuring "clarinet" { \skip 4 } s4^"clar." >> << \quoteDuring "sax" { \skip 4 } s4^"sax." >> g'4 } { \new Staff \with { instrumentName = \markup { \column { Horn "in F" } } } \quoteTest \transpose c' d' << \quoteTest s4_"up a tone" >> }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Removing brace on first line of piano score
This snippet removes the first brace from a PianoStaff
or a
GrandStaff
.
It may be useful when cutting and pasting the engraved image into existing music.
It uses \alterBroken
.
someMusic = { \once \override Staff.Clef.stencil = ##f \once \override Staff.TimeSignature.stencil = ##f \repeat unfold 3 c1 \break \repeat unfold 5 c1 \break \repeat unfold 5 c1 } \score { \new PianoStaff << \new Staff = "right" \relative c'' \someMusic \new Staff = "left" \relative c' { \clef F \someMusic } >> \layout { indent=75 \context { \PianoStaff \alterBroken transparent #'(#t) SystemStartBrace } } }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Supressió de la primera línia buida
El primer pentagrama buit també es pot suprimir de la partitura
establint la propietat remove-first
de
VerticalAxisGroup
. Això es pot fer globalment dins del bloc
\layout
, o localment dins del pentagrama concret que es vol
suprimir. En aquest últim cas, hem d’especificar el contex
(Staff
s’aplica sols al pentagrama actual) davant de la
propietat.
El pentagrama inferior del segon grup no s’elimina, perquè l’ajustament sols s’aplica al pentagraa concret dins del que s’escriu.
\layout { \context { \Staff \RemoveEmptyStaves % To use the setting globally, uncomment the following line: % \override VerticalAxisGroup.remove-first = ##t } } \new StaffGroup << \new Staff \relative c' { e4 f g a \break c1 } \new Staff { % To use the setting globally, comment this line, % uncomment the line in the \layout block above \override Staff.VerticalAxisGroup.remove-first = ##t R1 \break R } >> \new StaffGroup << \new Staff \relative c' { e4 f g a \break c1 } \new Staff { R1 \break R } >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Fixació d’un separador entre els sistemes
Es poden inserir separadors de sistema entre els sistemes d’una pàgina.
Es pot usar qualsevol element de marcatge, però hi ha
\slashSeparator
com una elecció predeterminada adequada.
\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 >> } }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Barres de compàs en forma de ratlla curta
Freqüentment, s’usen barres de compàs en forma de ’tick’ o ratlla curta on la línia divisòria s’emplea sols a efectes de coordinació i no es vol impliar amb ella cap èmfasi ritmic.
\relative c' { \set Score.measureBarType = #"'" c4 d e f g4 f e d c4 d e f g4 f e d \bar "|." }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Compàs entre parèntesis
La indicació de compàs pot envoltar-se entre parèntesi.
\relative c'' { \override Staff.TimeSignature.stencil = #(lambda (grob) (bracketify-stencil (ly:time-signature::print grob) Y 0.1 0.2 0.1)) \time 2/4 a4 b8 c }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Indicació de compàs entre parèntesis: mètode número 3
Una altra forma de posar la indicació de comàs entre parèntesis.
\relative c'' { \override Staff.TimeSignature.stencil = #(lambda (grob) (parenthesize-stencil (ly:time-signature::print grob) 0.1 0.4 0.4 0.1 )) \time 2/4 a4 b8 c }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Ajustament de les propietats de clau
La modificació del glif de la clau, la seva posició o octava, no
canvien ’per se’ la posició de les notes següents del
pentagrama. Per aconseguir armadures adequades de tonalitat sobre
les línies del pentagrama, s’ha d’especificar també
middleCClefPosition
, amb valor positius o negatius que
moguin Do central
cap amunt o cap avall, respectivament, en
relació amb la línia central del pentagrama (usualment la
tercera).
Per exemple, l’ordre \clef "treble_8"
equival a un
ajustament de clefGlyph
, clefPosition
(que controla
la posició vertical de la clau sobre el pentagrama),
middleCPosition
i clefTransposition
. Se imprimeix
la clau cada cop que es modifica qualsevol de les propietats
excepte middleCPosition
.
Els exemple següents mostren les possibilitats quan s’ajusten aquestes propietats manualment. En la primera línia, els canvis manuals preserven la posició relativa estàndard de les clau i les notes, però no ho fan a la segona línia.
{ % The default treble clef \key f \major c'1 % The standard bass clef \set Staff.clefGlyph = #"clefs.F" \set Staff.clefPosition = #2 \set Staff.middleCPosition = #6 \set Staff.middleCClefPosition = #6 \key g \major c'1 % The baritone clef \set Staff.clefGlyph = #"clefs.C" \set Staff.clefPosition = #4 \set Staff.middleCPosition = #4 \set Staff.middleCClefPosition = #4 \key f \major c'1 % The standard choral tenor clef \set Staff.clefGlyph = #"clefs.G" \set Staff.clefPosition = #-2 \set Staff.clefTransposition = #-7 \set Staff.middleCPosition = #1 \set Staff.middleCClefPosition = #1 \key f \major c'1 % A non-standard clef \set Staff.clefPosition = #0 \set Staff.clefTransposition = #0 \set Staff.middleCPosition = #-4 \set Staff.middleCClefPosition = #-4 \key g \major c'1 \break % The following clef changes do not preserve % the normal relationship between notes, key signatures % and clefs: \set Staff.clefGlyph = #"clefs.F" \set Staff.clefPosition = #2 c'1 \set Staff.clefGlyph = #"clefs.G" c'1 \set Staff.clefGlyph = #"clefs.C" c'1 \set Staff.clefTransposition = #7 c'1 \set Staff.clefTransposition = #0 \set Staff.clefPosition = #0 c'1 % Return to the normal clef: \set Staff.middleCPosition = #0 c'1 }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Two \partCombine pairs on one staff
The \partCombine
function takes two music expressions each
containing a part, and distributes them among four Voice
s named
“two”, “one”, “solo”, and “chords” depending on when and how
the parts are merged into a common voice. The voices output from
\partCombine
can have their layout properties adjusted in the
usual way. Here we define extensions of \partCombine
to make
it easier to put four voices on a staff.
soprano = { d'4 | cis' b e' d'8 cis' | cis'2 b } alto = { fis4 | e8 fis gis ais b4 b | b ais fis2 } tenor = { a8 b | cis' dis' e'4 b8 cis' d'4 | gis cis' dis'2 } bass = { fis8 gis | a4 gis g fis | eis fis b,2 } \new Staff << \key b\minor \clef alto \partial 4 \transpose b b' \partCombineUp \soprano \alto \partCombineDown \tenor \bass >>
\layout { \context { \Staff \accepts "VoiceBox" } \context { \name "VoiceBox" \type "Engraver_group" \defaultchild "Voice" \accepts "Voice" \accepts "NullVoice" } } customPartCombineUp = #(define-music-function (partOne partTwo) (ly:music? ly:music?) "Take the music in @var{partOne} and @var{partTwo} and return a @code{VoiceBox} named @q{Up} containing @code{Voice}s that contain @var{partOne} and @var{partTwo} merged into one voice where feasible. This variant sets the default voicing in the output to use upward stems." #{ \new VoiceBox = "Up" << \context Voice = "one" { \voiceOne } \context Voice = "two" { \voiceThree } \context Voice = "shared" { \voiceOne } \context Voice = "solo" { \voiceOne } \context NullVoice = "null" {} \partCombine #partOne #partTwo >> #}) customPartCombineDown = # (define-music-function (partOne partTwo) (ly:music? ly:music?) "Take the music in @var{partOne} and @var{partTwo} and return a @code{VoiceBox} named @q{Down} containing @code{Voice}s that contain @var{partOne} and @var{partTwo} merged into one voice where feasible. This variant sets the default voicing in the output to use downward stems." #{ \new VoiceBox = "Down" << \set VoiceBox.soloText = #"Solo III" \set VoiceBox.soloIIText = #"Solo IV" \context Voice ="one" { \voiceFour } \context Voice ="two" { \voiceTwo } \context Voice ="shared" { \voiceFour } \context Voice ="solo" { \voiceFour } \context NullVoice = "null" {} \partCombine #partOne #partTwo >> #}) soprano = { d'4 | cis' b e' d'8 cis' | cis'2 b } alto = { fis4 | e8 fis gis ais b4 b | b ais fis2 } tenor = { a8 b | cis' dis' e'4 b8 cis' d'4 | gis cis' dis'2 } bass = { fis8 gis | a4 gis g fis | eis fis b,2 } \new Staff << \key b\minor \clef alto \partial 4 \transpose b b' \customPartCombineUp \soprano \alto \customPartCombineDown \tenor \bass >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Us del corxet recte al començament d’un grup de pentagrames
Es pot usar el delimitador de començament d’un sistema
SystemStartSquare
establint-lo explícitament dins d’un
context StaffGroup
o ChoirStaffGroup
.
\score { \new StaffGroup { << \set StaffGroup.systemStartDelimiter = #'SystemStartSquare \new Staff { c'4 d' e' f' } \new Staff { c'4 d' e' f' } >> } }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Usar canvi automàtic de pentagrama amb més d’una veu
Utilització de autochange
amb més d’una veu.
\score { \new PianoStaff << \new Staff = "up" { << \set Timing.beamExceptions = #'() \set Timing.beatStructure = #'(4) \new Voice { \voiceOne \autoChange \relative c' { g8 a b c d e f g g,8 a b c d e f g } } \new Voice { \voiceTwo \autoChange \relative c' { g8 a b c d e f g g,,8 a b c d e f g } } >> } \new Staff = "down" { \clef bass } >> }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Using marklines in a Frenched score
Using MarkLine
contexts (such as in
LSR1010) in a Frenched
score can be problematic if all the staves between two MarkLine
s
are removed in one system. The Keep_alive_together_engraver
can
be used within each StaffGroup
to keep the MarkLine
alive
only as long as the other staves in the group stay alive.
bars = { \tempo "Allegro" 4=120 s1*2 \repeat unfold 5 { \mark \default s1*2 } \bar "||" \tempo "Adagio" 4=40 s1*2 \repeat unfold 8 { \mark \default s1*2 } \bar "|." } winds = \repeat unfold 120 { c''4 } trumpet = { \repeat unfold 8 g'2 R1*16 \repeat unfold 4 g'2 R1*8 } trombone = { \repeat unfold 4 c'1 R1*8 d'1 R1*17 } strings = \repeat unfold 240 { c''8 } #(set-global-staff-size 16) \paper { systems-per-page = 5 ragged-last-bottom = ##f } \layout { indent = 15\mm short-indent = 5\mm \context { \name MarkLine \type Engraver_group \consists Output_property_engraver \consists Axis_group_engraver \consists Mark_engraver \consists Metronome_mark_engraver \consists Staff_collecting_engraver \override VerticalAxisGroup.remove-empty = ##t \override VerticalAxisGroup.remove-layer = #'any \override VerticalAxisGroup.staff-affinity = #DOWN \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = 1 keepAliveInterfaces = #'() } \context { \Staff \override VerticalAxisGroup.remove-empty = ##t \override VerticalAxisGroup.remove-layer = ##f } \context { \StaffGroup \accepts MarkLine \consists Keep_alive_together_engraver } \context { \Score \remove Mark_engraver \remove Metronome_mark_engraver \remove Staff_collecting_engraver } } \score { << \new StaffGroup = "winds" \with { instrumentName = "Winds" shortInstrumentName = "Winds" } << \new MarkLine \bars \new Staff \winds >> \new StaffGroup = "brass" << \new MarkLine \bars \new Staff = "trumpet" \with { instrumentName = "Trumpet" shortInstrumentName = "Tpt" } \trumpet \new Staff = "trombone" \with { instrumentName = "Trombone" shortInstrumentName = "Tbn" } \trombone >> \new StaffGroup = "strings" \with { instrumentName = "Strings" shortInstrumentName = "Strings" } << \new MarkLine \bars \new Staff = "strings" { \strings } >> >> }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Grups de pentagrames alineats verticalment sense una barra SystemStartBar que els interconnecti
Aquest fragment de codi mostra com obtenir grups de pentagrames StaffGroups alineats verticalment amb una barra d’inici de sistema SystemStartBar per cada StaffGroup, però sense connectar-los entre sí.
#(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 } } }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ > ] |
Corxets de primera i segona vegada a sota dels acords
Mitjançant l’addició del gravador Volta_engraver
al pentagrama
pertinent, es poden posar els corxets de primera i segona veu a
sota dels acords.
\score { << \chords { c1 c1 } \new Staff \with { \consists "Volta_engraver" } { \repeat volta 2 { c'1 } \alternative { c' } } >> \layout { \context { \Score \remove "Volta_engraver" } } }
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ Editorial annotations > ] |
Caselles de repetició de diversos pentagrames
Mitjançant l’addició del gravador Volta_engraver
al pentagrama
adequat, les caselles de primera i segona vegada es poden posar sobre
algun pentagrama diferent al més alt de la partitura.
voltaMusic = \relative c'' { \repeat volta 2 { c1 } \alternative { d1 e1 } } << \new StaffGroup << \new Staff \voltaMusic \new Staff \voltaMusic >> \new StaffGroup << \new Staff \with { \consists "Volta_engraver" } \voltaMusic \new Staff \voltaMusic >> >>
[ << Staff notation ] | [Part superior][Continguts] | [ Editorial annotations >> ] |
[ < ] | [ Amunt : Staff notation ] | [ Editorial annotations > ] |