Dynamics and text annotations¶
This document defines the syntax and semantics of the dynamics line
D) in neumaRk: element vocabulary, alignment to musical events, syntax
of text annotations, extension rules and diagnostics.
The D) line is the annotation band below the staff: it hosts the
traditional dynamic markings (p, mf, ff, hairpins, cresc./dim.)
and — consistently with jazz/lead-sheet practice — also text
annotations anchored to musical events (e.g. "drums fill", "freely",
"w synth") or to measure barlines (e.g. "Vamp till cue").
1. Definition¶
The D) line is an optional music line of the datapack
(neumaRk_datapack.md §3, note group) that describes below-staff events
aligned by position to the events of the parent N) line.
There are two orthogonal classes of elements in D):
- Note-anchored elements — tokens in 1:1 correspondence with the
notes of the parent
N)line (orN2). The principal class. - Barline-anchored elements — text annotations anchored to the beginning or the end of a measure, independently of the internal note events.
The two classes coexist on the same line: barline-anchored ones are recognizable by adjacency to a composite barline border; note-anchored ones are all the other tokens.
2. Structural position and binding¶
The D) line follows the general rules of the voice group
(neumaRk_datapack.md §3, note group, and neumaRk_voices.md §3.1):
[A)] N)|N2|N+ [D)] [L)]
- it is optional; it may appear at most once per voice group;
- it is bound to the
N)/N+/N2line immediately preceding; - it follows the same measure barlines (
|,||,:|,|:, etc.) and the same measure decorators as the parent line.
A D) line that finds no preceding N)/N+/N2 in the same datapack
is not an error: it is bound to an implicit stave (stave 0 with
auto-rests) and the parser emits no diagnostic. This tolerance is
specific to D): an A) without its row below is instead ignored with
W174 (neumaRk_articulations.md §2).
3. Element vocabulary¶
3.1 Punctual dynamics¶
Traditional dynamic markers, each punctual (valid on a single note):
p mp mf f ff fff pp ppp pppp ffff sf sfz fp
They do not extend over time: the volume implied by the mark holds for the beat of the event and — interpretatively — until the next dynamic mark, but graphically it appears only once.
3.2 Graphic hairpins¶
Two tokens, each rendered as a graphic sign (crescendo/decrescendo "hairpin"):
| Token | Effect |
|---|---|
< |
crescendo |
> |
decrescendo |
Hairpins extend by repetition: a sequence < < < over three notes
produces a single graphic sign that covers those three notes. A single
occurrence is allowed (punctual).
3.3 Text hairpins¶
Two short tokens that generate a textual indication with a dashed extension line:
| Token | Rendering |
|---|---|
c |
"cresc. - - - - " |
d |
"dim. - - - - " |
They extend by repetition, exactly as §3.2: a sequence c c c c
produces a single "cresc." writing followed by a dashed line that
covers the four notes.
Co-location with graphic hairpin (c< / d>): when c and <
(or d and >) appear on the same note as co-located tokens, the
graphic hairpin wins. The text token is ignored by the hairpin
extraction post-pass. To obtain the "cresc."/"dim." text without a
hairpin, use c/d alone. To obtain both signs simultaneously you
must write them on different notes (e.g. c < on two adjacent notes).
Text compounds pc / fd: they are NOT supported. A token
co-located with a punctual dynamic followed by a text hairpin (e.g.
pc, fd) produces only the punctual dynamic; the text hairpin is
ignored. To express "p and then cresc." write on two notes: p c.
3.4 Text annotations¶
Text containers following the frame model (see neumaRk_text_markup.md
§2.1): the text sits between quotes, the frame is optional.
| Form | Effect |
|---|---|
"text" |
annotation without a frame |
["text"] |
annotation in a box (reference form) |
[text] |
shorthand for ["text"]: same box |
("text") |
annotation in a round frame |
The forms apply in every position: on the note, at the barline (§6), with or
without an extension (§5). In D) the round parenthesis serves only the
("…") frame: a ( or ) in any other form (e.g. (mf), (text)) is
ignored and reported with W177. (mf) therefore produces mf, without
parentheses; for an editorial dynamic in parentheses write it as text:
("mf").
The content of the container is subject to the unified markup defined
in neumaRk_text_markup.md. The default style of D) annotations
is plain, medium size (role reduced; ### makes it small): italic,
bold and underline are applied only if
explicitly requested through the user markup (*…*, **…**, __…__).
Text annotations are punctual by default; with a glued -
("text"-) they open a text line (see §5).
3.5 Placeholder .¶
The token . indicates no element on the corresponding event. It
serves to "skip" an event (note or rest) while preserving the positional
alignment. It does not close a text line: under the line the notes stay
empty or carry their . (§5.3).
3.6 - and *¶
The - has a single role: glued to the right of a text annotation
("text"-) it opens a text line (§5.2).
The * has two roles, told apart by position:
- closing —
*in front of a column (*,*f,*.) or of a barline (*|) closes the open line (§5.4); - barline anchoring —
*glued between a barline and a text annotation (|*"text","text"*|) hooks the annotation onto that barline (§6).
4. Note-anchored elements¶
4.1 1:1 correspondence with the parent N) line¶
Each note-anchored token of the D) line falls on an event (note or
rest) of the parent line, in left-to-right order. The correspondence is
strictly positional:
N) | a8 b c d e f g a |
D) | p . . < < < f . |
// ↑ ↑ ↑
// note 1 notes 4-6 note 7
Rests count as a position (like
neumaRk_articulations.md §4, and unlikeL)which skips them): a.above a rest is an event in its own right. The count is per-event, not per-note. Example:D) | f p mf |overN) | c4 r4 e4 |= 3 tokens over 3 events (2 notes + 1 rest), noW131.
4.2 Co-location: multiple elements on the same note¶
Multiple elements on the same note are written as a single token without internal spaces:
N) | a4 b c d |
D) | f"piano fill" . c< . |
// ↑ 3 elements on the same note: f + "piano fill" + (none on b)
The order of co-located elements is free: f"text"c< and
"text"<fc are equivalent from the semantic point of view (same note,
same elements). The renderer may apply a canonical order in display.
4.3 Autofill of residual notes¶
If the D) line contains fewer note-anchored tokens than the parent
N) line, the residual notes receive an implicit .:
N) | a a a a a a a a |
D) | f | // ≡ D) | f . . . . . . . |
If the D) line contains more tokens than there are events (notes
and rests) in the parent line (extra-tokens), it produces warning W131.
4.4 Measures and barlines¶
The subdivision into measures is defined by the barlines | as for the
other music lines. The barlines of D) must align with those of the
parent line (general rules of neumaRk_datapack.md §6).
5. Text line¶
5.1 Only texts open a line¶
Text annotations ("text", ["text"]/[text], ("text")) are the
only elements that open a line. Punctual dynamics (§3.1) do not extend
by their nature; graphic and text hairpins (§3.2, §3.3) extend by
repetition.
5.2 Opening¶
A hyphen - glued (without spaces) to the right of a text annotation
opens a dashed line starting from its note:
D) | "cresc."- . . *ff |
// ↑ opens ↑ closes before ff, and ff sits on note 4
In a co-located group the - applies to the text annotation of the group,
not to the other elements: in ff"drums fill"- the ff stays punctual on
the note and the line starts from the text.
5.3 The line continues by itself¶
Once opened, the line continues by itself over the following notes —
across barlines and past the end of the system, onto the next system of
the same stave and the same voice — until a * closes it (§5.4). The
notes under the line are written as usual: empty, with ., or with their
own elements.
No element closes the line on its own: neither a dynamic, nor a
hairpin, nor a ., nor an annotation without a line, nor an empty or
missing column. The text of D) is not always a dynamic (rhythm tacet,
freely): the line lasts as long as the writer says.
N) | a8 a a a a a a a | a a a a a a a a |
D) | ff"drums fill"- . . . . . . . | . . . . p . . *. |
// └──────── the line crosses the barline and runs over p ──┘
5.4 Closing *¶
The line is closed only by a *, at one of three points:
| writing | where the line stops |
|---|---|
* as the token of a note's column, co-located too (*, *f, *., *<) |
just before the onset of that note |
*\| in front of a barline, decorated too (*:\|, *\|\|, *\|.) |
on the barline, with the hook |
* in front of an end-of-measure annotation (*"Fine"*\|, §6.3) |
on the barline, and the annotation sits there |
The closing * occupies the column only when it is a token of its own
(*): in that case the note carries nothing else. Co-located (*f) it
closes and leaves the other elements to the note. *| is a token of its
own, before the barline: it occupies no column. A * can close a line and,
on the same note, open another one: *"a tempo"-.
D) | "rit."- . . . | . . . *p | // line over notes 1–7, stops before p
D) | "rit."- . . . | . . . . *| ff | // line up to the barline of m. 2
A line never closed reaches the end of the piece and emits
W191. A * without an open line on its row has no effect and emits
W193.
Line rendering. The line covers the full width of the notes it runs
over and stops just before the onset of the closing note (column *)
or on the barline (*|). There is always a hook at the end. On a
system break the line reaches the right edge of the system, without a
hook, and resumes from the left edge of the next system, without
repeating the text.
5.5 Only one line per row¶
On a D) row at most one line is open: the lines of a row sit at the
same height, and the * must know which one it closes. An annotation with
- that opens a line while another is open on the same row emits
W192: the previous line stops there, as if there were a *. To pass
from one line to the next, close and reopen on the same note:
*"a tempo"-.
The D) rows of different voices (N) and N2) and of different staves
are different rows: each has its own line.
5.6 Line and hairpins together¶
A text line and a hairpin coexist: the text extends with the line, the hairpin repeats per note.
N) | a a a a a a a a |
D) | "cresc."- . . . < < < *< |
// ↑ line over notes 1–7 ↑ hairpin over notes 5–8
The rendering presents both signs in the D) band, with vertical positioning rules at the renderer's discretion.
6. Barline-anchored elements¶
6.1 Context: barline border and D) content¶
In neumaRk a "barline border" is the composite group formed by the
barline | and its adjacent decorators: repetition (:), meter/key
change ((3/4), (@F)), volta ([1.], [2.]), repetition count
(:x3), etc. The barline border is a property of the line (see
neumaRk_datapack.md §6) and is common to all the music lines of
the datapack: D) does not replicate it in its own content.
Consequently, the content of D) for each measure is the text between one barline and the next, excluding any barline border decorator. It is on this clean content that the anchoring rules of §6.2-§6.3 apply.
An annotation hooks onto a barline with a * glued between the
barline and the text. It does not take the place of a note: the dynamics
of the measure still align to the notes.
6.2 Begin-bar |*"text"¶
A * glued to the right of the measure's opening barline, with the text
glued to the *, anchors the annotation to the beginning of the
measure:
D) |*"my text 1" p . . ff |
// ↑ "my text 1" anchored to the beginning of the measure
With the - glued to the text (|*"text"-) the annotation also opens a
line, which starts from the barline and continues as in §5.3.
D) |*"Vamp till cue"- . . . | . . . . | . . *mp . |
// ↑ line from the barline of m. 1, closes before mp
The barline must be written: at the start of the line, without |,
*"text" is a closing (§5.4) followed by an annotation on the first note.
The anchoring * does not close an open line. To close it on the
same barline and open a new one, also write the closing *:
D) |*"intro"- . . . *|*"verse"- . . . |
// ↑ closes "intro" on the barline, opens "verse" from there
6.3 End-bar "text"*|¶
Symmetrically: an annotation glued to *|, as the last token of the
measure, anchors to the end of the measure:
D) | ff "my text 2"*| |
// ↑ "my text 2" anchored to the end of the measure
The anchoring * does not close the open line: "Fine"*| under a line
lets it continue. To close it on the same barline, prefix the closing
*:
D) |*"Vamp"- . . . | . . . *"Fine"*| |
// ↑ opens ↑ closes the line on the barline, and "Fine" sits there
The annotation is end-of-measure only when the text is glued to *|. In
"text"-*| the * follows the -: the annotation sits on the last note and
opens a line, which *| closes right away on the barline.
6.4 Coexistence of begin + end in the same measure¶
A measure may contain both a begin-bar annotation and an end-bar one:
D) |*"text 1" p . . ff "text 2"*| |
// ↑ begin ↑ end
Any note-anchored elements of the measure (p . . ff) are interleaved
normally between the begin annotation and the end one.
7. Parsing rules¶
7.1 Tokenization¶
The D) line is tokenized on whitespace. Within a token multiple
co-located elements may appear (§4.2). The text containers ("…",
["…"]/[…], ("…")) admit internal spaces (they are delimited by their
quotes/square brackets).
7.2 Disambiguation of - and *¶
| Form | Role |
|---|---|
"text"- (- glued to the text) |
opens a line from the note (§5.2) |
*, *f, *. (column token) |
closes the line before that note (§5.4) |
*\|, *:\|, *\|\| (token of its own, in front of the barline) |
closes the line on the barline (§5.4) |
\|*"text" (* between barline and text) |
begin-bar annotation (§6.2) |
\|*"text"- |
begin-bar annotation that opens a line (§6.2) |
"text"*\| (* between text and barline) |
end-bar annotation (§6.3) |
*"text"*\| |
closes the line on the barline + end-bar annotation (§6.3) |
A - that is not glued to the right of a text annotation has no effect
and emits W132. The spellings of version 0.6 (per-column -, -|,
-"text") are converted by the migration (neumaRk_specification.md,
versioning) and are no longer recognised.
The _ has no role in D) (it is the tenuto of A),
neumaRk_articulations.md): outside a text container it is ignored and
emits W194. Inside a text ("a_b", markup __…__) or escaped (\_)
it is an ordinary character.
7.3 Disambiguation of […] and (¶
The container […] in D) is always a text annotation in a box. It
does not collide with the volta begin ([1.]) because the latter
appears in the Markers line, not in D). It does not collide with
polychord ([top|bottom]) for the same reason.
A ( in D) is a round frame only in the form ("…"). Any other
parenthesis ((mf), (text), p(…) is ignored with W177; play
directives (=…) outside M) are still reported by W138.
7.4 Single-line and empty containers¶
Text containers are single-line (see neumaRk_text_markup.md
§6.2). Empty containers "" and [] are literals and not interpreted
as annotations (they are empty text tokens).
7.5 Internal markup¶
The content of the containers in D) is subject to the unified markup
of neumaRk_text_markup.md §3. The default style applied is plain,
medium size: italic, bold and underline are activated only through
explicit markup (*…*, **…**, __…__).
8. Graphic rendering¶
8.1 D) band¶
All the elements of the D) line are rendered below the staff of
the parent staff, in a dedicated band. When the parent staff is a voice
2 (N2), the D) band of voice 2 may be superimposed on or adjacent to
that of voice 1: the vertical positioning is a renderer's choice.
8.2 Punctual dynamics¶
The dynamic marks (§3.1) are rendered with the dynamic glyphs of the music
font (the traditional italic letters of p, mf, sfz…), aligned
horizontally to the beat of the corresponding note.
8.3 Graphic hairpins¶
The hairpins (</>) are rendered as a single "hairpin" sign that
covers the interval from the first to the last repetition, with the
ends aligned to the beats of the opening and closing notes.
8.4 Text hairpins¶
c and d produce respectively "cresc." and "dim." as italic text,
followed by a dashed line that extends up to the beat of the last
repetition. The style is consistent with the musical typographic
convention.
8.5 Text annotations¶
Default style: plain, medium size (consistent with §3.4 and §7.5;
italic/bold/underline only via markup *…*/**…**/__…__).
Annotations with ["…"]/[…] show a box around the text, those with
("…") a pair of round parentheses; annotations with "…" are text
only.
A ; in the annotation breaks the line (neumaRk_text_markup.md
§3bis). The stack sits below the staff and grows downward: the first
line stays where the single line would be. Each line is centred on the
note; if the stack would run past the staff, it moves as a whole, based on
the widest line. A single frame (box or round frame) wraps the whole stack.
D) | "dolce;espr." . . . | // → dolce
// espr.
The text lines are rendered as a dashed line that starts at the end of the text and extends up to the closing (§5.4), with a hook at the end. With a multi-line label the line follows the first line.
8.6 Barline-anchored annotations¶
Begin-bar annotations are aligned vertically to the left border of the measure; end-bar ones to the right border. The lines graphically cross the measure barlines and continue onto the next system. On multiple lines the alignment applies line by line: begin to the left, end to the right.
9. Diagnostics¶
9.1 Diagnostic codes¶
| Code | Description |
|---|---|
| W131 | Number of note-anchored tokens in D) greater than the events of N) (W131.excess_dynamic) |
| W132 | - not glued to the right of a text annotation: ignored (§7.2) |
| W133 | Text container not closed within the measure ("…, [… or ("… without closing): the rest of the measure is read as text |
| W138 | Play directive (=…) outside the M) row: ignored (neumaRk_play_directive.md) |
| W177 | Parentheses outside a ("…") frame ((mf), (text)): ignored (neumaRk_text_markup.md §2.1) |
| W191 | Text line never closed: it reaches the end of the piece (§5.4) |
| W192 | Text line opened while another is open on the same row: the previous one stops there (§5.5) |
| W193 | Closing * without an open line on its row: ignored (§5.4) |
| W194 | _ outside a text container: ignored (§7.2) |
9.2 Lines never closed¶
A text line that no * closes reaches the end of the piece and emits
W191: the line is drawn up to the right edge of the last system.
There is no implicit closing (end of the system, new element, .): the
line closes where the writer closes it.
9.3 Hairpin with a single occurrence¶
A hairpin (<, >, c, d) that appears only once on a note is not
an error and emits no warning. Since hairpins extend by repetition, a
single occurrence has no distinct closing note: it is rendered with the
width of the note's duration — the wedge (or the cresc./dim.
line) extends from the note to just before the next note's onset, or,
if it is the last note of the line, to the right edge of the stave.
This is the idiomatic case of the final note of the piece fading in a
dim./cresc. al niente, where repeating the sign is impossible by
construction.
With a co-located dynamic (graphic hairpin </> + dynamic on the
same note) the written order determines the horizontal layout along
the note's duration, mirroring the musical meaning:
pp>— dynamic first: the dynamic is the starting one, sits on the onset, and the wedge opens to its right;>pp— hairpin first: the dynamic is the arrival one, the wedge starts at the onset and the dynamic is placed at the wedge's right end.
Both forms are valid; choose based on where you want the dynamic (start
vs arrival). This applies to graphic hairpins; text hairpins (c/d)
with a co-located dynamic have no such distinction.
10. Examples¶
10.1 Essential dynamics¶
N) | a4 b c d | e f g a |
D) | p . . f | . < < ff |
p on note 1 of measure 1, f on note 4; graphic crescendo on notes
2-3 of measure 2 culminating in ff on note 4.
10.2 Punctual annotation and line¶
N) | a8 a a a a a a a | a a a a a a a a |
D) | "intro"- . . *mp< < < f | "verse"- . . . . . . *. |
Measure 1: line from "intro" over notes 1–3, closed before mp, from
which the graphic hairpin starts up to f. Measure 2: line from "verse"
over notes 1–7, closed before the last one.
10.3 Text hairpin c / d¶
N) | a8 a a a a a a a | a a a a a a a a |
D) | p c c c c c c c | c f . . d d d d |
Measure 1: p punctual on note 1, "cresc." extends over 7 notes. The
first repetition c falls on the same note as p (co-located).
Measure 2: a further c continues the "cresc." up to note 1, then f
closes. From note 5: "dim." extends over 4 notes.
10.4 Complex co-location¶
N) | a4 b c d |
D) | ff"drum fill"c< . . ppp |
On note 1: 4 co-located elements (ff punctual + text "drum fill"
+ text hairpin c + graphic hairpin <). Notes 2-3 are empty;
ppp punctual on note 4.
10.5 Barline-anchored begin¶
M) |[V.] …
D) |*"Vamp till cue"- p . . . . . . *. |
"Vamp till cue" anchored to the beginning of the measure [V.]
(volta), with the line starting from the barline and closing before the
last note. The p sits on the first note, under the line.
The [V.] decorator of M) is not replicated in the content of D):
the parser works on the clean content of the measure (see §6.1).
10.6 Line over several measures¶
D) |*"Vamp till cue"- p . . . . . . . | . . . . . . . . | . . . . *mp . . . |
"Vamp till cue" covers two and a half measures; it closes before mp in
measure 3.
10.7 Begin + end in the same measure¶
M) |:(3/4)[1.] :x3|
D) |*"intro" p . . ff "outro"*| |
Annotation "intro" begin-bar + annotation "outro" end-bar in the same
measure. Dynamics p and ff on the internal notes. The barline
border of M) (:(3/4)[1.] / :x3|) does not appear in the content of
D).
10.8 Voice 2 with independent dynamics¶
N) | a4 b c d |
D) | f . . ff |
N2 | e4 d e2 |
D) | p . pp |
Voice 1 has f on note 1 and ff on note 4; voice 2 has p on note
1 and pp on note 3. The two D) are both bound to their respective
N)/N2 by position (see neumaRk_voices.md §3.1).
11. Summary¶
| Concept | Syntax | Section |
|---|---|---|
| Punctual dynamic | p mp mf f ff fff pp ppp pppp ffff sf sfz fp |
§3.1 |
| Graphic hairpin | < > (by repetition) |
§3.2 |
| Text hairpin | c (→ cresc.) d (→ dim.) |
§3.3 |
| Text annotation | "text" / ["text"] ([text]) / ("text") |
§3.4 |
| Placeholder | . |
§3.5 |
| Opening / closing | "text"- opens, * closes |
§3.6 |
| Co-location | adjacency without spaces | §4.2 |
| Autofill | residual notes → implicit . |
§4.3 |
| Text line | "text"- opens; continues by itself, across system breaks too; * (column) or *\| closes |
§5 |
| One line per row | new opening with a line open → W192 | §5.5 |
| Begin-bar | \|*"text" (with a line: \|*"text"-) |
§6.2 |
| End-bar | "text"*\| (closing the line: *"text"*\|) |
§6.3 |
The system is orthogonal: the three mechanisms (punctual dynamics,
hairpins by repetition, texts with a line - … *) coexist without
interference and combine by co-location.
This document defines the D) line of neumaRk as a unified
below-staff annotation band, able to express traditional dynamics,
crescendo/decrescendo indications, punctual and extended text
annotations and anchors to the measure barlines, through a compact
vocabulary and orthogonal rules.