Error message unexpected \new

A \score block must contain a single music expression. If instead it contains several \new Staff, \new StaffGroup or similar contexts introduced with \new without them being enclosed in either curly brackets, { … }, or double angle brackets, << … >>, like this:

\score {
  % Invalid! Generates error: syntax error, unexpected \new
  \new Staff { … }
  \new Staff { … }
}

the error message will be produced.

To avoid the error, enclose all the \new statements in curly or double angle brackets.

Using curly brackets will introduce the \new statements sequentially:

\score {
  {
    \new Staff { a' a' a' a' }
    \new Staff { g' g' g' g' }
  }
}

[image of music]

but more likely you should be using double angle brackets so the new staves are introduced in parallel, i.e., simultaneously:

\score {
  <<
    \new Staff { a' a' a' a' }
    \new Staff { g' g' g' g' }
  >>
}

[image of music]


LilyPond Application Usage v2.25.21 (development-branch).