Discussion:
smaller grace notes
MarcM
2013-11-21 17:16:50 UTC
Permalink
I find the default size of grace notes and Acciaccatura a bit too big.
How can i change the default size?
I took a look ly/grace-init.ly but there is nothing about size.



--
View this message in context: http://lilypond.1069038.n5.nabble.com/smaller-grace-notes-tp154236.html
Sent from the User mailing list archive at Nabble.com.
Gilberto Agostinho
2013-11-21 18:45:37 UTC
Permalink
Try this: grace_notes_with_smaller_noteheads.ly
<http://lilypond.1069038.n5.nabble.com/file/n154241/grace_notes_with_smaller_noteheads.ly>

Which produces this:

<Loading Image...>

You can play around with the value (I used -5), and you can also add other
overrides and tweaks there. Probably this isn't the most elegant solution,
but it gets the job done ;)

Regards,
Gilberto



--
View this message in context: http://lilypond.1069038.n5.nabble.com/smaller-grace-notes-tp154236p154241.html
Sent from the User mailing list archive at Nabble.com.
MarcM
2013-11-22 02:08:49 UTC
Permalink
The example looks really nice. It appears that only the NoteHead size is
reduced.
Would you know how to have the hight of the Stem and the Beam change
proportionally as well?

I tried the code below but it did not have any effect on the stem and the
Beam.

startGraceMusic = {
\override NoteHead.font-size = -6
\override Stem.font-size = -6
\override Beam.font-size = -6
}



--
View this message in context: http://lilypond.1069038.n5.nabble.com/smaller-grace-notes-tp154236p154249.html
Sent from the User mailing list archive at Nabble.com.
Gilberto Agostinho
2013-11-22 03:03:07 UTC
Permalink
Hello Marc,

I am glad you liked that little code. I tweaked it a bit more, and now I
think it looks better. I simply added these lines to each one of the four
types of graces:

\override Flag.font-size = -5
\override Stem.length = 3.7
\override Beam.beam-thickness = 0.35

Also, for the appoggiaturas and acciaccaturas, I added the following lines:

\shape #'((0 . 0.2) (0 . 0) (0 . 0) (0 . 0)) Slur
\override Slur.height-limit = 1

The first line brings the slurs slightly closer to the noteheads (since they
are smaller now, this makes it look better). The second line avoid a slur
that is too extended in the Y-axis.

* * *

A hint: when looking for which options can be tweaked or overridden, it is
always helpful to search for the interface options. For instance, in the
"beam-interface" page
(http://www.lilypond.org/doc/v2.16/Documentation/internals/beam_002dinterface),
you will find that ther eis an option named "beam-thickness" defined as:

beam-thickness (dimension, in staff space): Beam thickness, measured in
staff-space units.

* * *

So here is the updated code: grace_notes_with_smaller_noteheads.ly
<http://lilypond.1069038.n5.nabble.com/file/n154251/grace_notes_with_smaller_noteheads.ly>

And here are the results:

<Loading Image...>

Take care,
Gilberto



--
View this message in context: http://lilypond.1069038.n5.nabble.com/smaller-grace-notes-tp154236p154251.html
Sent from the User mailing list archive at Nabble.com.
Gilberto Agostinho
2013-11-22 05:12:51 UTC
Permalink
Still some improvements: things look better with the following settings:

\override NoteHead.font-size = -5
\override Flag.font-size = -5
\override Stem.length = 4
\override Beam.beam-thickness = 0.3
\override Beam.length-fraction = 0.5
\override Beam.shorten = 1

Now the beams look much better, and when they are horizontal, they match the
staff lines.

grace_notes_with_smaller_noteheads.ly
<http://lilypond.1069038.n5.nabble.com/file/n154255/grace_notes_with_smaller_noteheads.ly>

Result:

<Loading Image...>

Gilberto



--
View this message in context: http://lilypond.1069038.n5.nabble.com/smaller-grace-notes-tp154236p154255.html
Sent from the User mailing list archive at Nabble.com.
David Kastrup
2013-11-22 07:38:00 UTC
Permalink
Post by MarcM
The example looks really nice. It appears that only the NoteHead size is
reduced.
Would you know how to have the hight of the Stem and the Beam change
proportionally as well?
I tried the code below but it did not have any effect on the stem and the
Beam.
startGraceMusic = {
\override NoteHead.font-size = -6
\override Stem.font-size = -6
\override Beam.font-size = -6
}
That kind of stuff is better done using add-grace-property I think.
--
David Kastrup
Gilberto Agostinho
2013-11-22 15:40:58 UTC
Permalink
Thanks David! Indeed this code looks way more elegant (and smaller) using
add-grace-property.

grace_notes_with_smaller_noteheads_(elegant_solution).ly
<http://lilypond.1069038.n5.nabble.com/file/n154278/grace_notes_with_smaller_noteheads_%28elegant_solution%29.ly>

Take care,
Gilberto



--
View this message in context: http://lilypond.1069038.n5.nabble.com/smaller-grace-notes-tp154236p154278.html
Sent from the User mailing list archive at Nabble.com.
MarcM
2013-11-23 04:57:23 UTC
Permalink
*1) I noticed a strange side-effect: if i change
* $(add-grace-property 'Voice 'Stem 'length '8)

It only applies to single grace notes:
<Loading Image...>

2) I found the right size for the flag but it is still too thick. Is there a
way to reduce the thickness of the flag in the grace note?

This is what i get in Lilypond:
<Loading Image...>

And this is the original:
<Loading Image...>

grace_notes_Smaller_v2_(elegant_solution).ly
<http://lilypond.1069038.n5.nabble.com/file/n154288/grace_notes_Smaller_v2_%28elegant_solution%29.ly>







--
View this message in context: http://lilypond.1069038.n5.nabble.com/smaller-grace-notes-tp154236p154288.html
Sent from the User mailing list archive at Nabble.com.
Gilberto Agostinho
2013-11-23 14:48:52 UTC
Permalink
Hi Marc,

If you use $(add-grace-property 'Voice 'Stem 'length '8), it will change
only the non beamed stems, as you realized. To change both, use
$(add-grace-property 'Voice 'Stem 'length-fraction '0.7). Note that the
beamed stems are changed only to the nearest staff line position, not
continuously.

You can also combine both, such as in:

$(add-grace-property 'Voice 'Stem 'length '4)
$(add-grace-property 'Voice 'Stem 'length-fraction '0.7)

As for the thickness of the flags, unfortunately I do not know the answer
nor could I find anything about it on the reference.

Take care,
Gilberto



--
View this message in context: http://lilypond.1069038.n5.nabble.com/smaller-grace-notes-tp154236p154301.html
Sent from the User mailing list archive at Nabble.com.
Eluze
2013-11-23 22:49:20 UTC
Permalink
MarcM wrote
*
*
Post by MarcM
I found the right size for the flag but it is still too thick. Is there a
way to reduce the thickness of the flag in the grace note?
maybe /Generating custom flags/ in snippets
<http://lilypond.org/doc/v2.17/Documentation/snippets-big-page.html> is an
approach!?

Eluze



--
View this message in context: http://lilypond.1069038.n5.nabble.com/smaller-grace-notes-tp154236p154306.html
Sent from the User mailing list archive at Nabble.com.
MarcM
2013-11-24 04:07:12 UTC
Permalink
That is an interesting but complex snippet which looks like a nuclear option
for what I need: changing the thickness of the flag or at least the
thickness of the slash. I went through the multiple scan of the code with
grep to try to find where the default values are set and I was not able to
find it.

Multiple snippets i have seen replace the stencil and draw another slash or
flag. Isn't there a way to change the thickness of the slash using
add-grace-property?
$(add-grace-property 'Voice 'Flag 'font-size '-5)
$(add-grace-property 'Voice 'Stem 'length '3.5)
$(add-grace-property 'Voice 'Stem 'thickness '0.8)




--
View this message in context: http://lilypond.1069038.n5.nabble.com/smaller-grace-notes-tp154236p154310.html
Sent from the User mailing list archive at Nabble.com.

Continue reading on narkive:
Loading...