lilypond-user
[Top][All Lists]
Advanced

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

Re: How do I get initial grace note after time and key signatures?


From: Jonathan Kulp
Subject: Re: How do I get initial grace note after time and key signatures?
Date: Mon, 16 Feb 2009 23:12:49 -0600
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

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




reply via email to

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