lilypond-user
[Top][All Lists]
Advanced

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

Re: Custom noteheads stem alignment


From: Pierre Perol-Schneider
Subject: Re: Custom noteheads stem alignment
Date: Mon, 13 Apr 2015 00:09:17 +0200

Ok, thanks for the explanation Andrew.
But I'm afraid you can't do that here since 'elipse' draws a single line with a specific thickness. A note head with a counter would need at least two lines/elipses, one filled 'inside' and the other filled 'outside' (but I don't know how to do that).
So I'm afraid you'll have to go through a postscript - that you don't want if I understood you well - or a 'path' drawing.

Here's a draft for a 'path' (counter has, of course, to be adapted to your design):

\version "2.19.18"

sOne =
\markup
\override #'(filled . #t)
\path #0.01
#'((moveto    0.00  -0.35)            
   (lineto    0.08  -0.28)    
   (curveto   0.08  -0.32   0.10  -0.33   0.18  -0.33)
   (curveto   0.48  -0.33   1.03   0.08   1.03   0.28)
   (curveto   1.03   0.34   0.94   0.33   0.93   0.33)
   (curveto   0.65   0.33   0.08  -0.05   0.08  -0.28)
   (lineto    0.00  -0.35)
   (curveto   0.00   0.00   0.55   0.55   0.90   0.55)
   (curveto   1.00   0.55   1.10   0.50   1.10   0.35)
   (curveto   1.10   0.00   0.55  -0.55   0.20  -0.55)
   (curveto   0.05  -0.55   0.00  -0.45   0.00  -0.35))

sTwo =
\markup
\override #'(filled . #t)
\path #0.01
#'((moveto    0.00  -0.35)            
   (curveto   0.00   0.00   0.55   0.55   0.90   0.55)
   (curveto   1.00   0.55   1.10   0.50   1.10   0.35)
   (curveto   1.10   0.00   0.55  -0.55   0.20  -0.55)
   (curveto   0.05  -0.55   0.00  -0.45   0.00  -0.35))

#(define exp-stencil-2
   (lambda (grob)
     (let ((duration (ly:grob-property grob 'duration-log)))
            (if (> duration 1)
                  (grob-interpret-markup grob sTwo)
                  (grob-interpret-markup grob sOne)))))

%%% test:
treble = \relative c'' {
  \clef treble
  \time 4/4
  c c8 c16 c2 c16 |
  c1
  b4 bes a ais
  <bes cis des e fis ges>8
}

bass = \relative c {
  \clef bass
  \time 4/4
  c4 c8 c16 c2 c16 |
  c1
  d4 dis ees e
  \stemUp
  <c d e f g>4
}

\score {
  \new PianoStaff <<
    \new Staff = "treble" { \treble }
    \new Staff = "bass" { \bass }
  >>
  \layout {
    \context {
      \Score
      \override NoteHead.stencil = #exp-stencil-2
    }
  }
}



I hope this will bring you a better help than my previous answer ;)

Cheers,
Pierre



2015-04-12 15:56 GMT+02:00 Andrew Bernard <address@hidden>:
In typography, the hole in characters such as ‘o’ and ‘a’ is called the counter. Most notes are engraved with an ellipse as the empty space, with ‘italic pen’ style thick and thin.

The standard lilypond noteheads do this.

Andrew


On 12 April 2015 at 23:35:58, Pierre Perol-Schneider (address@hidden) wrote:

1. How does one achieve an elliptical counter in unfilled notes? I know how to do this in Postscript, but not here.

Sorry, I don't understand the question. :(


reply via email to

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