On Jun 16, 2011, at 12:58 PM, Graham Percival wrote: > On Thu, Jun 16, 2011 at 11:01:18AM +0200, m...@apollinemike.com wrote: >> I am working on a piece now where I need certain events to transmogrify into >> other events. Specifically, whole-measure rests need to turn into >> multi-measure rests, and given the way that the piece is algorithmically >> generated, it would take a lot of time for me to change all of the `r' to >> `R' when this is the case. I'd like to add a bit to rest-engraver.cc in the >> spirit of : > > This looks like using a tactical nuke to swat a fly. Why not > write a plain old music function (in your .ly file) which changes > the events? I see no reason to mess with C++ stuff here...? > > (obviously you'd add that music function to your > algorithm-exporting code as well, but that's a minor issue) >
If only it were that easy... I have also tweaked the rest engraver to do automatic rest grouping. For example, if in my file I have \time 4/4 d4 r8. r8 r16 r8 r2 r4 r2 What will be printed is d4 r4 r2 r1 This is why the event needs to be rebroadcasted - it changes the rest to r1 in the engraver (not in the .ly file). I could, of course, implement a crude parser in python that combines my rests into a new input file, but this would be doubleplusunfun. Right now, I can make this work by deleting the multi-measure-rest engraver and copying all the code to rest-engraver. However, I'd like to keep the changes as minimal as possible in hopes that the useful parts can remain separable and become part of LilyPond. My question still stands for anyone who has any idea if/how stream events can be rerouted to other engravers. The only solution I'm ruling out (for now) is the creation of a dummy grob that is created in the rest engraver and acknowledged in the multi measure rest engraver - I tried it once to communicate between the auto-beam and beam-collision engravers and people were not fans. Cheers, MS _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user