LilyPond Learning Manual: 3.1.4 On the un-nestedness of brackets and ties

### 3.1.4 On the un-nestedness of brackets and ties

You have already met a number of different types of bracket and bracket-like constructs in writing the input file to LilyPond. These obey different rules which can be confusing at first. Let’s first review the different types of brackets and bracket-like constructs.

Bracket Type | Function
--- | ---
`{ .. }` | Encloses a sequential segment of music
`< .. >` | Encloses the notes of a chord
`<< .. >>` | Encloses simultaneous music expressions
`( .. )` | Marks the start and end of a slur
`\( .. \)` | Marks the start and end of a phrasing slur
`[ .. ]` | Marks the start and end of a manual beam

To these we should add other constructs which generate lines between or across notes: ties (marked by a tilde, `~`), tuplets written as `\times x/y {..}`, and grace notes written as `\grace{..}`.

Outside LilyPond, the conventional use of brackets requires the different types to be properly nested, like this, `<< [ { ( .. ) } ] >>`, with the closing brackets being encountered in exactly the opposite order to the opening brackets. This is a requirement for the three types of bracket described by the word ‘Encloses’ in the table above – they must nest properly. However, the remaining bracket-like constructs, described with the word ‘Marks’ in the table above together with ties and tuplets, do not have to nest properly with any of the brackets or bracket-like constructs. In fact, these are not brackets in the sense that they enclose something – they are simply markers to indicate where something starts and ends.

So, for example, a phrasing slur can start before a manually inserted beam and end before the end of the beam – not very musical, perhaps, but possible:

>     g8\( a b[ c b\) a] g4

In general, different kinds of brackets, bracket-like constructs, and those implied by tuplets, ties and grace notes, may be mixed freely. This example shows a beam extending into a tuplet (line 1), a slur extending into a tuplet (line 2), a beam and a slur extending into a tuplet, a tie crossing two tuplets, and a phrasing slur extending out of a tuplet (lines 3 and 4).

>     r16[ g \times 2/3 { r16 e'8] }
>     g,16( a \times 2/3 { b16 d) e }
>     g,8[( a \times 2/3 { b8 d) e~] } |
>     \times 4/5 { e32\( a, b d e } a4.\)

其它语言：česky, deutsch, español, français, magyar, italiano, 日本語, nederlands。

#### LilyPond — Learning Manual