diff --git a/lily/note-name-engraver.cc b/lily/note-name-engraver.cc index 1e1e01a..95ffd14 100644 --- a/lily/note-name-engraver.cc +++ b/lily/note-name-engraver.cc @@ -9,6 +9,7 @@ #include "engraver.hh" #include "item.hh" #include "pitch.hh" +#include "duration.hh" #include "stream-event.hh" #include "translator.icc" @@ -46,6 +47,11 @@ Note_name_engraver::process_music () p = Pitch (-1, p.get_notename (), p.get_alteration ()); s += p.to_string (); + if (to_boolean (get_property ("printDurations"))) + { + Duration *d = unsmob_duration (events_[i]->get_property ("duration")); + s += d->to_string (); + } } if (s.length ()) { @@ -74,6 +80,7 @@ ADD_TRANSLATOR (Note_name_engraver, "NoteName ", /* read */ + "printDurations " "printOctaveNames ", /* write */ diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index 3b18e94..093b696 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -356,6 +356,7 @@ sustain pedals: @code{text}, @code{bracket} or @code{mixed} (both).") (pedalUnaCordaStyle ,symbol? "See @code{pedalSustainStyle}.") (predefinedDiagramTable ,hash-table? "The hash table of predefined fret diagrams to use in FretBoards.") + (printDurations ,boolean? "Print durations for the @code{NoteNames} context.") (printKeyCancellation ,boolean? "Print restoration alterations before a key signature change.") (printOctaveNames ,boolean? "Print octave marks for the