lilypond-user
[Top][All Lists]
Advanced

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

Re: named strings in TABs


From: Thomas Morley
Subject: Re: named strings in TABs
Date: Sun, 5 Jan 2020 13:01:07 +0100

Am So., 5. Jan. 2020 um 12:23 Uhr schrieb Malte Meyn <address@hidden>:
>
>
>
> Am 05.01.20 um 10:55 schrieb bb:
> > I named the strings in my TABs successfully as long as I use natural
> > note names. If I use flats and sharps I get an error. How do I gat flats
> > and sharps?
>
> How did you input the sharps? #, ♯, or \sharp? The character # is
> special in LilyPond, you’d have to enclose the note name in quotes "f#".
> But I’d recommend true sharp symbols using \sharp:
>
> \markup \center-column {
>    \concat { f \hspace #0.5 \raise #0.6 \sharp  }
>    \concat { c \hspace #0.2 \raise #0.6 \sharp  }
> }
>
>

Below a generic suggestion:

#(define-markup-command (note-name layout props p)(ly:pitch?)
#:properties ((lowercase #f)
              (proc note-name->markup))
"Prints the given pitch as markup.  The pitch should usually entered like, p.e.
@code{##{ fis #}}.
Default procedure to print the markup is @code{note-name->markup}. Other
possibilities are:
@code{(chord-name->german-markup #f)}
@code{(chord-name->german-markup #t)}
@code{note-name->german-markup}
@code{(chord-name->italian-markup #f)}
@code{(chord-name->italian-markup #t)}"
  (interpret-markup layout props
    (make-override-markup '(word-space . 0) (proc p lowercase))))

%% Example

\markup \note-name ##{ cis #}

%% Table of possible examples

names =
\markup
  \column {
        \line { \note-name ##{ b #} \note-name ##{ bes #} \note-name
##{ dis #} }
        \override #`(proc . ,(chord-name->german-markup #f))
        \line { \note-name ##{ b #} \note-name ##{ bes #} \note-name
##{ dis #} }
        \override #`(proc . ,(chord-name->german-markup #t))
        \line { \note-name ##{ b #} \note-name ##{ bes #} \note-name
##{ dis #} }
        \override #`(proc . ,note-name->german-markup)
        \line { \note-name ##{ b #} \note-name ##{ bes #} \note-name
##{ dis #} }
        \override #`(proc . ,(chord-name->italian-markup #f))
        \line { \note-name ##{ b #} \note-name ##{ bes #} \note-name
##{ dis #} }
        \override #`(proc . ,(chord-name->italian-markup #t))
        \line { \note-name ##{ b #} \note-name ##{ bes #} \note-name
##{ dis #} }
  }

\markup
 \column {
   \pad-around #2
   "Current defaults, note: using note-name->german-markup is always lowercase"
   \names
   \pad-around #2
   "Applying \\override #'(lowercase . #t)"
   \override #'(lowercase . #t)
   \names
 }

Cheers,
  Harm



reply via email to

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