A ligature consists of breves, longae and maximae, joined by a vertical line. There are some exceptions: 1. at the beginning a. a ligature may begin with two semibreves: this is denoted by a left upward stem. The note shapes are like breves. b. if the second note is lower than the first (descending start), then encoding of the duration of the first note is changed as - a longa is denoted by a simple brevis head; - a brevis is denoted by a left downward stem (and brevis head). 2. at the end if the last note is lower than the penultimate one (descending end), and it is a. a longa, then it is represented by a brevis head; b. a breve, then the last two notes are drawn as parallelogram (ligatura obliqua, flexa). This is possible only if the penultimate note would otherwise have brevis shape, i.e. it must be a brevis, or the ligature must be either LB or SSB Notes: 1. reading a ligature is unabiguous; writing one is not: a. any two brevis heads can be replaced by a flexa (except 2.a. above; this implementation never substitutes) b. stems of maximae are often omitted (this implementation omits them always). 2. theorists claim that a pair of semibreves are admitted anywhere, but I have never seen this usage. 3. any note can be dotted or colored independently of others (even either note of a flexa).