vertical ordering of a custom event-function markup

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

vertical ordering of a custom event-function markup

Urs Liska-3
Hi,

I have a custom \path markup, implemented as an event function.

This works well, but when I add a slur I don't manage to get it to
behave it properly. What I want is to print the vertical lines and then
outside the slur, just like with the staccatissimo. But there will first
be the slur and then the "articulation". So far I haven't found out how
to manage that. avoid-slur doesn't seem to have any effect, and when I
override outside-staff-priority I only get to a point where the two
lines are incorrectly aligned vertically.

Any suggestions how I can print these lines like an ordinary articulation?

Thanks
Urs

%%%

\version "2.19.82"

indicator =
#(define-event-function ()()
    #{
      \tweak X-offset 0.75
      -\markup \path #0.17 #'((moveto 0 0) (lineto 0 0.75))
    #})

\relative {
   %\override TextScript.avoid-slur = #'inside
   d''4 e8 [ ^\indicator ( e ] ^\indicator )
   d8 [ -. ( d ] -. )
}

%%%


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: vertical ordering of a custom event-function markup

Aaron Hill
On 2018-10-09 7:54 am, Urs Liska wrote:

> Hi,
>
> I have a custom \path markup, implemented as an event function.
>
> This works well, but when I add a slur I don't manage to get it to
> behave it properly. What I want is to print the vertical lines and
> then outside the slur, just like with the staccatissimo. But there
> will first be the slur and then the "articulation". So far I haven't
> found out how to manage that. avoid-slur doesn't seem to have any
> effect, and when I override outside-staff-priority I only get to a
> point where the two lines are incorrectly aligned vertically.
>
> Any suggestions how I can print these lines like an ordinary
> articulation?
>
> Thanks
> Urs
>
> %%%
>
> \version "2.19.82"
>
> indicator =
> #(define-event-function ()()
>    #{
>      \tweak X-offset 0.75
>      -\markup \path #0.17 #'((moveto 0 0) (lineto 0 0.75))
>    #})
>
> \relative {
>   %\override TextScript.avoid-slur = #'inside
>   d''4 e8 [ ^\indicator ( e ] ^\indicator )
>   d8 [ -. ( d ] -. )
> }
>
> %%%

LSR shows using \tweak stencil as a way to override the appearance of an
articulation for doing something custom:

%%%%
indicator = \tweak stencil
   #(lambda (grob) (grob-interpret-markup grob
     #{ \markup \path #0.17 #'((moveto 0.75 0) (lineto 0.75 0.75)) #}))
   \stopped
%%%%

Of course, this doesn't help with the custom event function.  Consider
this:

%%%%
\version "2.19.82"

indicator = #(define-event-function ()()
   #{ -\markup \with-dimensions #'(0 . 0) #'(0 . 0.75)
       \path #0.17 #'((moveto 0.75 0) (lineto 0.75 0.75)) #})

\relative {
   \override TextScript.outside-staff-priority = #0
   \override Slur.outside-staff-priority = #1
   d''4 e8 [ ^\indicator ( e ] ^\indicator )
   d8 [ -. ( d ] -. )
}
%%%%

If you allow the markup to have any width (e.g. try "#'(0 . 1e-14)"), it
seems to break things.

-- Aaron Hill

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: vertical ordering of a custom event-function markup

Thomas Morley-2
In reply to this post by Urs Liska-3
Am Di., 9. Okt. 2018 um 16:54 Uhr schrieb Urs Liska <[hidden email]>:

>
> Hi,
>
> I have a custom \path markup, implemented as an event function.
>
> This works well, but when I add a slur I don't manage to get it to
> behave it properly. What I want is to print the vertical lines and then
> outside the slur, just like with the staccatissimo. But there will first
> be the slur and then the "articulation". So far I haven't found out how
> to manage that. avoid-slur doesn't seem to have any effect, and when I
> override outside-staff-priority I only get to a point where the two
> lines are incorrectly aligned vertically.
>
> Any suggestions how I can print these lines like an ordinary articulation?
>
> Thanks
> Urs
>
> %%%
>
> \version "2.19.82"
>
> indicator =
> #(define-event-function ()()
>     #{
>       \tweak X-offset 0.75
>       -\markup \path #0.17 #'((moveto 0 0) (lineto 0 0.75))
>     #})
>
> \relative {
>    %\override TextScript.avoid-slur = #'inside
>    d''4 e8 [ ^\indicator ( e ] ^\indicator )
>    d8 [ -. ( d ] -. )
> }
>
> %%%

Probably:

indicator =
#(define-event-function ()()
    #{
      \tweak X-offset 0.75
      -\markup \path #0.17 #'((moveto 0 0) (lineto 0 0.75))
    #})

\relative {
   \override TextScript.avoid-slur = #'inside
   \override TextScript.cross-staff = ##t
   d''4 e8 [ ^\indicator ( e ] ^\indicator )
   d8 [ -. ( d ] -. )
}


Not sure about the consequences, though.

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: vertical ordering of a custom event-function markup

David Kastrup
Thomas Morley <[hidden email]> writes:

> Probably:
>
> indicator =
> #(define-event-function ()()
>     #{
>       \tweak X-offset 0.75
>       -\markup \path #0.17 #'((moveto 0 0) (lineto 0 0.75))
>     #})

There is rarely a point in a parameterless function containing a single
music expression.  This could have been written as just

indicator =
      -\tweak X-offset 0.75
      -\markup \path #0.17 #'((moveto 0 0) (lineto 0 0.75))

Turns out that point-and-click information for either variant ends up at
the point of use rather than the point of definition, which is
definitely desirable.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: vertical ordering of a custom event-function markup

Urs Liska-3
In reply to this post by Thomas Morley-2


Am 09.10.2018 um 22:40 schrieb Thomas Morley:

> Probably:
>
> indicator =
> #(define-event-function ()()
>      #{
>        \tweak X-offset 0.75
>        -\markup \path #0.17 #'((moveto 0 0) (lineto 0 0.75))
>      #})
>
> \relative {
>     \override TextScript.avoid-slur = #'inside
>     \override TextScript.cross-staff = ##t
Huh, what is that?
I've found the description in the grob-interface reference but I don't
really understand what it does here ...

>     d''4 e8 [ ^\indicator ( e ] ^\indicator )
>     d8 [ -. ( d ] -. )
> }
>

On first sight it does exactly what I wanted it to do (see first attachment)

> Not sure about the consequences, though.

The consequence is that the markup doesn't move to avoid collisions (see
second attachment with lower notes).
If I comment out the cross-staff tweak again the lines move with the
note heads, but of course the order changes again.

Thank you for these thoughts and inspiration :-) But please don't
investigate any further, it seems Aaron's suggestion is what I need.

Urs


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

document.png (12K) Download Attachment
document.png (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: vertical ordering of a custom event-function markup

Urs Liska-3
In reply to this post by Aaron Hill
Hi Aaron,


Am 09.10.2018 um 18:55 schrieb Aaron Hill:

> On 2018-10-09 7:54 am, Urs Liska wrote:
>> Hi,
>>
>> I have a custom \path markup, implemented as an event function.
>>
>> This works well, but when I add a slur I don't manage to get it to
>> behave it properly. What I want is to print the vertical lines and
>> then outside the slur, just like with the staccatissimo. But there
>> will first be the slur and then the "articulation". So far I haven't
>> found out how to manage that. avoid-slur doesn't seem to have any
>> effect, and when I override outside-staff-priority I only get to a
>> point where the two lines are incorrectly aligned vertically.
>>
>> Any suggestions how I can print these lines like an ordinary
>> articulation?
>>
>> Thanks
>> Urs
>>
>> %%%
>>
>> \version "2.19.82"
>>
>> indicator =
>> #(define-event-function ()()
>>    #{
>>      \tweak X-offset 0.75
>>      -\markup \path #0.17 #'((moveto 0 0) (lineto 0 0.75))
>>    #})
>>
>> \relative {
>>   %\override TextScript.avoid-slur = #'inside
>>   d''4 e8 [ ^\indicator ( e ] ^\indicator )
>>   d8 [ -. ( d ] -. )
>> }
>>
>> %%%
>
> LSR shows using \tweak stencil as a way to override the appearance of
> an articulation for doing something custom:
>
> %%%%
> indicator = \tweak stencil
>   #(lambda (grob) (grob-interpret-markup grob
>     #{ \markup \path #0.17 #'((moveto 0.75 0) (lineto 0.75 0.75)) #}))
>   \stopped
> %%%%
>

This is (to some extent) semantically problematic because it essentially
abuses another articulation (here \stopped). But after some tests it
seems to do exactly what I need, and I will use that solution. Thank you
very much for that!

> Of course, this doesn't help with the custom event function. Consider
> this:
>
> %%%%
> \version "2.19.82"
>
> indicator = #(define-event-function ()()
>   #{ -\markup \with-dimensions #'(0 . 0) #'(0 . 0.75)
>       \path #0.17 #'((moveto 0.75 0) (lineto 0.75 0.75)) #})
>
> \relative {
>   \override TextScript.outside-staff-priority = #0
>   \override Slur.outside-staff-priority = #1
>   d''4 e8 [ ^\indicator ( e ] ^\indicator )
>   d8 [ -. ( d ] -. )
> }
> %%%%
>
> If you allow the markup to have any width (e.g. try "#'(0 . 1e-14)"),
> it seems to break things.

This doesn't produce really nice spacing (actually the lines nearly
clash with the slur). And I don't need the event function in the first
place, I only need the articulation.

Best
Urs

>
> -- Aaron Hill
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/lilypond-user


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user