Reinhold Kainhofer <[email protected]> writes:
> On 26/09/2012 14:34, David Kastrup wrote:
>> David Kastrup <[email protected]> writes:
>>
>>> Werner LEMBERG <[email protected]> writes:
>>>
>>>>>> It would be tremendously helpful if you can show possible syntax
>>>>>> *alternatives* instead of just pretending to be a naysayer.
>>>>> I've posted actual working definitions for that purpose.
>>>> It seems I've missed that, lost in the many examples you've given to
>>>> demonstrate what doesn't work.
>>>>> They would definitely simplify the kind of entry you are asking for.
>>>> Please repeat.
>>> Sigh.
>>>
>>> at =
>>> #(define-music-function (parser location time event music)
>>> (ly:duration? ly:music? ly:music?)
>>> "Place @var{event} at a relative duration @var{time} in relation
>>> to @var{music}."
>>> #{ << { \skip $time <>$event } $music >> #})
>>>
>>> {
>>> \at 4 \<
>>> \at 1*2/3 \!
>>> c'1\p
>>> }
>> [12 days later, and no followup again]
>>
>> Let's just continue pretending me to be a naysayer then.
>
> You demonstrated that a solution is possible, but quite inconsistent with
> the lilypond language: You have to write the dynamic BEFORE the note,
> although it should be printed AFTER the note...
One can, of course, exchange the order of arguments. However, then
adding several arguments becomes more awkward:
at =
#(define-music-function (parser location music event time)
(ly:music? ly:music? ly:duration?)
"Place @var{event} at a relative duration @var{time} in relation
to @var{music}."
#{ \context Voice << { \skip $time <>$event } $music >> #})
{
\at {
\at { c'1\p } \< 4
} \! 1*2/3
}
In this case, we might get the same result, however, by specifying the
second duration not in relation to the "main" event but to the already
delayed event:
after =
#(define-music-function (parser location music time event)
(ly:music? ly:duration? ly:music?)
"Place @var{event} at a relative duration @var{time} in relation
to @var{music}."
#{ \context Voice << { \skip $time <>$event } <>$music >> #})
{
\after { c'1\p } 4 \after \< 1*1/6 \!
}
This is now in "time order" but I am not really convinced that it is
less confusing.
--
David Kastrup
_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel