Jump to content

Printing note names with and without an octave marker

From LilyPond wiki

The NoteNames context can be used to print the text value of notes. The printOctaveNames property turns on or off the representation of the octave of the note.

\version "2.24.0"

scale = \relative c' {
  a4 b c d
  e4 f g a
}

\new Staff {
  <<
    \scale
    \context NoteNames {
      \set printOctaveNames = ##f
      \scale
    }
  >>
  R1
  <<
    \scale
    \context NoteNames {
      \set printOctaveNames = ##t
      \scale
    }
  >>
}