.cesure format
Open specification for .cesure — the native tablature format of Cesure. This is version 3. Versions 2 and 1 are frozen and described in v2.md and v1.md; every reader keeps reading them (Reading version 2).
What it is
.cesure is a UTF-8 text file for tablature and scores. It is:
- Lossless — a score saved as
.cesurere-opens identically, every time - Readable and writable by hand, and by agents — a JSON skeleton (tracks, measures, metadata) whose notes are written in a short text notation, one string per voice and per measure
- Addressable — every measure carries a stable id, so a range of measures can be read or replaced without counting measures
- Versioned — an explicit
versionfield, and a reader that keeps what it does not understand - A note is its pitch — named as it was written (
D#5is notEb5); the string it is played on is a layer on top of it, on a track that has strings, and the fret is never written: it follows from the pitch, the string, the tuning and the capo - Validated — a JSON Schema describes the skeleton, and an application reads and writes it on every build
Why not MusicXML, MIDI, or AlphaTex?
| Format | Human-readable | Tablature | Round-trip lossless | Versioned |
|---|---|---|---|---|
.cesure | ✓ | ✓ | ✓ | ✓ |
| MusicXML | ✓ | ~ | ~ | ✗ |
| AlphaTex | ✓ | ✓ | ~ | ✗ |
| MIDI | ✗ | ✗ | ✗ | ✗ |
| GP5 | ✗ | ✓ | ~ | ✗ |
The notes of a .cesure file are written in a notation modelled on the AlphaTex of alphaTab, but defined and frozen here: it does not follow alphaTab's evolutions, and what this page says is the whole of it.
A first file
{"version":3,"score":{"title":"Simple Example","tempo":96,"tracks":[
{"tuning":["E4","B3","G3","D3","A2","E2"],"measures":[
{"id":"p1","staves":[{"voices":["E4@1.4 C4@2.4 (G3@3 E3@4).4 r.4"]}]},
{"id":"p2","numerator":3,"staves":[{"voices":["G4@1.8{d} F#4@1.16 E4@1.2","E2@6.2{d}"]}]}]},
{"name":"Piano","instrument":"PIANO","measures":[
{"id":"p1","staves":[{"voices":["E5.4 C5.4 (G4 C5).4 r.4"]},{"voices":["C3.1"]}]},
{"id":"p2","numerator":3,"staves":[{"voices":["G5.8{d} F#5.16 E5.2"]},{"voices":["E3.2{d}"]}]}]}
]}}
Two measures on a standard six-string guitar and on a piano: the first in 4/4 (the default), four quarter beats — open high E, first fret on the B string (C4 on string 2), a chord, a rest; the second in 3/4, a melody over a bass held for the whole measure (a second voice). The guitar has a tuning, so each of its notes says its string; the piano has none, and writes its right hand over its left, on two staves.
File structure
score.cesure
└── (UTF-8 JSON)
├── version 3
└── score Score
├── tracks[] Track
│ └── measures[] Measure (id, time signature)
│ └── staves[] Staff
│ └── voices[] string in the compact notation
├── tempoChanges[] TempoChange (by measure id and beat)
├── keyChanges[] KeyChange (by measure id)
└── repeats{} Repeat (by measure id)
A writer omits every field that holds its default, and a reader gives an absent field its default. Measure i of every track is the same column of the piece: same id, played at the same time.
Root
| Field | Type | Required | Description |
|---|---|---|---|
version | integer | ✓ | Format version: 3. A reader refuses a higher one, and reads 2 and 1 forever. |
score | Score | ✓ | The piece. |
The root holds nothing else: a key placed there belongs to nothing a reader could keep.
Score
| Field | Type | Default | Description |
|---|---|---|---|
title | string | "Untitled" | Title of the piece. |
artist | string | "" | Composer or performer. |
album | string | "" | Album, when the piece comes from one. |
tempo | number | 120 | Initial tempo in quarter notes per minute (4 to 999), whatever the time signature, in force until the first tempo change. Whole or not: 92.5 is kept, played and written back as it is. 0, which no writer is to write, reads as no tempo: the piece takes 120. A reader refuses a file whose tempo, or a tempo change above 0, lies outside 4 to 999, naming the range. |
tempoChanges | TempoChange[] | [] | Tempo changes. Empty = constant tempo. |
key | string | — | The key of the piece from its first measure: its tonic, b or # for its accidental, and m for a minor key — "C", "Bb", "F#", "Am", "F#m", "Bbm"; the 30 keys of at most seven accidentals, nothing else. Absent = the file states none: a reader may find it from the notes, and does not write what it found. See KeyChange. |
keyChanges | KeyChange[] | [] | Key changes. Empty = one key for the whole piece. |
repeats | {id: Repeat} | {} | Repeat signs, keyed by the id of the measure that carries them. See Repeat. |
license | string | "" | License of the published work (e.g. Public Domain, CC BY 4.0). Empty = the file says nothing. One line: a line break in it is read as a space, and written back so (as is one in attribution). |
attribution | string | "" | Attribution of the edition — year and source URL included when applicable. It travels with the file because CC-BY requires it when a copy is kept. |
hideEmptyStaves | boolean | false | Whether the staves whose hideWhenEmpty is auto leave a system they play nothing in (MuseScore's "Hide empty staves"). |
hideEmptyStavesInFirstSystem | boolean | false | Whether the first system too leaves out the staves that hide when empty (LilyPond's remove-first). |
tracks | Track[] | [] | The instrument tracks. |
TempoChange
| Field | Type | Required | Description |
|---|---|---|---|
measure | string | ✓ | Id of the measure the tempo falls in. |
at | number | Where in that measure the tempo falls, in quarter notes from its start (1.5: on the second eighth of the second beat of a 4/4), less than the measure's length. Absent: at its start. | |
tempo | number | ✓ | Tempo from that beat on, quarter-note beats per minute, whole or not. A writer writes it between 4 and 999; a reader ignores a change at 0 or below. |
Tempo belongs to the piece, not to a track, and is always counted in quarter notes per minute: a 6/8 felt at 60 dotted quarters per minute has tempo 90. A change falls on a beat, as MuseScore places a tempo text: mid-measure, the beats after it in the measure play at the new tempo. A place no beat of a track starts at is a place all the same (a gradual slowing down read from a MIDI file falls between notes). An at that is not a number, below 0, or at or past the end of its measure is refused. A change is named by the id of its measure, so it stays on that measure when measures are inserted or deleted before it; one whose measure is deleted goes to the start of the next measure that remains. A change naming no measure of the piece is ignored, and not written back: a version 1 file with a change past its last measure loses it at its first save in version 2, as is a change whose tempo is not positive, which applies to nothing.
KeyChange
| Field | Type | Required | Description |
|---|---|---|---|
measure | string | ✓ | Id of the measure at whose start the key takes effect. |
key | string | ✓ | Key from that measure on, written as the score's key. |
Like the tempo, the key belongs to the piece, not to a track, and a change is named by the id of its measure. A change naming no measure of the piece is ignored, and not written back. A key name a reader does not know makes the file damaged, whether on the score or on a change. The key is the one heard: transposing the piece moves it with the sound, and so does a capo every track has; with tracks under different capos it is the key the piece has without one.
Repeat
The repeat signs of one measure — of its column, on every track. A repeat keyed by an id no measure carries is ignored, and not written back.
| Field | Type | Default | Description |
|---|---|---|---|
start | boolean | false | A repeated section opens at the start of the measure (|:). |
end | integer | — | A repeated section closes at the end of the measure (:|): how many times the section is played in all, 2 to 99; any other value is refused, naming the repeat. Absent = no close. |
endings | integer[] | [] | Alternative ending (volta): the passes on which the measure is played — [1] first ending, [2] second, [1, 2] both, each from 1 to 99 (any other is refused). A bracket longer than one measure repeats its passes on each of them. A repeat with no sign at all ({}) says nothing, and is not written back. |
directions | string[] | [] | The signs and jumps of the measure, named as alphaTab names them: the signs Segno, SegnoSegno, Coda, DoubleCoda, Fine; the jumps DaCapo, DaCapoAlCoda, DaCapoAlDoubleCoda, DaCapoAlFine, DalSegno, DalSegnoAlCoda, DalSegnoAlDoubleCoda, DalSegnoAlFine, DalSegnoSegno, DalSegnoSegnoAlCoda, DalSegnoSegnoAlDoubleCoda, DalSegnoSegnoAlFine; and DaCoda, DaDoubleCoda (To Coda, To Double Coda). Any other name is refused, naming the repeat. A reader that does not know this field keeps it and writes it back. |
section | boolean | false | The measure opens a section (a movement, MuseScore's section break): its repeats and jumps are played on their own, a da capo going back to the section's first measure and a Fine ending only the section, after which playback goes on with the next one. Any other value than true or false is refused, naming the repeat. A reader that does not know this field keeps it and writes it back. |
Playback unrolls the repeats as in Guitar Pro and MuseScore, from the structure of the whole piece. A section opens at a start, or right after the previous section, or at the first measure. Its body runs to its close or to its first bracket. Consecutive measures with the same endings make one bracket, a close ends it, and the brackets run on up to the first that does not close. On pass p the body is played, then the brackets whose endings hold p; a bracket that closes sends playback back to the start of the body while passes remain. So a [3. after a section played twice is never played. A bracket carrying a start after other brackets opens the next section: it is also an ending of its own section, and the start of the next section's body, when its own section still waits for every pass it names; otherwise it is the first ending of a next section with no body. A section that no close repeats is played once, in order, its endings not read.
The directions are then followed, as Gould and MuseScore play them. Repeats are played up to a jump, taken on the last pass through its measure; a da capo goes back to the first measure, a dal segno to the nearest segno at or before it (else the first after it, as Guitar Pro looks it up). From there the repeats are not played again and only the ending of the last pass is taken; Fine ends the piece, and DaCoda leaves for the nearest Coda after it (else the last before it), only after a jump that names them (al Fine, al Coda). From the coda on, repeats are played again. Each jump and each To Coda is taken once, and one with nowhere to go (no segno, no coda) is ignored.
A complete example, |: A [1. B C :| [2. |: D :| E — a first ending two measures long, and a second ending that opens a repeat of its own, played A B C A D D E:
"repeats":{"p1":{"start":true},"p2":{"endings":[1]},"p3":{"end":2,"endings":[1]},
"p4":{"start":true,"end":2,"endings":[2]}}
Limit, which no editing gesture makes audible: a section with no body whose first ending names only passes the section before it still waits for reads as an ending of that section.
Track
| Field | Type | Default | Description | |
|---|---|---|---|---|
name | string | "Guitar" | Track name. | |
tuning | string[] | — | Open strings, as pitches, from string 1 (the highest) to string N (the lowest); its length is the number of strings — standard 6-string ["E4","B3","G3","D3","A2","E2"]. An open string has no name of its own: a flat is read as the sharp of the same pitch (Eb4 is D#4) and written so. Absent = the track has no strings (a piano, a voice, a flute): its notes are pitches alone. An open string a version 2 file wrote as a Note object with keys a reader does not know is written back as that object. | |
capo | integer | 0 | Capo position in frets, only with a tuning — a capo without one is refused. A note is its sounding pitch: the capo moves the fret it is played at, never what it sounds. | |
volume | number | 1 | Volume in the mix, 0..1. | |
hideWhenEmpty | string[] | [] | How each staff, by index, hides in a system it plays no note in, as MuseScore's per-staff "Hide when empty": auto as the score's hideEmptyStaves says, always on its own, never not, instrument only with the whole track, when none of its staves plays. A staff past the list is auto; a staff left out stays in the file; a system keeps one staff at least, its first when every staff leaves. | |
instrument | string \ | null | null | What the track is played on: GUITAR, BASS, PIANO or DRUMS, and more later without a new version. Absent, the file says nothing: a track with a tuning sounds as a guitar, one without as a piano. A PIANO without a tuning is written on two staves (see Staff). A DRUMS track is the General MIDI drum kit: no tuning, its beats strike drum notes (p36), drawn on a percussion staff and sounding the standard kit. |
program | integer | — | The General MIDI program, 0..127 (General MIDI's program 1 is 0), the track sounds, as its source states it. Absent, it sounds its instrument's: a nylon guitar (24), a finger bass (33), a grand piano (0). Ignored on a DRUMS track. A value outside 0..127 is refused, naming the track. | |
measures | Measure[] | [] | The measures of the track, in order. A track may hold fewer measures than another: it is silent after its last one, and each of its measures carries the id of the column it is in. |
Measure
Nothing carries over from one measure to the next: a measure without numerator and denominator is in 4/4, not in the time signature of the measure before it. Write them on every measure that is not in 4/4.
| Field | Type | Default | Description |
|---|---|---|---|
id | string | — | Stable id of the measure's column, at most 64 characters. See Measure ids. |
numerator | integer | 4 | Beats per measure (time signature numerator), 1 to 128. Cesure refuses a file that writes a value outside the range, naming it. |
denominator | integer | 4 | Note value of a beat: 1, 2, 4, 8, 16 or 32. |
incomplete | boolean | false | Irregular on purpose, in its own signature: shorter than the piece's measures (an opening pickup, a closing measure that completes it, an inner pickup) or longer (a stretch of a cadenza). See Pickup, short endings and irregular measures. |
barLineRight | string | — | The style of the bar line that closes the measure, by the name alphaTab gives it (\barLineRight, MusicXML's bar-style): automatic, dashed, dotted, heavy, heavyHeavy, heavyLight, lightHeavy, lightLight, none, regular, short or tick. Cesure draws none as no line and every other one as the regular line. Absent: the regular line. |
uncounted | boolean | false | Left out of the measure count, as MusicXML's implicit and MuseScore's "exclude from measure count": the measure carries the number of the one before it and shows none. |
tsVisibility | boolean | true | Whether the time signature the measure would engrave — at the head of the piece, or where the meter changes — is printed, by the name alphaTab gives it (\barDisplay { tsVisibility false }): false as MusicXML's print-object="no", where the source engraves none. |
barNumberDisplay | string | — | How the measure's number shows, by the name alphaTab gives it (\barNumberDisplay): hide for a measure counted without its number in sight, as LilyPond parenthesises the number of the measure a cadenza closing on a bar line opens. Absent: the rule. |
chords | object[] | [] | The chord symbols written over the measure, in order, one per instant: {"at": 2, "chord": "G/B"}, at the quarter notes from the start of the measure — absent at its start —, at any instant, a beat struck there or inside a held note (MuseScore's time tick); each from its instant to the next. chord is read as a lead sheet writes it: a text is a chord when a root opens it and its suffix, if any, opens as a chord's does — a digit, a sign (+ - ° ø Δ ( # b ^), a quality (m, M, maj, min, dim, aug, sus, add, alt, no) or the diminished o alone or before a digit: C7M, C7+, Cø, Co7 —, then the bass after the last slash when a name ends the text there (G/B); any other text (N.C., Coda) is kept whole and never transposed. At most 40 characters, blanks folded into one. It never changes what sounds. |
meter | [integer, integer] | — | The nominal time signature of an irregular measure when no regular measure of its track gives it (a piece all in a cadenza), as MuseScore keeps a measure's time signature beside its actual length. Written only there. |
staves | Staff[] | — | The staves of the track in this measure, top to bottom, as many as the track has — a piano's two hands, an organ's three, a guitar's notation and its second part —, as MuseScore, Guitar Pro and MusicXML hold a part. Every staff of a track is played and drawn. Absent: the measure holds no staff, and the track is silent there. |
Staff
| Field | Type | Required | Description |
|---|---|---|---|
voices | string[] | ✓ | The voices of the staff, one to four, each in the compact notation and with its own rhythm: the first, then a second one (a bass under a melody) when there is one, up to a fourth — the first and the third drawn stems up, the second and the fourth stems down. A fifth voice is refused where the file enters, naming the measure, the track and the staff. |
clef | string | — | The clef this staff opens this measure on, as MusicXML draws one, a sign on a line: treble (G on line 2), soprano, mezzosoprano, alto, tenor, baritone (C on lines 1 to 5), bass (F on line 4), each followed when its notes sound octaves off where they stand by 8vb, 8va, 15mb or 15ma (treble8vb, the guitar's; alto8vb): a name a reader does not know is kept and written back; a value that is not a name is refused. A change of clef is written on every measure that opens in the new clef; a change in the middle of a measure is the beat property clef (below). Absent from a measure, the clef that measure opens on follows from what every track says: a PIANO without a tuning treble then bass; a track with a tuning treble8vb, a BASS with one bass8vb; a track without a tuning treble. A clef never changes what sounds: a note is its sounding pitch, whatever the clef it is drawn in, and a field that one day says a written pitch apart from the sounding one will not count the clef's octave. |
A piano is one track on two staves: staves[0] is the right hand, staves[1] the left, each with its voices, measure by measure — up to four per hand, each in a rhythm of its own, so that one hand can play several rhythms while the other plays; a staff past the second is a staff of the left hand's side (an organ's pedals). A note is in the hand of the staff it is written on, so hand is not written there — a hand on a piano's staff is refused. Each voice of each staff is read and written back as it is; a left hand with nothing to play writes a rest of each value of the right hand's first voice.
The voices of a staff are played at the same time, each over the whole measure: each should fill its time signature exactly. A voice too short or too long is shown as a wrong measure, not refused. A voice with no beat is written as an empty string.
Pickup, short endings and irregular measures
A pickup (anacrusis) is a measure in its own time signature — an eighth before a piece in 3/8 is a 1/8 measure — marked "incomplete": true. A closing measure that completes it (two eighths in 3/8) is written the same way, and so is a short measure anywhere inside the piece — the two halves of a measure split by a repeat sign, a section that opens on its own pickup. Each voice still fills the measure's own signature, and it is played as written: the mark changes how it is shown, never how it sounds. Cesure shows an incomplete measure the time signature of its nearest complete neighbour (the next one for an opening pickup, else the one before it), so a piece in 3/8 opening on an eighth shows 3/8 once; an opening pickup is measure 0 and shows no number, the first full measure is 1. A short measure without the mark is a wrong measure. A reader that does not know the key keeps it and writes it back.
A measure longer than the piece's meter on purpose — a stretch of a cadenza, cut where the source draws a bar line, often an invisible one — is written the same way: its own signature is its real length (27/16 for a cadenza stretch of twenty-seven sixteenths in 4/4), marked "incomplete": true; it shows and beams in the meter of its regular neighbour — or, in a piece without one, in its "meter". Such a stretch usually also closes on "barLineRight": "none" and, past the first of the cadenza, is "uncounted": true, as LilyPond numbers a cadenza.
Measure ids
An id names a measure from outside the file — a saved loop, a range an agent replaces — and survives the insertion or deletion of other measures, which a measure number does not. Ids are opaque. Measure i of every track carries the same id, no two columns share one, and an id is never reused for another column. A writer keeps the ids it read. A track that names two of its measures alike, or a column whose tracks name it differently, is refused, naming them.
A measure written without an id gets one from the reader: a file with no id at all is read with positional ids, p1..pN; a measure missing among identified ones takes its column's id from another track, or one the reader derives from the file alone, so that every reader of the same file agrees.
Note
An absolute pitch as version 2 wrote an open string; version 3 reads it in a tuning too, and writes it only for an open string that keeps keys a reader does not know.
| Field | Type | Description |
|---|---|---|
note | string | Pitch class: "C", "Cs", "D", "Ds", "E", "F", "Fs", "G", "Gs", "A", "As", "B" (s = sharp). |
octave | integer | Octave number (scientific pitch notation): middle C is {"note":"C","octave":4}. |
The compact notation
Each voice of a staff, in each measure, is one string: its beats, separated by spaces.
voice = [ beat { " " beat } ]
beat = content "." duration [ props ]
content = note | "(" note { " " note } ")" | "r"
note = pitch [ "@" string ] [ props ] | "x@" string [ props ] | drum [ props ]
pitch = letter [ accidental ] octave
letter = "A" | … | "G" | "a" | … | "g"
accidental = "#" | "##" | "x" | "b" | "bb"
octave = [ "-" ] integer
drum = "p" integer
duration = "1" | "2" | "4" | "8" | "16" | "32" | "64"
props = "{" prop { " " prop } "}"
prop = name [ " " value ]
value = integer | quoted string | "(" value { " " value } ")"
- Durations:
1whole,2half,4quarter,8eighth,16sixteenth,32thirty-second,64sixty-fourth; nothing else. Every beat states its duration right after a dot; a beat without one, a duration change (:8), an older form (.8d,.8t,r16, a chord in braces{5.1 5.2}.4, effect codes5.3:hv) or a value outside this list is an error, named by the reader. Nothing carries over from one measure to the next: a measure can be read, written or replaced alone. - <a id="pitch"></a>A note is its pitch, the one that sounds (scientific pitch notation: middle C is
C4;##andxa double sharp,bba double flat). It is named as written:D#5andEb5are two notes written differently, and a reader keeps the name and never changes it; a writer writes it back as it is. A writer writes a letter in capitals. - On a track with strings,
@nsays the string, numbered from 1 (the highest):E4@1is the open high E,G4@1its third fret. The fret is never written: it follows from the pitch, the string, the tuning and the capo. A note without@there is placed by the reader, by the rules Cesure places an import with, the whole track around it, and a writer writes the string chosen; mixed with notes that say their string, it takes the strings those leave free. Refused, by name, rather than guessed: a pitch lower than every open string of the track; a chord that leaves it no free string; a hammer or slideh,slfrom it or aimed at it, ornhon it (they need the string); a tietwith no note of its pitch to continue. A string past the strings of the track is kept: the note sounds its pitch, and has no fret until the track has that string again. On a track without strings,@is an error: the note is its pitch alone. - A muted note has no pitch, only a string:
x@6. - A drum note is
pand its General MIDI key, fromp0top127(p36a bass drum,p42a closed hi-hat): it takes a place among the notes of a beat or a chord, with its own properties; a key past 127 is an error. It is a note of aDRUMStrack, which holds no other: it sounds that key of the General MIDI standard kit and is drawn on the percussion staff where the kit writes that piece. A track written without an instrument whose notes are all drum notes — what files written beforeDRUMShold — is read as aDRUMStrack; a track mixing drum notes and pitches, or holding drum notes under an instrument with pitches, is an error naming the track. A reader that does not represent it keeps it on its beat. - On input only, a reader also takes a note written
fret.string(3.1,x.6muted) on a track with strings, as a tablature is copied: it is the pitch that place sounds, named as the key in force in the measure names it, on that string, and a writer writes it back asG4@1. On a track without strings, such a note has no pitch: it is kept on its beat as written, silent. - A tie is written like any note, with the note property
t:E4@1{t}prolongs, without attacking again, the note it continues on its line — its string, or on a track without strings its pitch — on the same staff, in the same voice of that staff, in the beat before, the last beat of the previous measure when it opens a measure; never a note of another voice or staff. The reader keeps it as written and guesses nothing. - A chord is its notes in parentheses:
(A2@5 E3@4 A3@3).4. A rest isr:r.2. - The fret has no ceiling: a fret is the pitch less the open string and the capo, however high (some guitars have 27 or 30), and is kept as written. A note written without
@is placed on the neck first — frets up to 24, counted from the capo —, past it only when nothing else holds, on any string at or under its pitch; it is refused only when it is lower than every open string. Refused, by name, on a track with strings: a note lower than its open string — a fret under zero —, whether writtenpitch@norfret.string. - Two notes may strike one string at an instant, in one beat or two voices, as MuseScore and Guitar Pro read them: each is read and written back on its string, a reader showing the clash (Cesure draws both in red and plays both). A writer should not make one: a string strikes one note at a time. A tied note
tthat prolongs the note before it on its string is no strike; a tie with nothing to prolong strikes. - Every refusal names where it is: the track, the measure (its id, else its rank), the staff, the voice and the token it could not take — and down to what it concerns when it is no note: a staff, a measure, a track or its tuning, a tempo or key change by its rank and measure, a repeat by its measure, the document.
- Properties go where they apply, and the place decides: braces right after a note are the note's (
E5@1{v}.4, a vibrato on that note); braces after the duration are the beat's (E5@1.4{d}, a dotted quarter). In a chord, each note carries its own:(E5@1{v} B4@2).4{d}. - Tuplets: every beat of the group carries the property, and the group is the run of beats that carry it:
E5@1.8{tu 3} F#5@1.8{tu 3} G5@1.8{tu 3}is three triplet eighths, the time of one quarter. A beat's length is its value ×m/nfortu (n m).
| Beat property | Meaning |
|---|---|
d | Dotted: the duration × 1.5. |
dd | Double-dotted: the duration × 1.75. Written alone, never with d; a beat that carries both is double-dotted. |
tu 3 | Triplet: three beats in the time of two of the same value. |
tu (n m) | Tuplet: n beats in the time of m — tu (5 4) a quintuplet; n from 2 to 32, m from 1 to 32, any other refused by name. |
tt | Every note of the beat is tapped. |
hide | On a rest: a rest the source does not print (MusicXML print-object="no", LilyPond's s, an invisible rest of MuseScore). It keeps the time of its voice, sounds nothing and is never drawn: r.2{hide}. A reader that does not know it keeps it on its beat and writes it back. |
fermata, fermata shape, fermata (shape stretch) | A fermata over the beat, note or rest. shape is one of veryshort, short, shorthenze, normal (the default, written as fermata alone), long, longhenze, verylong — SMuFL's and LilyPond's seven. Playback holds the beat as MuseScore does: from its start to the next beat any voice of any track starts, the tempo divided by its stretch — by default 1.25 (very short), 1.5 (short, short Henze), 2 (normal), 3 (long, long Henze), 4 (very long). A stated stretch, from 1 to 5, replaces the shape's: E4@1.2{fermata (long 3.5)}. alphaTab's fermata short\|medium\|long is read too, its second value Guitar Pro's length. |
beam up, beam down | The beat's stem is forced up or down, as alphaTab writes it (MusicXML's <stem>, MuseScore's stem direction of a chord). Absent, the stem takes its voice's side: with several voices on the staff the first and third up, the second and fourth down; a voice alone chooses by the middle line. Written only where it differs from that side; a beamed group with no voice side takes the side of the first of its chords forced to one; chords forced both ways make a knee. alphaTab's other beam values (invert, auto…) are kept on their beat and written back. It never changes what sounds. |
beam split, beam merge, beam splitsecondary | How the beat is beamed to the next one of its voice, as alphaTab writes it (MusicXML's <beam>, MuseScore's beam mode of a chord): split stops the beam after it, merge carries it on to the next beat — over a rest, past a beat of the meter —, splitsecondary stops its beam lines past the first where the beam goes on. Absent, beats are grouped by the meter: flagged notes in one quarter, or one dotted quarter of a compound meter. Written only where it differs from that grouping; a beam stops at the bar line. A beat may hold both a side and a beaming: {beam up beam merge}. It never changes what sounds. |
clef name | The staff changes to clef name (a staff's clef name: treble, alto, bass8vb…) right before this beat, until the end of the measure: E4.4{clef treble}. A change at the start of a measure is the staff's clef, not this property. Written on one beat of the staff struck at that instant, the first voice's when it has one there. A name a reader does not know is kept on its beat and written back; a value that is not one name ({clef}, {clef 5}, {clef treble bass}) is refused. It never changes what sounds. |
ot 8va, ot 8vb, ot 15ma, ot 15mb | The beat stands under an octave line, as alphaTab writes it (MusicXML's <octave-shift>, MuseScore's Ottava): its heads are written one or two octaves under (8va, 15ma) or over (8vb, 15mb) the pitch they sound, which stays the note's. A line belongs to its staff: every voice of the staff is under it at an instant, and the line drawn is the run of beats so marked. ot regular is none; another value is kept on its beat and written back. It never changes what sounds. |
| Note property | Meaning |
|---|---|
h | Hammer-on or pull-off to the next note on the same string (which one follows from the pitches). |
sl | Slide to the next note on the same string. |
be (offset value …) | Bend, as alphaTab and Guitar Pro hold one: its points, each an offset along the note from 0 (its start) to 60 (its end), rising from one point to the next, and a value in quarter tones above the pitch struck, from -12 to 12 (4 is a whole tone). Between two points the pitch moves in a straight line; past the last it holds. A bend, a release, a pre-bend are read from the points: be (0 0 15 4 60 4) a whole-tone bend in the first quarter of the note, then held; be (0 0 15 4 30 4 45 0 60 0) a bend and release; be (0 4 60 4) a pre-bend; be (0 4 15 4 30 0 60 0) a pre-bend and release. Any other shape is an error. The pitch is the one struck, before the bend. |
b (0 n) | The bend version 2 wrote, read and never written: Guitar Pro's bend to n quarter tones, be (0 0 15 n 60 n). Any other shape (b (0 4 0), b (2 4)) is an error. |
v | Vibrato. |
lht | Tapped note. |
t | Tied to the note it continues (see above). |
tw | On the note a tie leaves: the tie waits for the next note of its line (its string, or its pitch without one) in its voice, past the beats between, rests included — LilyPond's tieWaitForNote, an arpeggio held into its chord. That note, marked t, is not struck again. Written only where a beat stands between the two. |
g | Ghost note: played very softly (Cesure strikes it at half the loudness of the same note played full) and drawn in parentheses. A tied note is as soft as the note it continues. |
lr | Let ring: the note sounds on past its written length, as alphaTab plays it — through the next beats of its voice, across the barline, until one rests or, on a string, plays its string, never longer than its measure lasts. Its written duration does not change. A tied note rings as the note it continues; a muted note never does. |
ba n | Version 2's bend height of n semitones kept on a note whose bend was taken off. Read, and dropped: no bend is played, and it is not written back. |
kept "…" | Everything a reader keeps on that beat or note and has no property for — the keys of a version 1 file, a technique or a hand it cannot name — as percent-encoded JSON. Write it back as it is. |
nh n | Natural harmonic: the open string touched at fret n (12 an octave up, 7 and 19 an octave and a fifth, 5 and 24 two octaves): the pitch, which is the one the harmonic rings, does not say where. nh alone is read as nh 12; on a note written fret.string, as alphaTab reads it, at its own fret. |
ah n, th n, ph n, sh n, fh n | Artificial, tapped, pinched, semi and feedback harmonic: the node touched n frets above the fretted note, a whole number (ah 12 an octave up, ah 7 an octave and a fifth); ah alone is ah 0. The pitch written is the one it rings; the pitch a node rings is alphaTab's. |
hand A / hand B | The note is set to the low (A) or high (B) hand of a two-hand part. Absent = derived by the reader, not stored: the simplest rule puts a note below a split point in A (Cesure's default is middle C, C4); Cesure also offers the most playable hand, worked out over the whole track. The rule and its split point are reader preferences, never part of the file, and a written hand always wins over them. Not written on a piano's staves, which say the hand. |
Examples: C4@3.4 (fret 5 on string 3 of a standard guitar, a quarter); (G2@6 B2@5 D3@4).2{d} (a dotted half chord); F#4@2{be (0 0 15 2 60 2)}.8 (fret 7 on string 2, a half-tone bend, an eighth); x@6.16 (a muted string); E5@1{nh 12}.4 (the octave harmonic of the open high E).
Reserved forms
These forms are part of the grammar so that they can be added later without a new version. A reader that does not represent them keeps them as written (see below); Cesure writes none today.
| Form | Meaning |
|---|---|
{lyrics "text"} on a beat | The syllable sung on that beat. |
{ch "Am7"} on a beat | The chord symbol shown above that beat. |
{mt n} on a note | The note sounds n cents (a whole number, signed) away from its named pitch: C4{mt 50} a quarter tone above C4. A reader that does not represent it keeps it and plays the named pitch; a value that is not a whole number is refused. |
What a reader does not understand, it keeps
A reader must keep what it does not recognise and write it back unchanged, at the place it read it — in the skeleton as in the notation:
- an unknown key of any object is kept with that object. One whose name, once its leading
{are taken off, is a field version 2 gave that object in place of version 1's (measureon a tempo change,staveson a measure,repeatson the score) is written with one{more, and read with one less:{measureon a tempo change is the unknown keymeasure,{{measurethe unknown key{measure; - an unknown beat property is kept on its beat, an unknown note property on its note — including alphaTab properties the model does not hold, even those that change the rhythm (
gr,tr,tempo) — and a note in a reserved form the reader does not represent stays on its beat; - a reader that shows fewer staves or voices than a measure holds keeps the others with their measure, and writes them back;
- an unknown value of an optional field (
instrument,hand) is kept and written back, until the user sets that field.
A field of the skeleton written with another type than this specification gives it — a list as text, an object as a list, a voice as a number, a repeat's start that is not true or false — is refused, naming where it is: it is never read as empty. Absent, a field keeps its default, and a required one (a staff's voices) is refused.
What cannot be kept is refused: an unknown duration, an unknown pitch class in a tuning, or a beat or note the grammar cannot read, or a document whose JSON nests more than 64 levels deep. The reader then refuses the file by naming what it could not read — guessing would change the rhythm or the tuning.
This is what lets one account use an older and a newer build at once, and an agent add what a build does not know yet, without either ever silently losing a part of the piece.
For agents: working on a range of measures
- Name measures by id. A range is a list of ids, or a first and a last id; it survives edits elsewhere in the piece, where measure numbers do not.
- Replace a range as a whole: the measures of every track for those ids, with their time signatures, staves and voices. Keep the ids of the measures you keep; leave out the id of a measure you insert — the reader gives it one — and never reuse an id for another measure.
- Each measure stands alone: its durations are all written, and its voices should fill its time signature. A tempo change or a repeat named by the id of a measure you keep stays on it.
- The revision is not in the file. Whoever stores the file keeps a revision number beside it; an agent says which revision it read when it writes, and a write over a newer revision is refused, so that nobody overwrites what they have not seen.
- Write a note by its pitch, and on a track with strings its string (
E4@1): never a fret. A note writtenfret.stringis still read, and written back as a pitch. - Validate the skeleton with the JSON Schema before writing; the notation is checked by the reader, which names the beat it cannot read.
Transport
A .cesure file is plain text that compresses about five times over: a server should compress it in transit (Content-Encoding: gzip or br), and a client should accept it so. The file itself is never compressed.
Versioning policy
| Change | Action |
|---|---|
| A field with a default, a beat or note property, a reserved form put to use | No new version: a reader that does not know it keeps it |
A value added to an optional enum (instrument) | No new version: kept by a reader that cannot name it |
| A new duration, a new pitch class, a removed, renamed or retyped field, a field whose absence changes meaning | New version, with a migration from every older one |
A pitch between the semitones — a quarter tone — is the reserved note property mt, not a new pitch class: it needs no new version.
The durations of version 2 go down to the sixty-fourth (64): version 1 stopped at the thirty-second. The tempo became a number within version 2: every file read before reads the same, and a reader that still takes it as an integer refuses only a file whose tempo is not whole.
A reader refuses a file whose version is above the ones it reads, rather than misread it, and proposes the update: an application that reads version 2 alone refuses a version 3 file so. Version 2 and version 1 files (v2.md, v1.md) are read forever and migrated in memory (Reading version 2); nothing writes them. A key that a version 1 file held on a beat or a note, unknown to the reader, is kept: saved in version 2 or 3, it goes into the kept property of that beat or note, its name and value unchanged — a name opening with { included: read back, a key of kept is kept exactly as the same key of the file would be. A kept whose value is not percent-encoded JSON (%+1, %FF alone, a value that is not an object) is an error, named by the reader. A key that a version 1 file held on another object keeps its name the same way, including a name version 2 gives a field of that object (measure on a tempo change, staves on a measure, repeats on the score): it is written {measure, and read back as the key measure, never as the field. A version 1 file escaped nothing and is read as written: its key {repeats is the key {repeats, saved as {{repeats.
Reading version 2
A version 2 file says the same once read: every note sounds the same pitch, at the same instant, for the same time, and on a track that keeps its strings, on the same string at the same fret — save a track marked PIANO (below). It is migrated in memory, as it is read, and never written again:
- a note
fret.stringis the pitch that place sounds, named as the key in force in its measure names it (the stated key, else the one found from the notes), on that string; a natural harmonic is touched at its fret,nhbecomingnh n; a note version 2 wrote by its pitch keeps its name; tuningabsent is the standard guitar, written out in full (["E4","B3","G3","D3","A2","E2"]), and an open string a{"note":"E","octave":4}object;- a
PIANOtrack with notuningwritten is a guitar: there,PIANOwas only the sound a track played and every track a tablature — it keeps its six strings, its frets and its capo (version 1 alike); - a
PIANOtrack that writes itstuningbecomes a piano without strings: its notes keep their pitches — a capo is in them —, lose their strings, and the hand each one showed becomes the staff it is written on:hand Bthe right hand (staves[0]),hand Athe left (staves[1]); a note without one goes to the right hand from middle C (C4) up, else to the left — version 2's default rule, frozen for the migration; a tie takes the hand of the note it continues; - two notes struck on one string at an instant (in one voice or two, versions 1 and 2 alike) stay as written, each on its string at its fret, as in a version 3 file;
- a bend
b (0 n)is Guitar Pro's bend to n quarter tones,be (0 0 15 n 60 n)— from the pitch struck to its height in the first quarter of the note, then held; aba nreads and is dropped; - everything else reads as in version 2:
kept, unknown keys, reserved forms.
Two notes have no pitch to give: a note on a string past the tuning of its track, and a muted note on a piano. Each is kept on its beat as written (3.7, x.6), silent as it was, and written back so — on a piano on the staff of the hand it carried (hand A: the left), without that hand, which its staff says, and two of them may share a string there: a piano has no strings. On a track with strings, what is kept so stays as written too. A note written by its pitch alone is placed, on a string no voice takes at that instant, with all of them at once, and the file refused, naming it, when none is left. On a piano laid on strings, the voices of every staff, its first's then the next ones', are its notes: the first two voices split between the hands as version 1's beats, each later voice's notes going, each without its hand, to a voice of its own on the staff of their hand (by the default rule when none is written). What goes is said. Cesure's own corpus holds none.
JSON Schema
schema/v3.json (JSON Schema Draft 2020-12), served at https://cesure.app/format/schema/v3.json, describes the skeleton; the version 2 and version 1 schemas stay at schema/v2.json and schema/v1.json. Validate the schemas and every example with:
pip install jsonschema
python3 scripts/validate.py
Examples
examples/simple.cesure— one track, two measures, a second voiceexamples/song.cesure— several measures with chords, rests, a repeatexamples/band.cesure— a guitar and a drum part written by General MIDI key, at a tempo that is not wholeexamples/piano.cesure— a piano on two staves, a pickup, and a guitar beside itexamples/v2/andexamples/v1/— the version 2 and version 1 examples, as they were
Maintenance
The format is developed and regression-tested inside the Cesure application; this section documents how it stays stable (the tooling lives in the app repository, not here).
A .cesure file that a user saved must open identically forever. Before changing the model or the notation:
- Additive (a field with a default, a property, a reserved form put to use) → no new version. Update this README,
schema/v3.jsonandCHANGELOG.md, and add the addition to a file of the corpus so that it is actually exercised. - Structural (see the table above) → raise
CURRENT_VERSIONinCesureSerializer, add the migration, and keep a frozen file of every older version: it must still load. - Never edit a frozen file to make a test pass: an old file that no longer reads the same is the bug.
- Run the guards — all in
:score:./gradlew :score:jvmTest. They hold the schema against the model, the round trip of every example and catalog piece, the frozen v1 and v2 corpus — each v2 file saying, note for note, what it said —, the refusal of a newer version, and the keeping of unknown keys, properties and values.
The application behind the format
.cesure is written and read by Cesure — a guitar tablature editor and practice toolkit that runs in the browser, on Android and on iOS. It imports Guitar Pro, MusicXML, MIDI and AlphaTex, transcribes audio to tablature, and plays scores back with a tuner, a metronome and a piano roll. The schema in this repository is checked against its model on every build, so a field added on one side and not the other fails the build.
License
This specification is released under the MIT License.