The metrical model used in the MeloSpy (cf. Metrical System) is a special case of a more general annotation concept. The more general scheme works not on a single event basis but on event sequences (which comprises single events as a special case). These events sequences are called Sections in MeloSpy, where annotations can be attributed to. Sections can be chained to lists (SectionLists), which have the special property that Sections cannot overlap and need not to have gaps. Mostly, they have to cover also the full range of a melody. This limitations will be amended in future version. In the Jazzomat Project, a certain set of predefined SectionLists are mandatory parts of a Solo object. These entail phrase, chord, form, chorus and key structures (cf. Fig. 4: Classes related to Solo.).


Fig. 4: Classes related to Solo.

The phrase structure is given by a SectionList where the Section values (labels) are enumerated, the same holds for the chorus sections. For chord, forms, and keys the section values are represented by special objects, which will be explained in below.


Chords play a major role in jazz and for jazz improvisation, thus a comprehensive representation of chords is vital for the Jazzomat Project. A chord is basically a pitch class set with a certain structure, where the root is the most important tone. Chords are represented by chord labels, which hold all important information and which have to follow a certain syntax. The MeloSpy chord syntax is designed to match as closely as possible the chord symbols that are in practical (jazz) use. Internally, a Chord object consists of a root note, a triad type (major, minor, diminished, augmented, half-diminished/7b5) and an optional bass note (for slash chords and inversions). Sevenths (major, minor or diminished), ninths (natural, flat, or sharp), eleventh (natural or sharp) and thirteenth (natural or flat) are optional. The chord label syntax is as follows:

chord             ::=  no_chord | normal_chord | special_chord
no_chord          ::=  "NC"
normal_chord      ::=  generic_note_name triad_type [seventh] [ninth] [eleventh] [thirteenth] [slash_expr]
special_chord     ::=  generic_note_name exception [slash_expr]
generic_note_name ::=  note_letter [accidental]
note_letter       ::=  "A"-"G"
accidental        ::=  sharp|flat
sharp             ::=  "#"
flat              ::=  "b"
triad_type        ::=  major | minor | augmented | diminished |sus
major             ::=  "maj" | ""
minor             ::=  "min" | "m" | "-"
augmented         ::=  "aug" | "+"
diminished        ::=  "dim" | "o"
sus               ::=  "sus"
seventh           ::=  ["j"]"7"
ninth             ::=  "9" [sharp|flat]
eleventh          ::=  "11" [sharp]
thirteenth        ::=  "13"[flat]
slash_expr        ::=  "/" generic_note_name
exception         ::=  "7b5" | "alt" | "7#9" | "m7b5" | "7sus4" | "maj7"

Fig. 5: Classes related to chord, form, key.


A scale in turn is a subset of the full chromatic scale, hence it is a pitch class set. (Octave positions are not considered relevant for scales.) In this abstract definition, a chord is also a scale, conversely a scale can be seen as a chord. This principal isomorphism is the base of the chord scale approach. However, traditionally there are extra conditions to differentiate between chords and scales. First of all, chords in the traditional sense are sounding vertical structures, only by viewing them as (abstract) pitch class sets the isomorphism is applicable. Second, scales are thought as “material sets” used for horizontal melody developing, together with some kind of internal hierarchy of scale tones (the exact nature of these hierachies are still not fully clear for music theory and music psychology). Third, scales are often pitch class sets that have only major and minor seconds and thirds as intervals between adjacent scale tones. On the other hand, chords typically consists of only major and minor thirds (and sometimes fourths) as adjacent intervals. There is however a overlapping domain, e.g., for 5-, 6- and 7-tone chords.

MeloSpy predefines the most commonly used scales (and a few other), which can be accessed via a singleton ScaleManager object.


In our framework, keys are simply modelled as the conjunction of a root note and a scale.


Jazz pieces typically keep a constant form scheme throughout. The form is normally defined by the theme of the tune and remains the same for solo chorusses. A typical example is the 32-bar song form with the basic scheme AABA, where each form part consists of 8 bars. The MeloSpy grammar for FormNames is based on the standard notation used in music theory. Form parts are consecutively named with upper case letters. Variants of form parts are marked with trailing primes, which numbers must be strictly increasing for consecutive variants.

An additional numbering must be employed to mark the beginning of a form and to prevent ambiguities. Each form part denoted by a certain letter (ignporing variants) must be consecutively numbered from their first occurrence on, beginning with 1. E.g., the AABA form should be written A1 A2 B1 A3. The very first form part always gets the symbol A1. The form parser knows that a form is repeated when it finds another A1 symbol in the form part sequence. Furthermore, there is a special symbol I representing “Introductions” or “Interludes”, which can appear at any time and need not to be numbered.

Finally, there is the possibility to undermine this strict logic by using a special wildcard syntax. In preceding a form part name with a asterisk *, this form part can be occur at any place. It works like a reset of the form part counter, each subsequent form part will be checked only up to the last wildcard part or the last A1 part.

Examples for valid forms: A1 B1 A'2 C1, A1 B1 C1 D1, I A1 A'2 A''3 B1, *B1 A''3 A1 A2

Examples for invalid forms: B1 A1, A'1 A2, A1 A''2, A1A3, A2 B1, *B1 A''1 A3