\version "2.19.49" %% creates a StringNumber-grob, which then prints info about context/voiceXxx annotateVoiceInfo = #(lambda (ctx) (make-engraver (acknowledgers ((note-column-interface engraver grob source-engraver) (let ((nhds (ly:grob-array->list (ly:grob-object grob 'note-heads))) (stem (ly:grob-object grob 'stem)) (stem-dir-shift-list ;; obviously incomplete.. '(((1 . 0) "One") ((-1 . 0) "Two") ((1 . 1) "Three") ((-1 . 1) "Four") ((1 . 2) "Five") ((-1 . 2) "Six") ((1 . 3) "Seven") ((-1 . 3) "Eight")))) (for-each (lambda (nh) (let ((new-grob (ly:engraver-make-grob engraver 'StringNumber '()))) (ly:grob-set-parent! new-grob Y nh) (ly:grob-set-property! new-grob 'side-axis Y) (ly:grob-set-property! new-grob 'direction UP) (ly:grob-set-property! new-grob 'X-offset 7) (ly:grob-set-property! new-grob 'stencil (grob-interpret-markup new-grob (markup #:fontsize -3 #:vcenter #:normal-text (format #f " This context has the id: \"~a\", with settings equal to: \\voice~a" (ly:context-id ctx) (car (assoc-get (cons (ly:grob-property stem 'direction) (ly:grob-property grob 'horizontal-shift)) stem-dir-shift-list '("-none" . ""))))))))) nhds)))))) \layout { \context { \Voice stringNumberOrientations = #'(right) \consists \annotateVoiceInfo } } %% needed for third example, see NR voiceFive = #(context-spec-music (make-voice-props-set 4) 'Voice) voiceSix = #(context-spec-music (make-voice-props-set 5) 'Voice) voiceSeven = #(context-spec-music (make-voice-props-set 6) 'Voice) { <>^"In the order the Docs advice, iiuc" << c'''2 \\ c' \\ g'' \\ e' \\ e'' \\ g' \\ c'' >> <>^"Ordered as descending pitches" << c'''2 \\ g'' \\ e'' \\ c'' \\ g' \\ e' \\ c' >> <>^"Ordered as descending pitches with custom voiceXxx-settings" << c'''2 \\ { \voiceThree g'' } \\ { \voiceFive e'' } \\ { \voiceSeven c'' } \\ { \voiceSix g' } \\ { \voiceFour e' } \\ { \voiceTwo c' } >> }