lilypond-user
[Top][All Lists]
Advanced

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

Re: Vertical alignment of text added to notes.


From: Pierre Perol-Schneider
Subject: Re: Vertical alignment of text added to notes.
Date: Wed, 21 Jan 2015 10:03:14 +0100

And how about:

\version "2.18.2"

\paper {
  indent = 0
}

%% Note names choice:
myNNames =
#`(("ces" . ,(markup #:concat(#:hspace -1 #:simple "C" #:hspace 0.1 #:raise 0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("c" . "C ")
   ("cis" . ,(markup #:concat(#:hspace -1 #:simple "C" #:hspace 0.1 #:raise 0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("des" . ,(markup #:concat(#:hspace -1 #:simple "D" #:hspace 0.1 #:raise 0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("d" . "D ")
   ("dis" . ,(markup #:concat(#:hspace -1 #:simple "D" #:hspace 0.1 #:raise 0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("ees" . ,(markup #:concat(#:hspace -1 #:simple "E" #:hspace 0.1 #:raise 0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("e" . "E ")
   ("eis" . ,(markup #:concat(#:hspace -1 #:simple "E" #:hspace 0.1 #:raise 0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("fes" . ,(markup #:concat(#:hspace -1 #:simple "F" #:hspace 0.1 #:raise 0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("f" . "F ")
   ("fis" . ,(markup #:concat(#:hspace -1 #:simple "F" #:hspace 0.1 #:raise 0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("ges" . ,(markup #:concat(#:hspace -1 #:simple "G" #:hspace 0.1 #:raise 0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("g" . "G ")
   ("gis" . ,(markup #:concat(#:hspace -1 #:simple "G" #:hspace 0.1 #:raise 0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("aes" . ,(markup #:concat(#:hspace -1 #:simple "A" #:hspace 0.1 #:raise 0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("a" . "A ")
   ("ais" . ,(markup #:concat(#:hspace -1 #:simple "A" #:hspace 0.1 #:raise 0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("bes" . ,(markup #:concat(#:hspace -1 #:simple "B" #:hspace 0.1 #:raise 0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("b" . "B ")
   ("bis" . ,(markup #:concat(#:hspace -1 #:simple "B" #:hspace 0.1 #:raise 0.7 (#:tiny (#:sharp)) #:hspace 0.5))))

%% NoteNames stencil:
myNoteNames =
#(lambda (grob)
   (let* ((default-name (ly:grob-property grob 'text))
          (new-name (assoc-get default-name myNNames)))
         (ly:grob-set-property! grob 'text new-name)
   (ly:text-interface::print grob)))

%%% EXAMPLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

myNotes = { c ces cis d des dis e es eis f fes fis }

myPhrase = \relative c' { \myNotes \transpose c g' \myNotes }

\new Staff = "MyStaff" <<
  \context NoteNames \with {
    \override NoteName.stencil = #myNoteNames
     alignAboveContext = #"MyStaff"
  } { \myPhrase }
  \cadenzaOn \myPhrase
>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Cheers,
Pierre

2015-01-21 0:05 GMT+01:00 MarcM <address@hidden>:

I find it easier to use lyrics.

http://lilybin.com/to3r9r/5

musicOne = \relative c' {
  d e f g a b c
}
verseOne = \lyricmode {
  d e f g a b c
}
\score {
  <<
    \new Voice = "one" {
      \time 2/4
      \musicOne
    }
    \new Lyrics \lyricsto "one" {
      \verseOne
    }
  >>
}



--
View this message in context: http://lilypond.1069038.n5.nabble.com/Vertical-alignment-of-text-added-to-notes-tp170221p170815.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


reply via email to

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