.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:

Why not MusicXML, MIDI, or AlphaTex?

FormatHuman-readableTablatureRound-trip losslessVersioned
.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

FieldTypeRequiredDescription
versioninteger✓Format version: 3. A reader refuses a higher one, and reads 2 and 1 forever.
scoreScore✓The piece.

The root holds nothing else: a key placed there belongs to nothing a reader could keep.


Score

FieldTypeDefaultDescription
titlestring"Untitled"Title of the piece.
artiststring""Composer or performer.
albumstring""Album, when the piece comes from one.
temponumber120Initial 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.
tempoChangesTempoChange[][]Tempo changes. Empty = constant tempo.
keystring—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.
keyChangesKeyChange[][]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.
licensestring""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).
attributionstring""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.
hideEmptyStavesbooleanfalseWhether the staves whose hideWhenEmpty is auto leave a system they play nothing in (MuseScore's "Hide empty staves").
hideEmptyStavesInFirstSystembooleanfalseWhether the first system too leaves out the staves that hide when empty (LilyPond's remove-first).
tracksTrack[][]The instrument tracks.

TempoChange

FieldTypeRequiredDescription
measurestring✓Id of the measure the tempo falls in.
atnumberWhere 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.
temponumber✓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

FieldTypeRequiredDescription
measurestring✓Id of the measure at whose start the key takes effect.
keystring✓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.

FieldTypeDefaultDescription
startbooleanfalseA repeated section opens at the start of the measure (|:).
endinteger—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.
endingsinteger[][]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.
directionsstring[][]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.
sectionbooleanfalseThe 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

FieldTypeDefaultDescription
namestring"Guitar"Track name.
tuningstring[]—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.
capointeger0Capo 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.
volumenumber1Volume in the mix, 0..1.
hideWhenEmptystring[][]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.
instrumentstring \nullnullWhat 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.
programinteger—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.
measuresMeasure[][]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.

FieldTypeDefaultDescription
idstring—Stable id of the measure's column, at most 64 characters. See Measure ids.
numeratorinteger4Beats per measure (time signature numerator), 1 to 128. Cesure refuses a file that writes a value outside the range, naming it.
denominatorinteger4Note value of a beat: 1, 2, 4, 8, 16 or 32.
incompletebooleanfalseIrregular 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.
barLineRightstring—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.
uncountedbooleanfalseLeft 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.
tsVisibilitybooleantrueWhether 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.
barNumberDisplaystring—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.
chordsobject[][]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.
stavesStaff[]—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

FieldTypeRequiredDescription
voicesstring[]✓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.
clefstring—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.

FieldTypeDescription
notestringPitch class: "C", "Cs", "D", "Ds", "E", "F", "Fs", "G", "Gs", "A", "As", "B" (s = sharp).
octaveintegerOctave 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 } ")"
Beat propertyMeaning
dDotted: the duration × 1.5.
ddDouble-dotted: the duration × 1.75. Written alone, never with d; a beat that carries both is double-dotted.
tu 3Triplet: 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.
ttEvery note of the beat is tapped.
hideOn 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 downThe 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 splitsecondaryHow 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 nameThe 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 15mbThe 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 propertyMeaning
hHammer-on or pull-off to the next note on the same string (which one follows from the pitches).
slSlide 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.
vVibrato.
lhtTapped note.
tTied to the note it continues (see above).
twOn 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.
gGhost 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.
lrLet 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 nVersion 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 nNatural 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 nArtificial, 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 BThe 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.

FormMeaning
{lyrics "text"} on a beatThe syllable sung on that beat.
{ch "Am7"} on a beatThe chord symbol shown above that beat.
{mt n} on a noteThe 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:

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

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

ChangeAction
A field with a default, a beat or note property, a reserved form put to useNo 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 meaningNew 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:

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

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:

  1. Additive (a field with a default, a property, a reserved form put to use) → no new version. Update this README, schema/v3.json and CHANGELOG.md, and add the addition to a file of the corpus so that it is actually exercised.
  2. Structural (see the table above) → raise CURRENT_VERSION in CesureSerializer, add the migration, and keep a frozen file of every older version: it must still load.
  3. Never edit a frozen file to make a test pass: an old file that no longer reads the same is the bug.
  4. 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.