lilypond-user
[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: Jan-Peter Voigt
Subject: Re: how close are we to having an "addAt" or "insertAt" feature?
Date: Wed, 15 Jan 2014 18:02:56 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Hi Kieren, James and all,

I extracted my edition-engraver from lalily. The example compiles here
with 2.18.
You can try this and comment ... I will add more comments to the code,
if this is of interest ;)

The compilation creates a file example.edition.log containing all
edition-engraver paths.

I use this inside lalily. There is always a current "music-path", which
is used to create the path for the engraver. Then the edition-engraver
paths are made by the template in use, so I don't have to deal with them.

HTH
Best, Jan-Peter


On 14.01.2014 14:46, James wrote:
> 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

Attachment: edition-engraver.ily
Description: Text document

Attachment: example.ly
Description: Text Data

Attachment: util.ily
Description: Text document


reply via email to

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