# Notes and pitch

## Pitch letters and accidentals

Use `A B C D E F G`. Place an accidental immediately after the letter and an
optional octave after that: `Eb4`, `F#5`, `Bbb3`, `G##4`, `Fn4`.
The spellings `b`, `#`, `bb`, `##`, and `n` mean flat, sharp, double flat,
double sharp, and natural. Case does not select the octave.

Case does distinguish tokens: `Eb` is E-flat; `eB` is an eighth-note B.
`eb` and `EB` are not equivalent spellings. Attach a letter duration to its
pitch (`qC5`), without an intervening space (`q C5` is invalid).

```scorescript
4C4 C# D Eb | E F F# G
```

Microtonal alterations use `+q`, `-q`, `+3q`, and `-3q` for quarter-tone
and three-quarter-tone raises or lowers. Their notation and playback depend
on the output's capabilities; ordinary MIDI pitch alone cannot represent a
quarter tone exactly.

## How an omitted octave is read

`C4` states an absolute octave. With no digit, choose the octave nearest the
previous pitch in that voice. A voice's first unnumbered note starts in the
middle-C octave. A rest does not reset the reference. The reference can cross
barlines and source lines; a line break alone is not an octave reset.

An apostrophe raises the nearest choice one octave; a comma lowers it one
octave. These are relative to the nearest choice, not always to octave 4.
Prefer relative contour after the opening anchor: bare pitches for the nearest
reading, an apostrophe (`'`) to shift that choice up an octave, and a comma
(`,`) to shift it down. Do not restate the octave at each barline. Absolute
digits remain available when deliberately specifying an absolute register;
they are not the preferred way to spell ordinary melodic leaps.

```scorescript
4F4 G A F | G A G A | C A' G F
```

The opening F4 anchors the passage. The next bar continues with bare G.
In the last bar, C is C5; the nearest A is A4, so `A'` selects A5. The
following G and F continue in octave 5. This is the preferred spelling of
the contour, rather than repeating `G4` and replacing the shift with `A5`.

```scorescript
4C4 G C' G, | C' B A G
```

“Nearest” normally uses diatonic letter distance; a sounding tritone tie
chooses upward. Thus `G4 D` reaches D4, `C5 G` reaches G4, and `B4 F` reaches
F5. An omitted octave does not necessarily mean “stay in the same numbered octave.”

The formatter writes an explicit octave on the first sounding note of each
authored section and voice, not every bar or physical line. Later bars can
continue by relative contour. It cannot infer what
register you intended after an incorrect edit; check the notes before accepting
a format operation.

## Chords

Put simultaneous pitches in square brackets. Duration belongs before the
whole chord. Member order matters: each omitted octave is read relative to
the previous member, and the next node follows the first written member.

```scorescript
2[C4 E G] 2[F A C] | 1[C E G]
```

Do not sort the members merely to tidy the text. For an octave below inside
a chord, use an explicit digit: a comma inside the brackets is a member
separator, not the octave-down mark. Put marks outside the chord, such as
`4[C4 E G](p)`. See [ties](connectors.md) for tying individual members.

`[A]` is one pitch; `[AM]` generates an A-major triad. A boxed rehearsal
landmark defaults to `RH {5, 9, 13}` (boxed actual measure numbers), or
inline `[[5]]` at measure 5, so it cannot swallow a chord. For `[CMM7]`, `[CMm7]`,
Roman numerals, extensions, and inversions, see [chord formulas](chords.md).

## Key-aware spelling

The default `spell absolute` reads a bare `F` as F-natural even in a sharp
key. With `spell key`, a bare letter takes its alteration from the signature.
An explicit accidental still states the written alteration; `n` cancels it.

An explicit accidental applies to its own source note, not every later
same-letter note in the bar. `4C#5 C C C` sounds C-sharp followed by three
C-naturals. With `key G` and `spell key`, `4F5 Fn F F` sounds F-sharp,
F-natural, F-sharp, F-sharp. Do not copy the printed score's within-bar
accidental-carry convention into source spelling.

```scorescript
scorescript 0.3
score "Signature spelling" {
  key G
  spell key
  parts { flute }
  flute { m1 { 4F5 Fn F# G } }
}
```

Here the first F is sharp, the second natural, and the third explicitly sharp.
An inline `[spell key]` changes the mode at a musical point.

## Solfège

Use `do re mi fa sol la ti`; `so` is another spelling of `sol`. Movable do is
the default solfège reading. In D major, `do re mi` sounds D, E, F-sharp.
`solfege fixed` selects fixed do. Chromatic syllables include `di ri fi si li`
and `ra me se le te`. In movable do, `si` is raised sol; in fixed do it
is the seventh degree, equivalent to `ti` (B). Movable do in a minor key uses
the relative-major signature: with `key Cm`, `do` is E-flat, not C.

```scorescript
scorescript 0.3
score "Movable do" {
  key D
  parts { flute }
  flute { m1-2 { 4do re mi fa | so la ti do } }
}
```

The quarter duration continues through the barline: do not repeat `4` before
`so` merely because a new measure begins. This is the same duration inheritance
used with letter pitches; solfège is not a separate rhythm grammar.

Related: [key signatures](context.md), [transposition](reuse.md).
