lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how close are we to having an "addAt" or "insertAt" feature?


From: James
Subject: Re: how close are we to having an "addAt" or "insertAt" feature?
Date: Tue, 14 Jan 2014 13:46:56 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 14/01/14 07:17, Jan-Peter Voigt wrote:
Hi Kieren and all,

I use an engraver for this task, that looks for overrides, sets and
clefs at the current measure (of the context consisting this engraver)
and at the current moment inside this measure. So this is a little bit
different from your example in that it listens during compilation, while
your example modifies a music expression /before/ compilation.

My intention was the ability to use a pen and mark all grobs to modify
on a printed sheet of music - without any links to the source.
Now I just write

\editionMod <the edition name> <measure> <moment> <engraver-id> {...}

and I can switch on and off the edition-overrides as needed.
This approach should be able to produce any grob, but beside overrides
and sets I have only implemented inserting clefs and TextScript-grobs.

To implement a function, that modifies the music expression without
compiling means, that you have to know the run of time-signatures. If
you don't know that, you don't know when measure X starts.
If you have a global variable for all time signatures, you might look
for all time-signature-events and accumulate them to produce a
skip-expression.

addAt =
#(define-music-function (parser location music measure moment
addition)(ly:music? integer? ly:moment ly:music?)
; ... create myAdd = { \skip #to-measure-moment $addition }
; and return
(make-music 'SimultaneousMusic 'elements (list music myAdd))
)

HTHOIALI (hth or is at least interesting)

Cheers,
Jan-Peter

Could you give a working .ly example?

It might prove helpful for other users that cannot necessarily understand scheme (like me :) )

Also if it compiles on 2.14 then we could add it to the LSR for other users.

James



reply via email to

[Prev in Thread] Current Thread [Next in Thread]