Bill Moran wrote:
I'm not top-posting
How do I get initial grace note after time and key signatures?
A short example:
%}
\version "2.12.0" % necessary for upgrading to future LilyPond versions.
\header{
title = "Initial grace note test"
}
global= {
\time 4/4
\key f \major
}
Flute = \new Voice \relative c'' {
\set Staff.instrumentName = #"Flute "
\clef treble
\grace { a'8 }
a'16 r r r r4 r2 \bar ":|"
}
\score {
\new StaffGroup <<
\new Staff << \global \Flute >>
>>
\layout { }
\midi { }
}
I'm trying to start a piece with a grace note (or accacciatura) but the grace
note always comes before the time and key signatures. For that matter,
there's an extra time signature too!
Thanks very much - Bill Moran
bill at billbassoon.com
Hi Bill,
I can't say I understand exactly *why* this is, but the "\new Voice"
command in the Flute variable seems to be at least partly at fault.
Normally the explicit creation of voices with this command is done in
the \score block, and when I changed your code to do it this way it
fixed the grace-note problem. Someone who really understands Lilypond
internals can correct me if I'm wrong, but I think your original code is
telling Lilypond to create a new voice right after it has already
created a new voice, because when you give the
\new Staff << \global \Flute >>
command, it knows to create a voice into which it will put everything,
so the new voice already exists by the time you get to the \global
command, and the \Flute variable is telling it to put another new voice.
If you remove the \new voice from your Flute variable and put it in
the \score block it will work:
\version "2.12.0"
\header{
title = "Initial grace note test"
}
global= {
\time 4/4
\key f \major
}
Flute = \relative c'' {
\set Staff.instrumentName = #"Flute "
\clef treble
\grace { a'8 }
a'16 r r r r4 r2 \bar ":|"
}
\score {
\new StaffGroup <<
\new Staff <<
\new Voice = "flute" {
\global \Flute
}
>>
>>
\layout { }
\midi { }
}
HTH,
Jon
--
Jonathan Kulp
http://www.jonathankulp.com
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user