lilypond-user
[Top][All Lists]
Advanced

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

Re: compiling times?


From: Mats Bengtsson
Subject: Re: compiling times?
Date: Mon, 12 Sep 2005 12:40:01 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511



Jay Hamilton, Sound and Silence wrote:
Mats- It was not until I actually could get an error log that I could start to fix the file. However you have brought up a couple of things. Last -first by changing the \score to new Staff from context I am now able to get midi and pdf files to look at what it going on. I am getting something odd in the pdf re; the piano parts don't have staff lines and there is an extra clef sign above the piano brace.
So there is something I am missing about entering a piano setup--

So to the first comment about defining an instrument twice- could you explain that? I copied the 'code' directly from the jazz combo section of the manual, if that is giving us redundancy or misleading then how does one fix that?


Mats Bengtsson wrote:

flute = \relative c' {
   \Key
   c1 c c
}

flute = [
\global
\set Staff.instrument = #"Flute"
\clef treble
\context Staff <<
\flute
 >>
}



Here, you provide two different definitions of \flute.
Even though LilyPond actually does what you want, I wouldn't
consider it a particularly good idea.

This is the part of your message I didn't understand.


First of all, I don't really see the point of separating the
clef and Midi instrument settings from the actual music.
I'd rather do

flute = \relative c' {
  \global
  \set Staff.instrument = #"Flute"
  \clef treble
   \Key
   c1 c c
}


If you for some reason want to keep these aspects separated, I rather
put all the things together directly in the \score block, than
introducing more identifiers:

flute = \relative c' {
   \Key
   c1 c c
}

\score {
   <<
   \context Staff = flute {
      \global
      \set Staff.instrument = #"Flute"
      \clef treble
      \flute
   }
  ...

  >>
}


However, my initial reaction was primarily on the fact that you
used the same identifier name twice:
flute = {...}
flute = {... \flute ...}

The Jazz combo template rather does something like
flt = {...}
flute = {... \flt ...}

which is more clear since there is no possibility to mistake which
definition of \flute actually is used. Actually, your code does
work, but unless you are 100% sure yourself why it works, I don't
recommend it.

Here is the Piano section as I typed it in


%piano parts
rh = \relative c' {
   \Key
   c1 c c
}
lh = \relative c {
   \Key
   c1 c c
}
PianoRH = {
   \clef treble
   \global
   \set Staff.midiInstrument = "acoustic grand"
}
PianoLH = {
   \clef bass
   \global
   \set Staff.midiInstrument = "acoustic grand"
}

Maybe you should include \rh and \lh somewhere? They are never used!

piano = {
   \context PianoStaff <<
   \set PianoStaff.instrument = #"Piano"
   \context Staff = upper \PianoRH
   \context Staff = lower \PianoLH
   >>
}

but as I wrote above this produces no staff lines from the brace and an extra treble clef above the piano part with no label.
So either something is extra here or mistyped but not an 'error'.

The problem is rather within the \score block, where you do
   \context Staff = piano \piano
which explicitly creates a Staff context. Since you then create a
PianoStaff and a PianoStaff cannot be included within a Staff,
you get the extra empty stave.

This is another reason I don't like to spread out the creation of
contexts in a lots of different identifiers all over the file.
If you keep all \new ... and \context ... within the \score block,
as in the second proposal above, then you will find it much easier
to actually understand the full structure and figure out what is
going on.


    /Mats




reply via email to

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