lilypond-user
[Top][All Lists]
Advanced

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

Re: Direction operators in event-function


From: David Kastrup
Subject: Re: Direction operators in event-function
Date: Sun, 21 Oct 2018 18:17:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

David Kastrup <address@hidden> writes:

> Urs Liska <address@hidden> writes:
>
>> What I would *like* to do is a function like
>>
>> propagate-direction =
>> #(define-event-function (text)(markup?)
>>    #{
>>      -\tweak direction #UP
>>      -(
>>      -\tweak direction #UP
>>      -\markup #text
>>    #})
>>
>> but instead of hard-coding #UP I'd like to calculate the values based
>> on something. For example let the text have the opposite direction of
>> the slur and have the slur accept the ^\_ operator.
>
> Even assuming PostEvents are fixed, you'd still be stuck having to
> look at one event from another, independent one.  You'd be missing a
> reliable handle for that.  You'd need to use an engraver for doing
> that kind of interaction.

Correction: you could put a callback into a direction tweak on the text
event and this callback could check the _text_ event's direction and
then assume the _opposite_.  So after "assuming PostEvents are fixed"
should more or less work for this particular scenario, but

\tweak direction #UP \propagate-direction

would then override both tweaks.  I mean, you could still override with
a callback that reverses direction only on markup grobs but things get
increasingly murky and awkward when trying to do stuff like that.

-- 
David Kastrup



reply via email to

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