From Interval Matrix to Score: A Generative Compositional Framework
GeCo-Tool is a web application for generating and exploring musical sequences derived from the interval matrix: a systematic representation of all transpositions of a given interval sequence, analogous to the 12-tone row matrix used in serial composition. The tool is designed for composers and music theorists interested in algorithmic and constraint-based melodic generation.
Starting from a small set of parameters — a starting note, an interval pattern, and a rhythmic mode — the engine generates a complete MIDI sequence that can be played back, transformed, and downloaded directly from the browser.
A sequence in GeCo-Tool is a cyclic interval pattern applied to a starting pitch-class. The cycle repeats until the original pitch-class is recovered (closure condition). Four structural types are available:
Each cycle alternates one interval and one leap. The sequence repeats until the starting pitch-class is recovered.
| Parameter | Description | Example |
|---|---|---|
| Interval | Semitone step within the cycle | 3 (minor third up) |
| Leap | Semitone jump connecting cycles | −1 (semitone down) |
Each cycle contains two interval/leap pairs (Interval1+Leap1, Interval2+Leap2), producing longer periodic structures and richer melodic contours.
| Parameter | Description |
|---|---|
| Interval1, Leap1 | First interval/leap pair |
| Interval2, Leap2 | Second interval/leap pair |
Three interval/leap pairs per cycle (Int1+Lea1, Int2+Lea2, Int3+Lea3), yielding the richest harmonic variety and the longest before closure.
Three consecutive intervals per cycle (the 3D equivalent of Binary), with the cycle repeating until the starting pitch-class returns. No explicit leap parameter: the three intervals determine both step and contour.
The Tempo selector controls how note durations are assigned to the generated pitch sequence. Four modes are available:
| Mode | Description |
|---|---|
| sequence-constrained | Duration changes occur at structurally significant points of the sequence (e.g. at cycle boundaries). Rhythm mirrors the periodic structure of the intervals. |
| length-constrained | Duration changes occur every N notes, where N is chosen randomly from {2, 3, 5, 6}. Rhythm is semi-independent of pitch structure. |
| constant | All notes share the same duration, selectable from whole note to sixteenth note. Useful for studying pure pitch relationships. |
| free | Each note receives an independently randomised duration (quarter, eighth, or sixteenth). Maximum rhythmic variety. |
The BPM slider (top right, 60–240 bpm) controls playback speed independently of the generated MIDI — the score is always rendered at the reference tempo.
These operations — drawn from serial music theory — transform the generated melody while preserving its interval-class structure. They are applied to the last generated or already-transformed sequence.
| Button | Operation | Description |
|---|---|---|
| T | Transpose | Shifts all pitches by a chosen number of semitones (−11 to +11). |
| I | Invert | Melodic inversion: each interval is reflected around the first pitch (ascending becomes descending and vice versa). |
| R | Retrograde | The sequence of pitches is reversed in time. |
| RI | Retrograde-Inversion | Inversion followed by retrograde: the classic fourth form of a tone row. |
These operations act exclusively on the duration sequence, leaving pitches unchanged. They mirror the pitch-class transformations but in the time domain.
| Button | Operation | Description |
|---|---|---|
| S+ | Shift forward | The duration pattern is cyclically advanced by two steps (the last two durations move to the front). |
| S− | Shift backward | The duration pattern is cyclically retarded by two steps (the first two durations move to the end). |
| I | Rhythmic inversion | Durations are ranked by length and replaced by their complementary rank (the longest becomes the shortest and vice versa). |
| R | Rhythmic retrograde | The sequence of durations is reversed, producing a time-mirror of the rhythm. |
Adds a left-hand accompaniment notated on the bass clef. Three styles are available:
Constrains the melodic range to approximately 1 octave (checkbox checked) or 2 octaves (default). Useful for keeping the melody within a singable range.
Transposes the entire output two octaves down and notates it in bass clef. Useful for exploring the same sequences in a lower register (cello, bassoon, left hand, etc.).
Exports the current state (including any applied transformations) as a standard .mid file, compatible with any DAW or notation software.
Allows importing a sequence previously generated. Any transformation can be applied on imported sequences as if it were generated at the moment, but for the result to be consistent, the user should know the sequence type, tempo and harmony type (if present) otherwise the harmonization of the transformed sequence can be incorrect. By selecting both the midi file and the txt file, saved concurrently with the midi file, all parameters are correcly set.
GeCo-Tool is a browser-based application. The frontend (HTML/CSS/JavaScript) communicates with a lightweight Python/Flask backend running locally on port 5000, which handles MIDI generation and MusicXML score rendering.
python app.py and ensure port 5000 is free.
GeCo-Tool has been developed by Roberto Olmi and Marco Bittelli, as an application of their extensive study about the generation of musical sequences based on the Interval Matrix.
The app is completely free to use, in the spirit of collaboration between musicians and musicologists. The developers welcome feedback and/or reports of bugs at any of the email addresses listed below.