\version "2.19.56" get-mods = ##f add-mod = ##f #(let ((mods '())) (set! get-mods (lambda (id) (ly:assoc-get id mods '() #f) )) (set! add-mod (lambda (id mod) (if (list? mod) (set! mods (assoc-set! mods id `(,@(get-mods id) ,@mod))) ) (ly:message "~A" mods) )) ) tweakIDEngraver = #(lambda (context) (make-engraver (listeners ((StreamEvent engraver event) (let* ((eventID (ly:event-property event 'tweakID)) (tweaks (ly:event-property event 'tweaks)) (mods (get-mods eventID))) (if (and (list? mods)(> (length mods) 0)) (ly:event-set-property! event 'tweaks (append (if (list? tweaks) tweaks '()) mods)) ) )) ) )) withID = #(define-music-function (id mus)(symbol? ly:music?) (ly:music-set-property! mus 'tweakID id) mus) editionTweak = #(define-void-function (id tweak)(symbol? ly:music?) (let ((tweaks (ly:music-property tweak 'tweaks))) (if (and (list? tweaks)(> (length tweaks) 0)) (add-mod id tweaks)) )) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \layout { \context { \Score \consists #tweakIDEngraver } } \editionTweak hansi \tweak color #red c \editionTweak mausi \tweak Stem.color #green c \editionTweak mausi \tweak NoteHead.color #blue c \editionTweak miezi \tweak Accidental.color #'(.8 .7 0) c \relative { bes'4-\withID hansi ( a \withID mausi c \withID miezi b) }