ScoreScript Language wiki

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 sourceDownload source
4C4 C# D Eb | E F F# G
Generated notationNotation for the preceding Notes and pitch example
Canonical spelling
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.

Courtesy accidentals: the star

A star glued straight after a pitch asks for that pitch's courtesy accidental. It comes before the note's ties and marks.

WrittenMeans
F5*a courtesy, in the governing rule's look (parentheses by default)
F5*()a courtesy, forced into parentheses
F5*no()a courtesy, forced plain
F5**no courtesy: a hard cut, even where one would print automatically
ScoreScript sourceDownload source
4F#5 G A B | F,* G*no() A B | 2[C5 F*] 4F*(p) F**
Generated notationNotation for the preceding Notes and pitch example
Canonical spelling
4F#5 G A B | F,* G*no() A B | 2[C5 F*] 4F*(p) F**

A chord member takes its own star, and marks follow it: 4F5*(p), 2F5*~ F5. A required alteration always prints; only *() encloses it. Stars change what is printed, never what sounds.

Automatic courtesies and their rule

Automatic courtesies are on by default, in parentheses. When a bar ends with a pitch altered from the key, the next bar receives a cancellation courtesy at that pitch's first occurrence. A cancellation already written before the barline needs no next-bar courtesy. A different octave of the same letter also receives one within the current bar. Repeated notes do not repeat it. A tied arrival stays clean; a later untied attack states its accidental again when needed.

The same four forms, standing alone, set the rule for automatic courtesies: * turns them on in the look the broader scope has in force (parentheses where none says otherwise), which is the same meaning F5* has on a note; *() turns them on in parentheses, *no() on and plain, and ** off. So a score rule *no() and a part rule * give that part plain courtesies. A rule alone on its own line in the score governs every part; alone on its line in a part body, that part. Inside a bar it holds from that bar on; written after the bar's last note, it starts with the next bar.

ScoreScript sourceDownload source
parts {
  fl
}

fl {
  *no()

  m1-4 {
    1F#5 | F | ** F# | F
  }
}
Generated notationNotation for the preceding Notes and pitch example
Canonical spelling
parts {
  fl
}

fl {
  *no()

  m1-4 {
    1F#5 | F | ** F# | F
  }
}

A named engraving layout states its rule as accidental_reminders, one of "*", "*()", "*no()" or "**". The most specific rule wins: score, then part, then layout, then bar, and a note's own star is the last word. MusicXML writes a courtesy as <accidental cautionary="yes" parentheses="yes"> (or parentheses="no" when plain).

A star touching a word or a string is still tempo text: 4F5*Andante G puts Andante over G. *no() is the one exception.

The older words are read, with a warning, and rewritten by format: (courtesy) is *, (accidental-paren) and (accidental-bracket) are *(), and (no-courtesy) is **. The warning never blocks a check, a render or a MusicXML export. On a chord formula such as [CMm7], which writes no pitch for a star to glue to, the word is kept as written and still applies to every member; write the chord's pitches to use the star.

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 sourceDownload source
4F4 G A F | G A G A | C A' G F
Generated notationNotation for the preceding Notes and pitch example
Canonical spelling
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 sourceDownload source
4C4 G C' G, | C' B A G
Generated notationNotation for the preceding Notes and pitch example
Canonical spelling
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 sourceDownload source
2[C4 E G] [F A C] | 1[C E G]
Generated notationNotation for the preceding Notes and pitch example
Canonical spelling
2[C4 E G] [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 for tying individual members.

[A] alone is retired — a bracket holding nothing but a letter name is what a boxed rehearsal letter used to be written as, and the reader refuses it rather than sounding a note there. Write A for the one pitch, [A4] where it must be a one-member chord, and [A C# E] or [AM] for the A-major triad. A boxed rehearsal landmark defaults to RH {m5, m9, m13} (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.

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 sourceDownload source
scorescript 0.3
score "Signature spelling" {
  key G
  spell key

  parts {
    flute
  }

  flute {
    m1 {
      4F5 Fn F# G
    }
  }
}
Generated notationNotation for the preceding Notes and pitch example
Canonical spelling
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 sourceDownload source
scorescript 0.3
score "Movable do" {
  key D

  parts {
    flute
  }

  flute {
    m1-2 {
      4do4 re mi fa | so la ti do
    }
  }
}
Generated notationNotation for the preceding Notes and pitch example
Canonical spelling
scorescript 0.3
score "Movable do" {
  key D

  parts {
    flute
  }

  flute {
    m1-2 {
      4do4 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, transposition.