lilypond-user
[Top][All Lists]
Advanced

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

RE: Staff error


From: tisimst
Subject: RE: Staff error
Date: Tue, 30 Dec 2014 11:19:16 -0700 (MST)

Mark Stephen Mrotek wrote
> Putting each in a separate \score block compiles. I do not know if that is
> the only, or best solution.

 

They do, but that's certainly not the only NOR best solution. The real
reason it gives you an error is because \score expects a single compound
expression for the music (i.e., the second \new starts another compound
expression). I've noticed that putting staves in serial (as you are doing
here) can have certain buggy behavior (though I can't see anything
inherently wrong with that way of doing things, so it probably shouldn't).
When I need to do something like this, I like to put the staves in parallel
and hide the empty ones. Here's how I do it and so far I've never had a
problem getting exactly what I want:

%<-------------- SNIP ----------------

parts = \new ChoirStaff <<
  \new Staff {
    \relative c'' { 
      c4 d e f |
      
      \break % <-- you can decide if you want these, but they might help

      s1 | % <-- add more spacers (or rests) here to match interlude
duration

      \break % <--

      \clef "bass" 
      d,,4 e f g |
    }
  }
  \new Staff {
    \relative c'' { 
      g4 a b c |

      s1 | % <-- add spacers (or rests) here, to match interlude duration

      \clef "bass" 
      a,,4 b c d |
    }
  }
>>    

interlude = \new Staff {
  \relative c'' { 

    s1 | % <-- add spacers (or rests) here, to match parts duration prior to
interlude

    c4 d e f |

    % no need to add anything else beyond here
  }
}

\score {
  <<  % <-- Now the parts are in parallel
    \parts
    \interlude
  >>
  \layout{
    % to match your original output, you'll want these, but they aren't
critical
    indent = 0
    ragged-right = ##t 

    % here's where the magic happens
    \context {
      \Staff
      \RemoveEmptyStaves
      \override VerticalAxisGroup #'remove-first = ##t 
    }
  }
}

%<-------------- SNIP ----------------

As Mark stated, this also isn't the ONLY or probably best solution, but it
works great!

HTH,
Abraham



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Staff-error-tp169927p169929.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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