lilypond-user
[Top][All Lists]
Advanced

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

Re: Introducing some 'path' drawing tools


From: Paul Morris
Subject: Re: Introducing some 'path' drawing tools
Date: Sat, 18 Apr 2015 15:22:14 -0400

Hi Pierre,

Looking at this some more I see how it would really be handy for working with 
paths in LilyPond.  Thanks for creating it and sharing it!  I made some 
revisions to the code in the graph-paper file, simplifying things.  See 
attached.

I’ve had good luck with a different approach: rendering a glyph to SVG with 
LilyPond (possibly scaling it up by a factor of 10 with \magnifyStaff), editing 
it with InkScape (scaling it back down), then opening the .svg file in a text 
editor, and cutting and pasting the path coordinates into a LilyPond file as a 
path stencil.  

Usually it’s not a direct cut and paste, some formatting may be needed.  This 
svg transformation tool is handy for that:  
http://petercollingridge.appspot.com/svg_transforms

For example, the code below shows a slightly modified whole note glyph created 
using this process.  So I imagine I’ll probably stick with this approach for 
the most part, but it’s good to have solid tools for other options!

Cheers,
-Paul

Attachment: graph-paper-2.ily
Description: Binary data


%%%%%%%%%%%%%%%%%
\version "2.19.18"

% default whole note as path coordinates

\markup \stencil
#(make-path-stencil
  '(M 217 114
     c -50 0 -71 -42 -71 -88
     c 0 -79 60 -140 139 -140
     c 50 0 70 42 70 88
     c 0 79 -59 140 -138 140
     z
     M 501 0
     c 0 -43 -34 -75 -73 -96
     c -54 -29 -116 -40 -177 -40
     c 0 0 -124 11 -178 40
     c -39 21 -73 53 -73 96
     c 0 43 34 75 73 96
     c 54 29 117 40 178 40
     c 0 0 123 -11 177 -40
     c 39 -21 73 -53 73 -96
     z)
  0.0001
  0.004
  0.004
  #t)

% revised version via Inkscape

\markup \stencil
#(make-path-stencil
  '(M 1.06033904 -0.36566768
     C 1.24701856 -0.36566768 1.32542384 -0.2688184 1.32542384 -0.09707328
     C 1.32542384 0.19788 1.10140848 0.36566752 0.80645504 0.36566752
     C 0.61977552 0.36566752 0.545104 0.26881824 0.545104 0.09707312
     C 0.545104 -0.19788016 0.7653856 -0.36566768 1.06033904 -0.36566768
     Z
     M 0 0
     C 0 0.16054432 0.12694192 0.28001904 0.272552 0.35842432
     C 0.47416576 0.4666984 0.70564816 0.50776784 0.93339712 0.50776784
     C 1.16114576 0.50776784 1.39636192 0.4666984 1.59797568 0.35842432
     C 1.74358576 0.28001904 1.87052768 0.16054432 1.87052768 0
     C 1.87052768 -0.16054432 1.74358576 -0.2800192 1.59797568 -0.35842448
     C 1.39636192 -0.46669856 1.16114592 -0.507768 0.93339712 -0.507768
     C 0.70564816 -0.507768 0.47416576 -0.46669856 0.272552 -0.35842448
     C 0.12694192 -0.2800192 0 -0.16054432 0 0
     Z)
  0.0001
  1 1 #t)



reply via email to

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