\version "2.23.3" #(define-macro (prepend! element lst) `(set! ,lst (cons ,element ,lst))) #(set-object-property! 'allParts 'translation-type? list?) #(define (Log_parts_engraver context) (let ((id (ly:context-id context)) (score (ly:context-find context 'Score)) (notes-found '()) (time-step-events '())) (make-engraver (listeners ((note-event engraver event) (let* ((pitch (ly:event-property event 'pitch)) (duration (ly:event-property event 'duration)) (now (ly:context-now context)) (measure-length (ly:context-property context 'measureLength)) (measure-number (floor (ly:moment-main (ly:moment-div now measure-length)))) (position-in-measure (ly:moment-main (ly:moment-mod now measure-length)))) (prepend! `((type . note) (pitch . ,pitch) (duration . ,duration) (measure-number . ,measure-number) (position-in-measure . ,position-in-measure)) time-step-events))) ((rest-event engraver event) (let ((duration (ly:event-property event 'duration))) (prepend! `((type . rest) (duration . ,duration)) time-step-events)))) ((process-music engraver) (if (eq? #t (ly:context-property context 'measureStartNow)) (prepend! `((type . bar-line)) time-step-events)) (set! notes-found (append-reverse time-step-events notes-found))) ((stop-translation-timestep engraver) (set! time-step-events '())) ((finalize engraver) (prepend! (cons id (reverse! notes-found)) (ly:context-property score 'allParts)))))) #(define (Print_parts_engraver context) (make-engraver ((finalize engraver) (pretty-print (reverse! (ly:context-property context 'allParts)))))) \layout { \context { \Score \consists #Print_parts_engraver } \context { \Voice \consists #Log_parts_engraver } } << \new Staff << \new Voice = "voix 1" { \voiceOne << { 2 d' e' f' } { g'2 a' b' c' } >> } \new Voice = "voix 2" { \voiceThree c2 b a g } >> \new Staff << \new Voice = "voix 3" { \voiceFour c2 a f b } \new Voice = "voix 4" { \voiceTwo r1 r1 } >> >>