lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Chord names in a score


From: Malte Meyn
Subject: Re: Chord names in a score
Date: Sat, 20 Aug 2016 01:02:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0



Am 19.08.2016 um 23:32 schrieb Andy Deitrich:
It put the mandolin chords on a new, 3rd staff.  It probably has something
to do with defining "mando" as a staff. I don't know how else to get the
mandolin chords to appear above the staff.

Does this help explain?

Your code is far from minimal (and not working because guitarMusic isn’t defined and some curly braces are missing) but I was able to find your problem in this smaller (but also not minimal) example:

%%%%%%%% BEGIN EXAMPLE
\version "2.19.46"

mandoMusic = \relative c' {
  \new Staff = "mando"
  \time 6/8
  R2.
  \override NoteHead #'style = #'slash
  \repeat percent 6 {
    <<
      \chords \with {
        alignAboveContext = "mando"
      } { s4 c8 s4. }
      { r4\mp b'8 r4 b8 }
    >>
  }
}


\score {
  \new StaffGroup <<
    \new Staff {
      \mandoMusic
    }
  >>
}
%%%%%%%% END EXAMPLE

You define a (new) Staff which contains mandoMusic which contains a (new) Staff called “mando” which contains the \time 6/8 and nothing else. Inside of the (outer/upper) Staff a new ChordNames context is created that is aligned above the other (lower) Staff. So there’s just one unnecessary Staff.

Two possible solutions:
1. create only the outer staff, call it “mando”, and align the chords above this staff:

%%%%%%%% BEGIN FIRST SOLUTION
\version "2.19.46"

mandoMusic = \relative c' {
  \time 6/8
  R2.
  \override NoteHead #'style = #'slash
  \repeat percent 6 {
    <<
      \chords \with {
        alignAboveContext = "mando"
      } { s4 c8 s4. }
      { r4\mp b'8 r4 b8 }
    >>
  }
}

\score {
  \new StaffGroup <<
    \new Staff = "mando" \mandoMusic
  >>
}
%%%%%%%% END FIRST SOLUTION

2. separate ChordNames and Staff from each other; you won’t have any alignment issues:

%%%%%%%% BEGIN SECOND SOLUTION
\version "2.19.46"

mandoMusic = \relative c' {
  \time 6/8
  R2.
  \override NoteHead #'style = #'slash
  \repeat percent 6 {
    r4\mp b'8 r4 b8
  }
}

chordMusic = \chordmode {
  s2.
  s4 c8 s4.
}

\score {
  \new StaffGroup <<
    \new ChordNames \chordMusic
    \new Staff \mandoMusic
  >>
}
%%%%%%%% END SECOND SOLUTION

HTH
Malte



reply via email to

[Prev in Thread] Current Thread [Next in Thread]