lilypond-user
[Top][All Lists]
Advanced

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

Re: How to define a non existing grob


From: Pierre Perol-Schneider
Subject: Re: How to define a non existing grob
Date: Mon, 13 Apr 2015 09:27:50 +0200

Hi Harm, Hi Urs,

2015-04-13 1:42 GMT+02:00 Thomas Morley <address@hidden>:

We have no glyph for it.
Have a look at:  http://www.lilypond.org/doc/v2.19/Documentation/notation/the-feta-font#rest-glyphs
If you want to create one you need to use metafont, iirc.

Yes I know that, this is actually DA problem...
I probably should have been more precise ;)
Initially I wanted to create 256th glyphs (unfinished yet) :

\version "2.18.2"

%% Two hundred fifty-sixth notes/rests paths
flagsd-eight =
\markup
\override #'(filled . #t)
\translate #'(-0.01 . 0)
\path #0.01
#'((moveto   -0.05   0.00)
   (lineto   -0.01   0.00)  
   (curveto  -0.01   0.70   0.91   1.20   0.91   2.10)
   (curveto   0.91   2.30   0.90   2.35   0.85   2.53)
   (lineto    0.74   2.35)
   (curveto   0.77   1.90   0.75   1.45  -0.01   0.83)
   (lineto   -0.01   0.93)
   (curveto  -0.01   1.62   0.93   2.10   0.93   2.85)
   (curveto   0.93   3.00   0.93   3.00   0.88   3.27)
   (lineto    0.75   3.10)
   (curveto   0.86   2.65   0.58   2.15  -0.01   1.68)
   (lineto   -0.01   1.78)
   (curveto  -0.01   2.65   1.35   3.00   0.91   4.15)
   (lineto    0.80   4.00)
   (curveto   0.94   3.50   0.75   3.10  -0.01   2.57)
   (lineto   -0.01   2.67)
   (curveto  -0.01   3.53   1.40   3.80   0.95   4.95)
   (lineto    0.85   4.76)
   (curveto   0.95   4.32   0.87   4.00  -0.01   3.47)
   (lineto   -0.01   3.57)
   (curveto  -0.01   4.44   1.38   4.53   0.98   5.72)
   (lineto    0.86   5.58)
   (curveto   0.95   5.10   0.90   4.83  -0.01   4.39)
   (lineto   -0.01   4.49)
   (curveto  -0.01   5.30   1.26   5.32   1.06   6.25)
   (curveto   1.04   6.38   0.89   6.37   0.90   6.23)
   (curveto   0.98   5.83   0.85   5.58  -0.01   5.31)
   (lineto   -0.01   5.83)
   (lineto   -0.05   5.83)
   (closepath))

%% TODO;
flagsu-eight =
\markup
\musicglyph #"flags.u7"

rests-eight =
\markup
\override #'(filled . #t)
\path #0.01
 #'((moveto    0.48 -4.00)
       (curveto   0.48  -4.05   0.68  -4.06   0.68  -4.00)
       (lineto    1.50   2.71)
       (curveto   1.50   2.77   1.42   2.77   1.41   2.70)
       (curveto   1.38   2.56   1.32   2.48   1.26   2.48)
       (curveto   1.11   2.48   1.21   2.81   0.90   2.81)
       (curveto   0.75   2.81   0.625  2.70   0.625  2.54)
       (curveto   0.625  2.20   1.04   2.14   1.355  2.37)
       (lineto    1.28   1.84)
       (curveto   1.24   1.47   1.13   1.43   1.11   1.43)
       (curveto   0.92   1.43   1.08   1.82   0.74   1.82)
       (curveto   0.60   1.82   0.465  1.70   0.465  1.55)
       (curveto   0.465  1.19   0.88   1.16   1.21   1.32)
       ; TODO:
       ;(lineto    1.14   0.80)
       ;[...]
       (lineto    0.48 -4.00)
       )

%A simple test to show the output:
\new Staff \with { instrumentName = "128th/2" }
  \relative c'' {
    \override Stem.length = #13.3
    \override Flag.stencil = #(lambda (grob)
       (grob-interpret-markup grob flagsd-eight))
    \override Rest.stencil = #(lambda (grob)
       (grob-interpret-markup grob rests-eight))
    c128*1/2 r c r c256[ c c c]
  }

%%%%%%%%


% Now the problem comes when trying to create a function:

%%%%%%
#(define rest-8
   (lambda (grob)
     (let ((duration (ly:grob-property grob 'duration-log)))
            (if (> duration 7)
                  (grob-interpret-markup grob rests-eight)
                  (ly:rest::print grob))))) 
 
\new Staff \with { instrumentName = "256th" }
  \relative c'' {
    \override Score.Rest.stencil = #rest-8
    r64 r128 r256
  } 
%%%%%%%


Now, for this current example - and more generally speaking - how can I declare to LP that a non existing glyph (e.g. rests.8) actually do exist?

2015-04-13 2:05 GMT+02:00 Urs Liska <address@hidden>:
 
Would  be a useful addition IMO.
Maybe it isn't that hard after all, as one could probably reuse existing code from other rests.

Not in a simple way.
Creating 'path' glyphs will take less time for a much better look (AFAIK).

Cheers,
Pierre


reply via email to

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