### 1.3.1 Attached to notes

This section explains how to create expressive marks that are attached to notes: articulations, ornamentations, and dynamics. Methods to create new dynamic markings are also discussed.

#### Articulations and ornamentations

A variety of symbols that denote articulations, ornamentations, and other performance indications can be attached to a note using this syntax:

```note\name
```

The possible values for name are listed in List of articulations. For example:

```c4\staccato c\mordent b2\turn
c1\fermata
```

Some of these articulations have shorthands for easier entry. Shorthands are appended to the note name, and their syntax consists of a dash `-` followed by a symbol signifying the articulation. Predefined shorthands exist for marcato, stopped, tenuto, staccatissimo, accent, staccato, and portato. Their corresponding output appears as follows:

```c4-^  c-+  c--  c-|
c4->  c-.  c2-_
```

The rules for the default placement of articulations are defined in ‘scm/script.scm’. Articulations and ornamentations may be manually placed above or below the staff, see Direction and placement.

#### Selected Snippets

Modifying default values for articulation shorthand notation

The shorthands are defined in ‘ly/script-init.ly’, where the variables `dashHat`, `dashPlus`, `dashDash`, `dashBar`, `dashLarger`, `dashDot`, and `dashUnderscore` are assigned default values. The default values for the shorthands can be modified. For example, to associate the `-+` (`dashPlus`) shorthand with the trill symbol instead of the default + symbol, assign the value `trill` to the variable `dashPlus`:

```\relative c'' { c1-+ }
dashPlus = "trill"
\relative c'' { c1-+ }
```

Controlling the vertical ordering of scripts

The vertical ordering of scripts is controlled with the `'script-priority` property. The lower this number, the closer it will be put to the note. In this example, the `TextScript` (the sharp symbol) first has the lowest priority, so it is put lowest in the first example. In the second, the prall trill (the `Script`) has the lowest, so it is on the inside. When two objects have the same priority, the order in which they are entered determines which one comes first.

```\relative c''' {
\once \override TextScript #'script-priority = #-100
a2^\prall^\markup { \sharp }

\once \override Script #'script-priority = #-100
a2^\prall^\markup { \sharp }
}
```

Creating a delayed turn

Creating a delayed turn, where the lower note of the turn uses the accidental, requires several overrides. The `outside-staff-priority` property must be set to `#f`, as otherwise this would take precedence over the `avoid-slur property`. The value of `halign` is used to position the turn horizontally.

```\relative c'' {
\once \override TextScript #'avoid-slur = #'inside
\once \override TextScript #'outside-staff-priority = ##f
c2(^\markup \tiny \override #'(baseline-skip . 1) {
\halign #-4
\center-column {
\sharp
\musicglyph #"scripts.turn"
}
}
d4.) c8
}
```

Music Glossary: tenuto, accent, staccato, portato.

Notation Reference: Direction and placement, List of articulations, Trills.

Installed Files: ‘scm/script.scm’.

Snippets: Expressive marks.

Internals Reference: Script, TextScript.

#### Dynamics

Absolute dynamic marks are specified using a command after a note, such as `c4\ff`. The available dynamic marks are `\ppppp`, `\pppp`, `\ppp`, `\pp`, `\p`, `\mp`, `\mf`, `\f`, `\ff`, `\fff`, `\ffff`, `\fp`, `\sf`, `\sff`, `\sp`, `\spp`, `\sfz`, and `\rfz`. The dynamic marks may be manually placed above or below the staff, see Direction and placement.

```c2\ppp c\mp
c2\rfz c^\mf
c2_\spp c^\ff
```

A crescendo mark is started with `\<` and terminated with `\!`, an absolute dynamic, or an additional crescendo or decrescendo mark. A decrescendo mark is started with `\>` and is also terminated with `\!`, an absolute dynamic, or another crescendo or decrescendo mark. `\cr` and `\decr` may be used instead of `\<` and `\>`. Hairpins are engraved by default using this notation.

```c2\< c\!
d2\< d\f
e2\< e\>
f2\> f\!
e2\> e\mp
d2\> d\>
c1\!
```

Spacer rests are needed to engrave multiple marks on one note.

```c4\< c\! d\> e\!
<< f1 { s4 s4\< s4\> s4\! } >>
```

In some situations the `\espressivo` articulation mark may be the appropriate choice to indicate a crescendo and decrescendo on one note:

```c2 b4 a
g1\espressivo
```

Crescendos and decrescendos can be engraved as textual markings instead of hairpins. Dashed lines are printed to indicate their extent. The built-in commands that enable these text modes are `\crescTextCresc`, `\dimTextDecresc`, `\dimTextDecr`, and `\dimTextDim`. The corresponding `\crescHairpin` and `\dimHairpin` commands will revert to hairpins again:

```\crescTextCresc
c2\< d | e f\!
\dimTextDecresc
e2\> d | c b\!
\crescHairpin
c2\< d | e f\!
\dimHairpin
e2\> d\!
```

To create new absolute dynamic marks or text that should be aligned with dynamics, see New dynamic marks.

Vertical positioning of dynamics is handled by DynamicLineSpanner.

#### Predefined commands

`\dynamicUp`, `\dynamicDown`, `\dynamicNeutral`, `\crescTextCresc`, `\dimTextDim`, `\dimTextDecr`, `\dimTextDecresc`, `\crescHairpin`, `\dimHairpin`.

#### Selected Snippets

Setting hairpin behavior at bar lines If the note which ends a hairpin falls on a downbeat, the hairpin stops at the bar line immediately preceding. This behavior can be controlled by overriding the `'to-barline` property.

```\relative c'' {
e4\< e2.
e1\!
\override Hairpin #'to-barline = ##f
e4\< e2.
e1\!
}
```

Setting the minimum length of hairpins

If hairpins are too short, they can be lengthened by modifying the `minimum-length` property of the `Hairpin` object.

```\relative c'' {
c4\< c\! d\> e\!
\override Hairpin #'minimum-length = #5
<< f1 { s4 s\< s\> s\! } >>
}
```

Printing hairpins using al niente notation

Hairpins may be printed with a circled tip (al niente notation) by setting the `circled-tip` property of the `Hairpin` object to `#t`.

```\relative c'' {
\override Hairpin #'circled-tip = ##t
c2\< c\!
c4\> c\< c2\!
}
```

Vertically aligned dynamics and textscripts

By setting the `'Y-extent` property to a suitable value, all `DynamicLineSpanner` objects (hairpins and dynamic texts) can be aligned to a common reference point, regardless of their actual extent. This way, every element will be vertically aligned, thus producing a more pleasing output.

The same idea is used to align the text scripts along their baseline.

```music = \relative c'' {
c2\p^\markup { gorgeous } c\f^\markup { fantastic }
c4\p c\f\> c c\!\p
}

{
\music \break
\override DynamicLineSpanner #'Y-extent = #'(-1.5 . 1.5)
\override TextScript #'Y-extent = #'(-1.5 . 1.5)
\music
}
```

Hiding the extender line for text dynamics

Text style dynamic changes (such as cresc. and dim.) are printed with a dashed line showing their extent. This line can be suppressed in the following way:

```\relative c'' {
\override DynamicTextSpanner #'dash-period = #-1.0
\crescTextCresc
c1\< | d | b | c\!
}
```

Changing text and spanner styles for text dynamics

The text used for crescendos and decrescendos can be changed by modifying the context properties `crescendoText` and `decrescendoText`. The style of the spanner line can be changed by modifying the `'style` property of `DynamicTextSpanner`. The default value is `'hairpin`, and other possible values include `'line`, `'dashed-line` and `'dotted-line`:

```\relative c'' {
\set crescendoText = \markup { \italic { cresc. poco } }
\set crescendoSpanner = #'text
\override DynamicTextSpanner #'style = #'dotted-line
a2\< a
a2 a
a2 a
a2 a\mf
}
```

Music Glossary: al niente, crescendo, decrescendo, hairpin.

Learning Manual: Articulation and dynamics.

Snippets: Expressive marks.

Internals Reference: DynamicText, Hairpin, DynamicLineSpanner.

#### New dynamic marks

The easiest way to create dynamic indications is to use `\markup` objects.

```moltoF = \markup { molto \dynamic f }

\relative c' {
<d e>16_\moltoF <d e>
<d e>2..
}
```

In markup mode, editorial dynamics (within parentheses or square brackets) can be created. The syntax for markup mode is described in Formatting text.

```roundF = \markup { \center-align \concat { \bold { \italic ( }
\dynamic f \bold { \italic ) } } }
boxF = \markup { \bracket { \dynamic f } }
\relative c' {
c1_\roundF
c1_\boxF
}
```

Simple, centered dynamic marks are easily created with the `make-dynamic-script` function. The dynamic font only contains the characters `f,m,p,r,s` and `z`.

```sfzp = #(make-dynamic-script "sfzp")
\relative c' {
c4 c c\sfzp c
}
```

In general, `make-dynamic-script` takes any markup object as its argument. In the following example, using `make-dynamic-script` ensures the vertical alignment of markup objects and hairpins that are attached to the same note head.

```roundF = \markup { \center-align \concat {
\normal-text { \bold { \italic ( } }
\dynamic f
\normal-text { \bold { \italic ) } } } }
boxF = \markup { \bracket { \dynamic f } }
roundFdynamic = #(make-dynamic-script roundF)
boxFdynamic = #(make-dynamic-script boxF)
\relative c' {
c4_\roundFdynamic\< d e f
g,1_\boxFdynamic
}
```

The Scheme form of markup mode may be used instead. Its syntax is explained in Markup construction in Scheme.

```moltoF = #(make-dynamic-script
(markup #:normal-text "molto"
#:dynamic "f"))
\relative c' {
<d e>16 <d e>
<d e>2..\moltoF
}
```

Font settings in markup mode are described in Selecting font and font size.