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: Jan-Peter Voigt
Subject: Re: how close are we to having an "addAt" or "insertAt" feature?
Date: Tue, 14 Jan 2014 08:17:16 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

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


Am 14.01.2014 00:03, schrieb Kieren MacMillan:
> Hello all,
> 
> What would be involved in developing a feature to add notes or tweaks at an 
> arbitrary moment within a music expression?
> 
> e.g.
> 
>     global = \repeat unfold 100 s1
>     music = \addAt (4 3/8) \global \once \override RehearsalMark.extra-offset 
> #’(-1 . 0)
> 
> where (4 3/8) means “in the fourth measure, at the moment of the 3rd eighth 
> note”
> 
> This would allow “perfect” separation of content from presentation — a very 
> welcome thing to my mind.
> 
> Thanks,
> Kieren.
> _______________________________________________
> lilypond-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-devel
> 




reply via email to

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