lilypond-user
[Top][All Lists]
Advanced

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

Re: dotted semicircle indicating harmonics


From: Aaron Hill
Subject: Re: dotted semicircle indicating harmonics
Date: Sat, 07 Jul 2018 04:10:41 -0700
User-agent: Roundcube Webmail/1.3.6

On 2018-07-07 02:51, sylvius wrote:
I still would like to know how to achieve a dotted semicircle but it’s
probably a matter of PostScript rather than LilyPond.  Unfortunately
I’m not very proficient with PostScript and so far I haven’t found a
solution in various internet researches.

Does any of this help?

%%%%
  \version "2.19.82"
  semicircleDown = \markup {
    \with-dimensions #'(0 . 2) #'(0 . 1)
    \postscript #"2 0 moveto 1 0 1 0 180 arc 0.2 setlinewidth
                  [0.0 0.4] 0.2 setdash 1 setlinecap stroke"
  }
  semicircleUp = \markup {
    \translate #'(-0.83 . 0)
    \with-dimensions #'(0 . 3) #'(-1.5 . -1.25)
    \postscript #"0 0 moveto 1.5 0 1.5 180 360 arc 0.2 setlinewidth
                  [0.0 0.4] 0.2 setdash 1 setlinecap stroke"
  }
  music = {
    \key g \major
    \time 6/8
    <fis'_3 d''^2>4 r8
    <d'_3>4
      ^\semicircleDown
      _\markup { \semicircleUp }
      ^"harm:"
    r8
  }
  \score { \music }
%%%%

A couple of things to keep in mind. In LilyPond, \postscript does not have any bounds or outline. That is why you were seeing overlap with other things. You will need to use \with-dimensions (or \with-outline) to explicitly define the bounds (or outline) so that LilyPond can know how to move things around.

The dash pattern here is a little more complicated, since I wanted to demonstrate how you can get rounded dots instead of boxy dashes. Otherwise, something like `[0.2] 0 setdash` (without setting the line cap) would have been sufficient to create an even dash the size of the line width, resulting in boxy "dots".

Finally, based on the transcription you linked, the lower arc wraps around the fingering number. Note that in my example, I am "lying" about the true dimensions of the arc so that LilyPond will permit overlap of the vertical bounds.

-- Aaron Hill



reply via email to

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