[ << Vocal music ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Vocal ensemble template ] | [ Up : Top ] | [ Adding a figured bass above or below the notes > ] |
Chords
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Chords ] | [ Up : Chords ] | [ Adding bar lines to ChordNames context > ] |
Adding a figured bass above or below the notes
When writing a figured bass, here’s a way to specify if you want your
figures to be placed above or below the bass notes, by defining the
BassFigureAlignmentPositioning #'direction
property (exclusively
in a Staff
context). Choices are #UP
(or #1
),
#CENTER
(or #0
) and #DOWN
(or #-1
).
As you can see here, this property can be changed as many times as you
wish. Use \once \override
if you don’t want the tweak to apply
to the whole score.
bass = { \clef bass g4 b, c d e d8 c d2 } continuo = \figuremode { <_>4 <6>8 \once \override Staff.BassFigureAlignmentPositioning #'direction = #CENTER <5/>8 <_>4 \override Staff.BassFigureAlignmentPositioning #'direction = #UP <_+>4 <6> \set Staff.useBassFigureExtenders = ##t \override Staff.BassFigureAlignmentPositioning #'direction = #DOWN <4>4. <4>8 <_+>4 } \score { << \new Staff = bassStaff \bass \context Staff = bassStaff \continuo >> }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Adding a figured bass above or below the notes ] | [ Up : Chords ] | [ > ] |
Adding bar lines to ChordNames context
To add bar line indications in the ChordNames
context, add the
Bar_engraver
.
\new ChordNames \with { \override BarLine #'bar-size = #4 \consists "Bar_engraver" } \chordmode { f1:maj7 f:7 bes:7 }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Adding bar lines to ChordNames context ] | [ Up : Chords ] | [ Bar chords notation for Guitar ( with Text Spanner) > ] |
Avoiding collisions with chord fingerings
Fingerings and string numbers applied to individual notes will automatically avoid beams and stems, but this is not true by default for fingerings and string numbers applied to the individual notes of chords. The following example shows how this default behavior can be overridden.
\relative c' { \set fingeringOrientations = #'(up) \set stringNumberOrientations = #'(up) \set strokeFingerOrientations = #'(up) % Default behavior r8 <f c'-5>8 <f c'\5>8 <f c'-\rightHandFinger #2 >8 % Corrected to avoid collisions r8 \override Fingering #'add-stem-support = ##t <f c'-5>8 \override StringNumber #'add-stem-support = ##t <f c'\5>8 \override StrokeFinger #'add-stem-support = ##t <f c'-\rightHandFinger #2 >8 }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < ] | [ Up : Chords ] | [ Changing chord separator > ] |
Bar chords notation for Guitar ( with Text Spanner)
Here is how to print bar chords, or half-bar chords (just uncomment the appropriate line for to select either one).
The syntax is \bbarre #'fret_number' { notes }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %%%%%%% Cut here ----- Start 'bbarred.ly' %% PostScript ------------------------------- pScript= \markup { \with-dimensions #'(0 . 0.8) #'(0 . 2.0) \postscript #" 0.15 setlinewidth /Times-Roman findfont 2.0 scalefont setfont (C)show %%change with B if you prefer %(B)show %%change with C if you prefer stroke 0.7 -0.5 moveto 0.7 1.7 lineto stroke" } %% Span ----------------------------------- %% Syntax: \bbarre #"text" { notes } - text = any number of box bbarre= #(define-music-function (barre location str music) (string? ly:music?) (let ((spanned-music (let ((first-element #f) (last-element #f) (first-found? #f)) (music-map (lambda (m) (if (eqv? (ly:music-property m 'name) 'EventChord) (begin (if (not first-found?) (begin (set! first-found? #t) (set! first-element m))) (set! last-element m))) m) music) (if first-found? (begin (set! (ly:music-property first-element 'elements) (cons (make-music 'TextSpanEvent 'span-direction -1) (ly:music-property first-element 'elements))) (set! (ly:music-property last-element 'elements) (cons (make-music 'TextSpanEvent 'span-direction 1) (ly:music-property last-element 'elements))))) music))) (make-music 'SequentialMusic 'origin location 'elements (list #{ \once \override TextSpanner #'font-size = #-2 \once \override TextSpanner #'font-shape = #'upright \once \override TextSpanner #'staff-padding = #3 \once \override TextSpanner #'style = #'line \once \override TextSpanner #'to-barline = ##f \once \override TextSpanner #'bound-details = #'((left (Y . 0) (padding . 0.25) (attach-dir . -2)) (right (Y . 0) (padding . 0.25) (attach-dir . 2))) \once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'( 0 . -.5) } \once \override TextSpanner #'bound-details #'left #'text = \markup { \pScript $str } %% uncomment this line for make full barred % \once \override TextSpanner #'bound-details #'left #'text = \markup { "B" $str } #} spanned-music)))) %% %%%%%%% Cut here ----- End 'bbarred.ly' %% Copy and change the last line for full barred. Rename in 'fbarred.ly' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Syntaxe: \bbarre #"text" { notes } - text = any number of box \relative c'{ \clef "G_8" \stemUp \bbarre #"III" { <f a'>16[ c' d c d8] } }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Bar chords notation for Guitar ( with Text Spanner) ] | [ Up : Chords ] | [ Changing the chord names to German or semi-German notation > ] |
Changing chord separator
The separator between different parts of a chord name can be set to any markup.
\chords { c:7sus4 \set chordNameSeparator = \markup { \typewriter | } c:7sus4 }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Changing chord separator ] | [ Up : Chords ] | [ Changing the positions of figured bass alterations > ] |
Changing the chord names to German or semi-German notation
The english naming of chords (default) can be changed to german
(\germanChords
replaces B and Bes with H and B) or semi-german
(\semiGermanChords
replaces B and Bes with H and Bb).
music = \chordmode { c1/c | cis/cis b1/b | bis/bis | bes/bes } %% The following is only here to print the names of the %% chords styles; it can be removed if you do not need to %% print them. \layout { \context { \ChordNames \consists "Instrument_name_engraver" } } << \new ChordNames { \set ChordNames.instrumentName = #"default" \music } \new ChordNames { \set ChordNames.instrumentName = #"german" \germanChords \music } \new ChordNames { \set ChordNames.instrumentName = #"semi-german" \semiGermanChords \music } \context Voice { \music } >>
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Changing the chord names to German or semi-German notation ] | [ Up : Chords ] | [ Chord name exceptions > ] |
Changing the positions of figured bass alterations
Accidentals and plus signs can appear before or after the numbers,
depending on the figuredBassAlterationDirection
and
figuredBassPlusDirection
properties.
\figures { <6\+> <5+> <6 4-> r \set figuredBassAlterationDirection = #RIGHT <6\+> <5+> <6 4-> r \set figuredBassPlusDirection = #RIGHT <6\+> <5+> <6 4-> r \set figuredBassAlterationDirection = #LEFT <6\+> <5+> <6 4-> r }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Changing the positions of figured bass alterations ] | [ Up : Chords ] | [ chord name major7 > ] |
Chord name exceptions
The property chordNameExceptions
can be used to store a list of
special notations for specific chords.
% modify maj9 and 6(add9) % Exception music is chords with markups chExceptionMusic = { <c e g b d'>1-\markup { \super "maj9" } <c e g a d'>1-\markup { \super "6(add9)" } } % Convert music to list and prepend to existing exceptions. chExceptions = #( append ( sequential-music-to-chord-exceptions chExceptionMusic #t) ignatzekExceptions) theMusic = \chordmode { g1:maj9 g1:6.9 \set chordNameExceptions = #chExceptions g1:maj9 g1:6.9 } \layout { ragged-right = ##t } << \context ChordNames \theMusic \context Voice \theMusic >>
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Chord name exceptions ] | [ Up : Chords ] | [ > ] |
chord name major7
The layout of the major 7 can be tuned with majorSevenSymbol
.
\chords { c:7+ \set majorSevenSymbol = \markup { j7 } c:7+ }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < chord name major7 ] | [ Up : Chords ] | [ > ] |
Clusters
Clusters are a device to denote that a complete range of notes is to be played.
fragment = \relative c' { c4 f <e d'>4 <g a>8 <e a> a4 c2 <d b>4 e2 c } << \new Staff \fragment \new Staff \makeClusters \fragment >>
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < ] | [ Up : Chords ] | [ > ] |
Controlling the placement of chord fingerings
The placement of fingering numbers can be controlled precisely. For fingering orientation to apply, you must use a chord construct <> even if it is a single note.
\relative c' { \set fingeringOrientations = #'(left) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(down) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(down right up) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(up) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(left) <c-1>2 \set fingeringOrientations = #'(down) <e-3>2 }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < ] | [ Up : Chords ] | [ Manually break figured bass extenders for only some numbers > ] |
Displaying complex chords
Here is a way to display a chord where the same note is played twice with different accidentals.
fixA = { \once \override Stem #'length = #9 } fixB = { \once \override NoteHead #'X-offset = #1.7 \once \override Stem #'rotation = #'(45 0 0) \once \override Stem #'extra-offset = #'(-0.2 . -0.2) \once \override Stem #'flag-style = #'no-flag \once \override Accidental #'extra-offset = #'(4 . 0) } \relative c' { << { \fixA <b d!>8 } \\ { \voiceThree \fixB dis } >> s }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < ] | [ Up : Chords ] | [ Showing chords at changes > ] |
Manually break figured bass extenders for only some numbers
Figured bass often uses extenders to indicate continuation of the corresponding step. However, in this case lilypond is in greedy-mode and uses extenders whenever possible. To break individual extenders, one can simply use a modifier \! to a number, which breaks any extender attributed to that number right before the number.
bassfigures = \figuremode { \set useBassFigureExtenders = ##t <6 4>4 <6 4\!> <6 4\!> <6 4\!> | <6\! 4\!> <6 4> <6 4\!> <6 4> } << \new Staff \relative c'' { c1 c1 } \new FiguredBass \bassfigures >>
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Manually break figured bass extenders for only some numbers ] | [ Up : Chords ] | [ Simple lead sheet > ] |
Showing chords at changes
Chord names can be displayed only at the start of lines and when the chord changes.
harmonies = \chordmode { c1:m c:m \break c:m c:m d } << \new ChordNames { \set chordChanges = ##t \harmonies } \new Staff { \relative c' { \harmonies } } >>
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Showing chords at changes ] | [ Up : Chords ] | [ > ] |
Simple lead sheet
When put together, chord names, a melody, and lyrics form a lead sheet:
<< \chords { c2 g:sus4 f e } \relative c'' { a4 e c8 e r4 b2 c4( d) } \addlyrics { One day this shall be free __ } >>
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Simple lead sheet ] | [ Up : Chords ] | [ > ] |
Single staff template with notes lyrics and chords
This template allows the preparation of a song with melody, words, and chords.
melody = \relative c' { \clef treble \key c \major \time 4/4 a4 b c d } text = \lyricmode { Aaa Bee Cee Dee } harmonies = \chordmode { a2 c } \score { << \new ChordNames { \set chordChanges = ##t \harmonies } \new Voice = "one" { \autoBeamOff \melody } \new Lyrics \lyricsto "one" \text >> \layout { } \midi { } }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < ] | [ Up : Chords ] | [ Single staff template with notes and chords > ] |
Single staff template with notes lyrics chords and frets
Here is a simple lead sheet template with melody, lyrics, chords and fret diagrams.
verseI = \lyricmode { \set stanza = #"1." This is the first verse } verseII = \lyricmode { \set stanza = #"2." This is the second verse. } theChords = \chordmode { % insert chords for chordnames and fretboards here c2 g4 c } staffMelody = \relative c' { \key c \major \clef treble % Type notes for melody here c4 d8 e f4 g \bar "|." } \score { << \context ChordNames { \theChords } \context FretBoards { \theChords } \new Staff { \context Voice = "voiceMelody" { \staffMelody } } \new Lyrics = "lyricsI" { \lyricsto "voiceMelody" \verseI } \new Lyrics = "lyricsII" { \lyricsto "voiceMelody" \verseII } >> \layout { } \midi { } }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < ] | [ Up : Chords ] | [ Vertically centering paired figured bass extenders > ] |
Single staff template with notes and chords
Want to prepare a lead sheet with a melody and chords? Look no further!
melody = \relative c' { \clef treble \key c \major \time 4/4 f4 e8[ c] d4 g a2 ~ a } harmonies = \chordmode { c4:m f:min7 g:maj c:aug d2:dim b:sus } \score { << \new ChordNames { \set chordChanges = ##t \harmonies } \new Staff \melody >> \layout{ } \midi { } }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Single staff template with notes and chords ] | [ Up : Chords ] | [ > ] |
Vertically centering paired figured bass extenders
Where figured bass extender lines are being used by setting
useBassFigureExtenders
to true, pairs of congruent figured bass
extender lines are vertically centered if
figuredBassCenterContinuations
is set to true.
<< \relative c' { c8 c b b a a c16 c b b c8 c b b a a c16 c b b c8 c b b a a c c b b } \figures { \set useBassFigureExtenders = ##t <6+ 4 3>4 <6 4 3>8 r <6+ 4 3>4 <6 4 3>8 <4 3+>16 r \set figuredBassCenterContinuations = ##t <6+ 4 3>4 <6 4 3>8 r <6+ 4 3>4 <6 4 3>8 <4 3+>16 r \set figuredBassCenterContinuations = ##f <6+ 4 3>4 <6 4 3>8 r <6+ 4 3>4 <6 4 3>8 <4 3+>8 } >>
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Vertically centering paired figured bass extenders ] | [ Up : Chords ] | [ Keyboards > ] |
Volta below chords
By adding the Volta_engraver
to the relevant staff, volte can be
put under chords.
\score { << \chords { c1 c1 } \new Staff \with { \consists "Volta_engraver" } { \repeat volta 2 { c'1 } \alternative { c' } } >> \layout { \context { \Score \remove "Volta_engraver" } } }
[ << Chords ] | [Top][Contents][Index][ ? ] | [ Keyboards >> ] | ||
[ < Vertically centering paired figured bass extenders ] | [ Up : Chords ] | [ Keyboards > ] |