\path and \postscript in staff

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

\path and \postscript in staff

Helge Kruse-4
The appendix A.10.3 of the Lilypond notation manual describes several
possibilities to use \path or \postscript in a \markup context. So you
can use this to draw some lines:

\version "2.18.2"

<<
  \relative c' {
    e4^\markup { \path #0.25 #'((rmoveto 0 0)

                                (rlineto 5 -1)
                                (closepath)) }

    c'_\markup { \path #0.1 #'((rmoveto 0 0)
                              (rlineto 10 1)
                              (closepath)
                              ) }
  }

  \relative c' {
    g8 g g g
  }
>>

But these lines are outside the staff. If you change "(rlineto 10 1)" to
"(rlineto 10 10)" then the starting point is moved down to keep the
markup outside the stuff. Further it doesn't support the x-position of
the next/previous note column.

How can I draw lines from note head to next note head with \path or
\postscript inside the staff? This should be robust to changes in the
other staves, e.g. if the other staff changes to 32th notes.

Regards
Helge


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

Re: \path and \postscript in staff

Thomas Morley-2
2018-05-25 8:15 GMT+02:00 Helge Kruse <[hidden email]>:

> The appendix A.10.3 of the Lilypond notation manual describes several
> possibilities to use \path or \postscript in a \markup context. So you
> can use this to draw some lines:
>
> \version "2.18.2"
>
> <<
>   \relative c' {
>     e4^\markup { \path #0.25 #'((rmoveto 0 0)
>
>                                 (rlineto 5 -1)
>                                 (closepath)) }
>
>     c'_\markup { \path #0.1 #'((rmoveto 0 0)
>                               (rlineto 10 1)
>                               (closepath)
>                               ) }
>   }
>
>   \relative c' {
>     g8 g g g
>   }
>>>
>
> But these lines are outside the staff. If you change "(rlineto 10 1)" to
> "(rlineto 10 10)" then the starting point is moved down to keep the
> markup outside the stuff. Further it doesn't support the x-position of
> the next/previous note column.
>
> How can I draw lines from note head to next note head with \path or
> \postscript inside the staff? This should be robust to changes in the
> other staves, e.g. if the other staff changes to 32th notes.
>
> Regards
> Helge

Hi,

you'll need a spanner from note to note, Glissando is your best bet, I'd say.
I once made the attached code.

HTH,
  Harm

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

fancy-gliss-02.ly (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: \path and \postscript in staff

Aaron Hill
In reply to this post by Helge Kruse-4
On 2018-05-24 23:15, Helge Kruse wrote:
> How can I draw lines from note head to next note head with \path or
> \postscript inside the staff? This should be robust to changes in the
> other staves, e.g. if the other staff changes to 32th notes.

Hi Helge,

If you just need to draw lines between notes, the following LSR snippet
uses the TextSpanner to achieve this without needing to use \path or
\postscript:

http://lsr.di.unimi.it/LSR/Item?id=662

-- 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: \path and \postscript in staff

Aaron Hill
In reply to this post by Helge Kruse-4
On 2018-05-24 23:15, Helge Kruse wrote:
> But these lines are outside the staff. If you change "(rlineto 10 1)"
> to
> "(rlineto 10 10)" then the starting point is moved down to keep the
> markup outside the stuff. Further it doesn't support the x-position of
> the next/previous note column.

There is a difference in behavior between \path and \postscript
regarding bounds.  See the following:

%%%%
   \version "2.18.2"
   {
     f'4_\markup { \postscript #"0 0 moveto 1 5 lineto stroke" }
     f'4_\markup { \path #0.1 #'((moveto 0 0) (lineto 1 5) (closepath)) }
     f'4_\markup {
       \with-dimensions #'(0 . 0) #'(0 . 0)
       \path #0.1 #'((moveto 0 0) (lineto 1 5) (closepath))
     }
   }
%%%%

By forcing the bounds of the \path-created object to be "empty," it can
overlap the staff.

-- 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: \path and \postscript in staff

Helge Kruse-4
Am 25.05.2018 um 13:44 schrieb Aaron Hill:

> On 2018-05-24 23:15, Helge Kruse wrote:
>> But these lines are outside the staff. If you change "(rlineto 10 1)" to
>> "(rlineto 10 10)" then the starting point is moved down to keep the
>> markup outside the stuff. Further it doesn't support the x-position of
>> the next/previous note column.
>
> There is a difference in behavior between \path and \postscript
> regarding bounds.  See the following:
>
> [...]
>
> By forcing the bounds of the \path-created object to be "empty," it can
> overlap the staff.
Yes, but how can I draw a line to the next note or spacer rest position?

Helge

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

Re: \path and \postscript in staff

Helge Kruse-4
In reply to this post by Thomas Morley-2
Am 25.05.2018 um 13:13 schrieb Thomas Morley:
> Hi,
>
> you'll need a spanner from note to note, Glissando is your best bet, I'd say.
> I once made the attached code.

Wow! That solves the problem. This fancy glissando can be fine tuned for
each instrument, so that it produces nearly the picture of the autograph.

the function is now stored in an include file. The excerpt from the
score is attached.
Would it be worth to add it to the LSR?

Thank you,
Helge

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

UseFancyGliss.ly (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: \path and \postscript in staff

Thomas Morley-2
2018-05-26 9:38 GMT+02:00 Helge Kruse <[hidden email]>:
> Am 25.05.2018 um 13:13 schrieb Thomas Morley:
>> Hi,
>>
>> you'll need a spanner from note to note, Glissando is your best bet, I'd say.
>> I once made the attached code.
>
> Wow! That solves the problem. This fancy glissando can be fine tuned for
> each instrument, so that it produces nearly the picture of the autograph.

Glad you like it.

> the function is now stored in an include file. The excerpt from the
> score is attached.
> Would it be worth to add it to the LSR?


Done.

http://lsr.di.unimi.it/LSR/Item?id=1066

Cheers,
  Harm

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