Hmmm... a square note head that's the size you want for the staff would be a 1x1 square, so that's the ballpark we're shooting for. Â If you really wanted to do it precisely you could create a hollow square in illustrator and see what size it would need to be for the SVG path command to have coordinates like this:ÂÂmoveto 0 0lineto 0 1lineto 1 1lineto 1 0Âlineto 0 0
I guess the solution is to convert (somehow) all the absolute paths to relative.Â
-Paul
crotchetBlackNatural =
\markup \stencil
#(ly:stencil-scale
(ly:make-stencil
`(path 8
`( moveto 0 0
rcurveto 7.1 -6.1 19.4 -6.9 28.2 -2.3
rcurveto 9.101 4.8 10.7 13.7 3.8 19.8
rcurveto -6.899 6.1 -19.6 7.1 -28.4 2.3
rcurveto -8.9 -4.8 -10.5 -13.7 -3.6 -19.8
rlineto 0 0
closepath)
'round 'round #t)
(cons 0 100)
(cons 0 100))
0.05 -0.05)
{ c'1^\crotchetBlackNatural }
\addlyrics { Cheers,_Jan }
\version "2.18"crotchetBlackNatural = %scaled down to 10%
\markup \stencil
#(ly:stencil-scale
(ly:make-stencil
`(path 0.2
`( rmoveto 0 3
rcurveto 7.1 -6.1 19.4 -6.9 28.2 -2.3
rcurveto 9.101 4.8 10.7 13.7 3.8 19.8
rcurveto -6.899 6.1 -19.6 7.1 -28.4 2.3
rcurveto -8.9 -4.8 -10.5 -13.7 -3.6 -19.8
rlineto 0 0
closepath)
'round 'round #t)
(cons 0 100)
(cons 0 100))
0.1 -0.1)
crotchetWhiteNatural = %scaled down to 5%
\markup \stencil
#(ly:stencil-scale
(ly:make-stencil
`(path 0.1
`( rmoveto 0 0
rcurveto 3.4 -3 9.7 -3.45 14.05 -1.15
rcurveto 4.5 2.4 5.399 6.8 1.899 9.9
rcurveto -3.5 2.95 -9.7 3.55 -14.149 1.101
rcurveto -4.55 -2.25 -5.3 -6.9 -1.8 -9.851
rlineto 0 0
closepath
rmoveto 2.651 2.951
rcurveto -0.4 4.05 2.15 7.05 5.75 7.2
rcurveto 2.5 0.149 4.45 -2.25 4.7 -4.2
rcurveto 0.55 -4 -2.3 -7.3 -5.8 -7.45
rcurveto -1.35 0 -2.4 0.6 -3.15 1.35
rcurveto -0.651 0.649 -1.25 1.3 -1.5 3.1
rlineto 0 0
closepath)
'round 'round #t)
(cons 0 100)
(cons 0 100))
0.1 -0.1)
{ c'1^\crotchetBlackNatural c'^\crotchetWhiteNatural }
Cheers,
Jan
--
You received this message because you are subscribed to the forum of the Music Notation Project (hosted by Google Groups).
To post to this group, send email to musicn...@googlegroups.com
To unsubscribe from this group, send email to musicnotatio...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/musicnotation?hl=en
---
You received this message because you are subscribed to the Google Groups "The Music Notation Project | Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to musicnotatio...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Looking good! Â Nice find on that online SVG conversion tool. Â It's just what we needed! ÂIt may make sense to convert all the paths to relative with (near to) 0 0 origin like you're doing and then convert them back to absolute values, which will then let us use the make-connected-path-stencil function which has the nice feature of calculating the stencil extents for you. (Using the other method that allows relative path coordinates requires that you manually specify these extents, which is hard when you're dealing with curves.) Â On second thought though that function also requires that there be no closepath in the middle of the path it has to be continuous, so I think it's not a good idea to use make-connected-path-stencil after all.[1]
On the cropping, I was thinking of cropping the files in Illustrator before exporting as SVG. Â But now that we can easily convert everything to relative paths, that should not be necessary. ÂAt this point I think we're basically there. Â If you wanted you could keep fine-tuning until you got the sizing so that the noteheads would be the right height for the staff with only scaling by a factor of 10, but it's not strictly necessary to do so, the numbers would just be simpler that way and you'd have more "mathematical certainty that your notes were the right height. Â But you can also just judge this by sight.
ÂBelow I've given a sense of what they will look like on the staff by overriding the note head stencil with them. Â They're still a little big at this level of scaling, but you can adjust this by changing the values for ly:stencil-scale. ÂSo if you're happy with how they're turning out, feel free to go ahead with the other noteheads at this point.
Great. It feels like Lilypond party here :-)
My conclusion is that I should leave it relative then.
On the cropping, I was thinking of cropping the files in Illustrator before exporting as SVG.  But now that we can easily convert everything to relative paths, that should not be necessary. ÂAt this point I think we're basically there.  If you wanted you could keep fine-tuning until you got the sizing so that the noteheads would be the right height for the staff with only scaling by a factor of 10, but it's not strictly necessary to do so, the numbers would just be simpler that way and you'd have more "mathematical certainty that your notes were the right height.  But you can also just judge this by sight.I can do that if you think it helps. Are we talking about the scaling factor represented by the two numbers at the end of the snippet (.1 - .1)? I assume that this is what you mean by factor of 10.
So I should scale it down a bit more so the sizes of the new noteheads match the standard noteheads in Lilypond when using (.1 -1) scaling. Is that correct or am I still missing something?
Looks good (just have to make them smaller). I just want to make sure I do it correctly before I will convert the rest.Thanks!
  \override StaffSymbol.ledger-extra = 2
On the clef SVG thing, the text file does look like it has some path data in it, but lets see if Jan can help with how to get your font into Illustrator where you can see the glyphs there as you'd expect...
;; express-stave-change
;; 6-6 slant pattern
(if (= 0 (modulo (+ semi cfill) 2))
(set! (ly:grob-property grob 'rotation) '(-30 0 0))
(set! (ly:grob-property grob 'rotation) '(10 0 0))
))
Â
then deleted the "not". Nothing happened.
Â
Then i just deleted the If part and the wholenotes rotated but not by the right amounts, it will have to be different than for the other noteheads.
Â
Sorry to hassle you with all this! Im too impatient to try to work through all the tutorials. Prefer to just look at the code and get some insight. :)
Â
Thanks again,
John K
----- Original Message -----From: Paul Morris
--
----- Original Message -----From: Jan Braunstein
Sent: Tuesday, January 14, 2014 2:11 PMSubject: [MNP] Re: Intervals in Express Stave
--
On Tuesday, January 14, 2014 8:18:03 AM UTC+1, John Keller wrote:Hi Jan,ÂYes Im biting the bullet! Im worried that Finale will not support my conversion method in the future. I have been successful using 2006 version, but more recent versions changed the percussion maps so you cannot simply specify each midi pitch as a notehead and staff position, you have to specify 88 percussion instruments!
ÂI have a lot of piano music transnotated, some of it is in my Wiki.ÂI hope we can both find how to get custom clefs into LilyPond, and Paul advised it better to design the stencil within LP rather than using a custom font which people would have to install.
ÂIm not ready to try fiddling with snippets yet because I couldnt get the text file which looked like SVG coordinates to actually show the image. I might have missed the bit about finding an SVG conversion tool online.ÂMy Illustrator has never worked, it always just showed text, not an image.ÂJohn K
From: Jan Braunstein

From: Paul Morris
--

Thanks for all your work so far. Im quite keen to try to learn the programming for AN systems myself now, so where do I start? Is it all in the same LP website as learning to input music?Â(How did you learn it?)
I have been going through the tutorials. It seems straight forward, but incomplete. Eg they dont have a table of functions and syntax ...ÂI couldnt find anywhere you can just search for what, say "r" or "grob"Â means (rest and graphic object). I gather "s" means an invisible rest, right?, and c' is middle C -Â but where does it tell you these things??
In going through your ily code I want to know the commands/functions etc. Where can I search for the meaning and syntax of these constructions?
% NOTE HEADS AND STEM ATTACHMENT
%
#(define (customNoteHeads cfill xmod ymod)
  (lambda (grob)
   (let* ((fsz  (ly:grob-property grob 'font-size 0.0))
      (mult (magstep fsz))
      (ptch (ly:event-property (event-cause grob) 'pitch))
      (semi (ly:pitch-semitones ptch))
;; JK Questions:
;; 1. Can you explain this custom notehead construction above?Â
;; PM: I'm defining a function in scheme called "customNoteHeads that takes three arguments:Â
;; cfill is a boolean, either 0 or 1, indicating if the note c is to be filled or hollow
;; xmod ymod are values that are used to scale the note head stencil in the x and y axis directions;
;; when the function is called (by the staff definition code below) certain values are passed to it for these three arguments
;; grob is a reference to the note head grob, which contains properties we will need and settings we may want to change
;; lambda begins a generic, unnamed function that takes grob as an argument, (as best I understand it)
;; let* defines a series of variables in order and then does some operation with them and returns a value and/or sets properties
;; fsz is a variable that stores the current fontsize, retrieving it from the grob's 'fontsize property
;; mult is the amount you want to multiply things by for them to match the current fontsize,Â
;; magstep does some transformation on fontsize that's necessary (I don't remember what or why...)
;; ptch stores the pitch of the note, retrieving it from the event property of the event that caused the grob
;; semi is the pitch in semitones
;; 2. What does the sharp or hash sign  # mean?
;; PM: that signals a shift from LilyPond code to scheme code
;; 3. And why does ;; indicate comments here and not the %{ construct I read about?
;; PM:  in LilyPond code % or %{ %} are for comments, in Scheme code it's ;; and  #!  !#
;; Thanks Paul!
Ok, I will need to find some time to sit down and write some code just for Express Stave. Â Since it combines the 6-6 and 7-5 patterns there are four types of note heads (solid/hollow x slanted/flat), each of which will need their own settings to look right, and the code I've written is only set up to handle two types of note heads. Â
From: Paul Morris
--
ÂThanks for this, I suspect you set me a little test!
ÂI had to change the Boolian values for both the 7/5 black and white coding and the 6/6 notehead rotation to get the right conditions.
I havent found the stem connections this time but they are not too bad.
It looks as though a lot of the code is for ClaireNote and not relevant to Express Stave. I wonder if I can just delete these sections?
One question: Can the oval noteheads be scaled diagonally, so that the sloping notes are a little slimmer so as to not look weightier than the flat small notes (without altering their height and width)?
 thanks again for all your help!
----- Original Message -----From: Paul MorrisSent: Thursday, January 16, 2014 3:39 AMSubject: Re: [MNP] Re: Intervals in Express Stave
--
I tried to add this function (ly:stencil-translate stil offset) to the
slanted wholenote, keeping the same syntax as the ly:stencil-scale. I tried
the "pair of numbers" both with and without brackets. Nothing worked.Â
And when I commented the additions out, the whole file went pink as though
it was all in error! On the next try just the (cond  on line 107 went pink
and gave an error message. I dont understand why adding stuff but then
commenting it out would change the file to give an error.
 ((and slanted-note? whole-note?)
----- Original Message -----From: Paul MorrisSent: Friday, January 17, 2014 7:38 AMSubject: Re: [MNP] Intervals in Express Stave
--
I got stem attachments right for individual noteheads, but for chords it seems the attachments dont work except the note at the end of the stem. I think the notehead alignment in chords must supercede the stem attachments. But Ill keep on fiddling with it.
From: Paul MorrisSent: Saturday, January 18, 2014 2:44 AMSubject: Re: [MNP] Intervals in Express Stave
--