0

I am trying to annotate each note using tonic pitch names, so that it will be easier to sing these notes.

Lilypond has this very nice feature \easyHeadsOn:

https://lilypond.org/doc/v2.21/Documentation/notation/note-heads

I increased the staff size using

\relative c' {
  \easyHeadsOn  % show numbered music notation (Galin-Paris-Chevé system) in the note heads
  \magnifyStaff #(magstep 1.2)
  \key g \major
  \numericTimeSignature
  \time 4/4
  ...
}

Currently the rendering looks like this:

enter image description here

I'm happy with the size of the note head, but the numbers therein are not easy to read. I'd like the increase the font size and make the font bold inside the note head. But do not want to increase the global font size, since I want to keep all other fingering symbols in the sheet look normal, not too big.

Any help will be highly appreciated!

1 Answer 1

2

As the docs say this is only really usable with really large staff sizes. This font size of the text is linked to the font size of the note head, so increasing the size of the heads also increases the size of the numbers. Also the numbers are in fact already boldface.

It would not be very hard to rewrite this function to use bigger letters, but the problem kind of lies in the design. You will probably not be very happy trying to get this into a readable form. Rather I’d suggest to do things differently like this one:

$(define notenames
   #("C" "D" "E" "F" "G" "A" "B"))

#(define (notename_annotation_engraver context)
   (make-engraver
    (acknowledgers
     ((note-head-interface engraver grob source-engraver)
      (let* ((cause (ly:grob-property grob 'cause))
             (pitch (ly:event-property cause 'pitch))
             (nn (ly:pitch-notename pitch))
             (mup (vector-ref notenames nn))
             (tgrob (ly:engraver-make-grob engraver 'TextScript cause)))
        (ly:grob-set-property! tgrob 'text mup)
        (ly:grob-set-parent! tgrob Y grob)
        (ly:grob-set-property! tgrob 'whiteout 1)
        (ly:grob-set-property! tgrob 'Y-offset 0.7)
        (ly:grob-set-property! tgrob 'parent-alignment-X -0.4)
        (ly:grob-set-property! tgrob 'self-alignment-X CENTER)
        (ly:grob-set-property! tgrob 'parent-alignment-Y CENTER)
        (ly:grob-set-property! tgrob 'self-alignment-X CENTER)
        (ly:grob-set-property! tgrob 'font-size -2)
        (ly:grob-set-property! tgrob 'outside-staff-priority '()))))))

\layout {
  \context {
    \Voice
    \consists #notename_annotation_engraver
  }
}

\relative c' {
  \key g \major
  \numericTimeSignature
  \time 4/4
  c d e fis g a b c
}

UPDATE: Similarly you can have the names go up or down like this

$(define notenames
   #("C" "D" "E" "F" "G" "A" "B"))

#(define (notename_annotation_engraver context)
   (make-engraver
    (acknowledgers
     ((note-head-interface engraver grob source-engraver)
      (let* ((cause (ly:grob-property grob 'cause))
             (pitch (ly:event-property cause 'pitch))
             (nn (ly:pitch-notename pitch))
             (mup (vector-ref notenames nn))
             (tgrob (ly:engraver-make-grob engraver 'TextScript cause)))
        (ly:grob-set-property! tgrob 'text mup)
        (ly:grob-set-property! tgrob 'direction UP)
        (ly:grob-set-property! tgrob 'font-size -2)
        (ly:grob-set-property! tgrob 'staff-padding 3)
        (ly:grob-set-property! tgrob 'outside-staff-priority 10)
        )))))

\layout {
  \context {
    \Voice
    \consists #notename_annotation_engraver
  }
}

\relative c' {
  \key g \major
  \numericTimeSignature
  \time 4/4
  \tempo "a tempo"
  b4-1--\mp^\markup\box"*---" d8.-3( e16-1) g8.-3( a16-4) e16-2( g-4 d8-1) |
}

or maybe you might want to use something like this:

$(define notenames
   #("C" "D" "E" "F" "G" "A" "B"))

#(define (note-head::note-name-stencil grob)
   (let* ((cause (ly:grob-property grob 'cause))
          (pitch (ly:event-property cause 'pitch))
          (nn (ly:pitch-notename pitch))
          (durlog (ly:duration-log (ly:event-property cause 'duration)))
          (mupt (markup #:whiteout #:fontsize -3 #:bold
                       #:sans (vector-ref notenames nn)))
          (mup (if (< durlog 0)
                   (markup #:box mupt)
                   (if (>= durlog 2)
                       mupt
                       (markup #:circle mupt))))
          (stc (grob-interpret-markup grob mup)))
     (ly:stencil-aligned-to stc Y CENTER)))

\layout {
  \context {
    \Voice
    \override NoteHead.stencil = #note-head::note-name-stencil
  }
}

\relative c' {
  \key g \major
  \numericTimeSignature
  \time 4/4
  \tempo "a tempo"
  b4-1--\mp^\markup\box"*---" d8.-3( e16-1) g8.-3( a16-4) e16-2( g-4 d8-1) |
  c16 d e fis g8 a b c d4 | e2 f | g1 | a\breve
}
3
  • Now this is hardcore Lisp....my respect! I tested it in my code. However, the note I am engraving will have a lot of fingering symbols around the note heads, your solution is a good idea, but I cannot really apply it. Mar 20 at 0:38
  • @NicoleNaumann Nothing hardcore, Lisp is just hard to parse visually. I’ve added a few more suggestions. Note that the last one does not yet handle note values longer than breve (longa, maxima) properly.
    – Lazy
    Mar 20 at 12:22
  • Thank you very much Lazy! Mar 25 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.