🎵 GeCo-Tool

From Interval Matrix to Score: A Generative Compositional Framework

R. Olmi & M. Bittelli — Full Documentation

← Back to the App

Overview

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.

💡 No installation required. GeCo-Tool runs entirely in the browser and communicates with a lightweight local backend (Python/Flask) for MIDI and score generation.

Sequence Types

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:

Binary

Each cycle alternates one interval and one leap. The sequence repeats until the starting pitch-class is recovered.

p₀ → p₀ + interval → p₀ + interval + leap → … (mod 12, until p₀ returns)
ParameterDescriptionExample
IntervalSemitone step within the cycle3 (minor third up)
LeapSemitone jump connecting cycles−1 (semitone down)

Quaternary

Each cycle contains two interval/leap pairs (Interval1+Leap1, Interval2+Leap2), producing longer periodic structures and richer melodic contours.

ParameterDescription
Interval1, Leap1First interval/leap pair
Interval2, Leap2Second interval/leap pair

Senary

Three interval/leap pairs per cycle (Int1+Lea1, Int2+Lea2, Int3+Lea3), yielding the richest harmonic variety and the longest before closure.

Ternary

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.

ℹ️ All intervals and leaps are expressed in semitones. Positive values = upward motion; negative values = downward motion.

Tempo & Rhythm Mode

The Tempo selector controls how note durations are assigned to the generated pitch sequence. Four modes are available:

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

Pitch-Class Transformations

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.

ButtonOperationDescription
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.
💡 Transformations can be chained: apply R then T to obtain a transposed retrograde, etc. Each operation updates the score and MIDI in real time.

Rhythmic Transformations

These operations act exclusively on the duration sequence, leaving pitches unchanged. They mirror the pitch-class transformations but in the time domain.

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

Other Options

Harmony

Adds a left-hand accompaniment notated on the bass clef. Three styles are available:

Octaves

Constrains the melodic range to approximately 1 octave (checkbox checked) or 2 octaves (default). Useful for keeping the melody within a singable range.

Bass Clef

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

Download MIDI

Exports the current state (including any applied transformations) as a standard .mid file, compatible with any DAW or notation software.

Import MIDI

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.

Typical Workflow

  1. Choose a Start Note and a Sequence Type.
  2. Set the interval/leap parameters for the chosen type.
  3. Select a Tempo mode (and note length if constant).
  4. Optionally enable Harmony, Octaves, or Bass Clef.
  5. Press Generate — the score renders and MIDI is ready to play.
  6. Apply Pitch-Class or Rhythmic Transformations to explore variants.
  7. Adjust BPM and press Play to audition.
  8. Press Download MIDI to export the result.
  9. Press Reset to start fresh.

Technical Notes

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.

⚠️ The backend must be running locally before pressing Generate. Start it with python app.py and ensure port 5000 is free.

Credits

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.

← Back to the App