%% DO NOT EDIT this file manually; it was automatically
%% generated from the LilyPond Wiki
%% (https://wiki.lilypond.community).
%%
%% Make any changes in the Wiki itself, or in
%% `Documentation/snippets/new/`, then run
%% `scripts/auxiliar/makelsr.pl`.
%%
%% This file is in the public domain.

\version "2.24.0"

\header {
  categories = "Tweaks and overrides"

  texidoc = "
The @code{NoteNames} context can be used to print the text value of
notes. The @code{printOctaveNames} property turns on or off the
representation of the octave of the note.
"

  doctitle = "Printing note names with and without an octave marker"
} % begin verbatim


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
    }
  >>
}

\layout {
  \context {
    \NoteNames
    % Allow vertical overlapping of different `NoteNames` contexts
    % to make them appear as if they were a single line.
    \override VerticalAxisGroup
              .nonstaff-nonstaff-spacing
              .minimum-distance = ##f
  }
}
