lilypond-user
[Top][All Lists]
Advanced

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

Re: Bass and chords


From: Thomas Morley
Subject: Re: Bass and chords
Date: Tue, 6 Nov 2012 23:33:50 +0100

2012/11/6 Eluze <address@hidden>:
> dak wrote
>>> Finally, if it would be possible to note "no chord" as a normal rest
>>> of the correct duration instead of N.C. it would be great.
>>
>> Maybe someone else can make a suggestion for this item?
>>
>> --
>> David Kastrup
>
> here is a suggestion:
>
> define a command for the rests like
>
> restFull = {
>   \once \set chordChanges = ##f
>   \once \set noChordSymbol = \markup { \musicglyph #"rests.1" }
>   r1
> }
> restHalf = {
>   \once \set chordChanges = ##f
>   \once \set noChordSymbol = \markup { \musicglyph #"rests.2" }
>   r2
> }
>
> % …
>
> and use them in a score:
>
> harmonies = \chordmode {
>   \restHalf \restHalf
>   c2:m c:m
>   \break
>   c1:m c:m d \restFull
> }
>
> to be sure use that /\once \set …/ works as expected you should use a recent
> version of LP.
>
> maybe even that somebody will take care of putting this in a function so
> that you can use it with normal code!
>
> Eluze
>
>
>
> --
> View this message in context: 
> http://lilypond.1069038.n5.nabble.com/Bass-and-chords-tp135858p135901.html
> Sent from the User mailing list archive at Nabble.com.
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

More automated:

\version "2.16.0"

chordNamesWithRestsLayout =
\with {
        noChordSymbol = #(make-simple-markup "")
        \consists "Rest_engraver"
        \consists "Multi_measure_rest_engraver"
        \override Rest #'font-size = #-4
        \override MultiMeasureRest #'font-size = #-4
        % No idea, why r1 needs to be special-cased:
        \override Rest #'after-line-breaking =
          #(lambda (grob)
            (let* ((dur-log (ly:grob-property grob 'duration-log))
                   (staff-pos (if (= dur-log 0) 0 2)))
            (ly:grob-set-property! grob 'staff-position staff-pos)))
        \override MultiMeasureRest #'staff-position = #2

}

  <<
  \new ChordNames \with { \chordNamesWithRestsLayout }
  \chordmode { c1 R1 d e }
  \new Staff { c1 R1 d e }
  >>

\score {
  <<
    \new ChordNames
    \chordmode { c1 R1 d e }
    \new Staff { c1 R1 d e }
  >>
  \layout {
          \context {
                  \ChordNames
                  \chordNamesWithRestsLayout
          }
  }
}


HTH,
  Harm



reply via email to

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