lilypond-user
[Top][All Lists]
Advanced

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

Re: ChordNames on Staff


From: Thomas Morley
Subject: Re: ChordNames on Staff
Date: Fri, 8 Feb 2019 00:40:53 +0100

Am Do., 7. Feb. 2019 um 21:21 Uhr schrieb Robert Hennig <address@hidden>:
>
> Hi Valentin,
> thank you for sharing your lilypond wisdom.
> I have learned a lot already :).
> (\denies "Voice" had not removed the note heads)
>
> For my problem to switch from up and down setting the chord names
> I will stick to Arons solution in this fashion:
>
> chordsUp = { \override ChordName.extra-offset = #'(0 . 3) }
> chordsDown = { \override ChordName.extra-offset = #'(0 . -1) }
> <<
>    \new ChordNames \with {
>      \override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
>        #'((basic-distance . 0)(minimum-distance . 0)(padding . -10))
>      \chordsUp
>    }
>    \chordmode {
>      c1 | \chordsDown dis1:m |
>      ees1/g \chordsUp
>      f1
>    }
>    { s2-"Text" a' | s1^"Text" | e'''4 e'''4_"Text" c'2 | a'1}
>  >>
> Greetings and thank you a lot,
> Robert
>
> Am 07.02.2019 um 15:42 schrieb Valentin Villenave:
> > On 2/7/19, Robert Hennig <address@hidden> wrote:
> >> The second Solution from Valentin looks like what I would prefer but
> >> it prints the chord notes too, which is not was I'm looking for (only
> >> Chord Names).
> >
> > Huh. Have you added
> > \denies "Voice"
> > like I did? It should prevent any notes (or rests) from being printed.
> >
> > Alternatively, if you want to mix in musical symbols, you could do
> >
> > \new Staff \with {
> >    \consists Chord_name_engraver
> >    noChordSymbol = ""
> > } \new Voice \with {
> >    \remove Note_heads_engraver
> >    \remove Ledger_line_engraver
> >    \remove Stem_engraver
> >    \remove Dots_engraver
> >    \remove Accidental_engraver
> >    \remove Beam_engraver
> >    \remove Tie_engraver
> > } \chordmode {
> >    c1\f r4 d:m\p\< e:m \notemode {<>_>} f\!
> > }
> >
> > Cheers,
> > V.
> >
> > _______________________________________________
> > lilypond-user mailing list
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
> >
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

Here a different approach.

_If_ it works (and you really should test it, I did only the provided
examples) it looks much cleaner, imho.

\version "2.19.82"

gotoCtx =
#(define-music-function (strg)(string?)
#{
  \change Staff = #strg
  #(if (string=? strg "staff") ;; Staff needs to be named equal to this
       #{ \override ChordName.Y-offset = #-1 #}
       #{ \revert ChordName.Y-offset #})
#})

\score {
  \new StaffGroup
  <<
    \new ChordNames = "chrds-up"
      %% keep it alive!
      \chordmode { s1*8 }
    \new Staff = "staff" \with { \accepts ChordNames }
      <<
        \new ChordNames  \with { \override ChordName.Y-offset = #-1 }
          \chordmode {
            s1*0
            \gotoCtx "chrds-up"
            c1
            \gotoCtx "staff"
            dis:m
            ees/g
            \gotoCtx "chrds-up"
            f
            \gotoCtx "staff"
            gis:m
            \gotoCtx "chrds-down"
            e:7
            \gotoCtx "chrds-up"
            f
            \gotoCtx "chrds-down"
            f
          }
        { s2_"Text" a'2 s1^"Text" e'''4 e'''_"Text" c'2 a'1 s1 s s }

      >>
    \new ChordNames = "chrds-down"
      %% keep it alive!
      \chordmode { s1*8 }
  >>
}


Cheers,
  Harm



reply via email to

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