In the lilypond files, when you define a score, there are times to use << >> and times to use { } but this is very confusing to me. Sometimes examples use both, sometimes one or the other.

What is the proper usage of these symbols?


Well, there are two parts of the question. First, there is structuring, where the \score typically uses << ... >> everywhere, because you e.g. want voices simultaneously, right? I won't go into details here that much

Then there's staffs and things inside staffs, in which you think of << ... >> as a "block builder"; it's as wide as the widest thing inside, and stacks as many things over each other as you wish.

So, for instance these two things are equivalent:

<< { e s g } { c d e f } >> g a
<e c> d <g e> f g a

Also, these two things are equivalent (shows the usage of \\):

<< { e f r a } \\ { c d e f } >>
\new Voice { \voiceOne e f r a }
\new Voice { \voiceTwo c d e f }

You can also combine these things as you wish; these two codes also do the same:

<< { e f g } \\ { c d << { e f } { c d } >> } >>
\new Voice { \voiceOne e f g }
\new Voice { \voiceTwo c d <e c> <f d> }

A ‘simultaneous’ music expression is formed by enclosing expressions inside << and >>.

{ … } Encloses a sequential segment of music.

See the docs here on music expressions

  • My main objective in asking was that sometimes you have << inside { and vice versa. But they are not completely interchangable.
    – bgmCoder
    Mar 7 '18 at 16:23
  • They are not interchangeable at all. Think {<<>><<>>} is a sequence of two simultaneous, whist <<{}{}>> is a smultaneous of two sequences. Let AA={c' d' e'} BB={e' f' g'} CC={a' b' c''} DD={c'' d'' e''} and then compare {<<\AA \BB>> <<\CC \DD>>} to <<{\AA \BB} {\CC \DD}>>
    – Paco Vila
    Mar 8 '18 at 12:04
  • Better yet, and much simpler, just compare { c' d' } to << c' d' >>
    – Paco Vila
    Mar 8 '18 at 12:11
  • So, the only time I would ever use << >> is for simultaneous music? I think I was getting the { } confused when it is used for grouping music as opposed to grouping commands.
    – bgmCoder
    Mar 14 '18 at 18:18
  • <<>> is for simultaneous music or commands only and { } is for sequential music or commands only. The result is a single expression. Beware, some commands don't mind if you put them simultaneous or sequential, but sometimes you'll obtain spureous implicit staves if the command is simultaneous to other explicit staves. For example \new PianoStaff << \clef bass \new Staff { c' } >> produces two staves, not one.
    – Paco Vila
    Mar 16 '18 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.