lilypond-user
[Top][All Lists]
Advanced

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

Direction operators in event-function


From: Urs Liska
Subject: Direction operators in event-function
Date: Sun, 21 Oct 2018 16:21:33 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

I'm scratching my head  thanks to some weird behaviour (at least it looks like that for me). In a simple event-function any explicit direction operator used when calling the event will be propagated to the created objects:

\version "2.19.82"

propagate-direction =
#(define-event-function (text)(markup?)
   #{
     -\markup #text
   #})

{
  g'1 ^\propagate-direction "Up"
}

When I use explicit tweaks I can specify directions for multiple elements as well (but independently from any direction operators):

propagate-direction =
#(define-event-function (text)(markup?)
   #{
     -\tweak direction #UP
     -(
     -\tweak direction #UP
     -\markup #text
   #})

{
  g'1 \propagate-direction "Up" g' )
}

But if I simply create two elements in the event-function the explicit direction operator takes no effect:

propagate-direction =
#(define-event-function (text)(markup?)
   #{
     -(
     -\markup #text
   #})

{
  g'1 ^\propagate-direction "Up" g' )
}

(here both the slur and the text are printed below the staff.

Why is that?
And more importantly: how can I achieve the goal of creating more than one element in an event-function and still have the explicit directions from the calling code be applied?

And why can't I access the explicit direction operator from within the event-function? I understand that the *generated* direction isn't accessible at that moment, but an explicit setting should be known at that point, isn't it?

Thanks
Urs




reply via email to

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