Hi Kieren,
I didn't do very much polymetric music, but there is some code in the
branch "listen-rehearsal-mark". I updated it to the current state of
master and you can add mods a moment after a RehearsalMark. IIRC you saw
this some time ago and said that you'd prefer a distinct event for the
marks.
https://github.com/openlilylib/edition-engraver/blob/listen-rehearsal-mark/example-1.ly#L69
I am currently looking how to define event-classes and music-types (in
scheme), so that one can add an edition-mark-event (or the like).
The following are my current thoughts on the edition-engraver:
Attached is another file that might be interesting for you. I created a
simple engraver to add tweaks to music-expressions with a distinct ID.
The problem is, how to add the IDs automatically so that one can easily
address objects.
I am going to add tweaks to the edition-engraver so that one can say:
Add the following tweak to the note @time with the following attributes
(duration, pitch, event-type).
In my toolbox are methods to batch-enter editionMods. One method is to
add one mod - often it is "\break" - to the following positions.
(
https://github.com/openlilylib/edition-engraver/blob/master/development-1.ly
)
Another one is to add a mod with a parameter in different. For example:
Align LyricText at 3 3/4 #LEFT and 5 3/4 #RIGHT. If I have a moment, I
will create examples and place them on github.
Cheers
Jan-Peter
Am 21.03.2017 um 21:32 schrieb Kieren MacMillan:
Hi all (and especially Jan-Peter),
Has anyone used the edition-engraver with polymetric music?
I’m having difficulty figuring out how to “anchor” mods, since the measure
numbers are non-synchronized across the various staves.
Thanks,
Kieren.
________________________________
Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [email protected]
\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) }
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user