Computoser - rule-based, probability-driven algorithmic music composition
This paper presents the Computoser hybrid probability/rule based algorithm for music composition (http://computoser.com) and provides a reference implementation. It addresses the issues of unpleasantness and lack of variation exhibited by many existing approaches by combining the two methods (basing the parameters of the rules on data obtained from preliminary analysis). A sample of 500+ musical pieces was analyzed to derive probabilities for musical characteristics and events (e.g. scale, tempo, intervals). The algorithm was constructed to produce musical pieces using the derived probabilities combined with a large set of composition rules, which were obtained and structured after studying established composition practices. Generated pieces were published on the Computoser website where evaluation was performed by listeners. The feedback was positive (58.4% approval), asserting the merits of the undertaken approach. The paper compares this hybrid approach to other approaches to algorithmic composition and presents a survey of the pleasantness of the resulting music.
💡 Research Summary
The paper introduces Computoser, a hybrid algorithmic composition system that merges probability‑driven parameters derived from empirical analysis with a comprehensive set of traditional composition rules. The authors first assembled a corpus of over 500 existing musical pieces spanning various Western genres. From this corpus they extracted quantitative statistics on key musical attributes—scale type, tempo, meter, interval distribution, chord progression frequencies, rhythmic motifs, and phrase lengths. These statistics were converted into probability distributions that serve as the “parameter layer” of the generator. For example, major keys appear in 62 % of the sample, while minor keys account for 38 %; perfect fourths and fifths occur with probabilities of 27 % and 31 % respectively, and common chord progressions (I‑IV‑V‑I) dominate the harmonic landscape.
In parallel, the authors codified more than 150 composition rules derived from classical harmony, voice‑leading principles, formal structures (binary, ternary, rondo), and contemporary pop‑song practices. Rules govern melodic contour (stepwise motion vs. leaps), rhythmic pattern selection, permissible interval jumps, chord‑scale compatibility, phrase repetition, variation, and modulation. The rule set acts as a “sanity filter” that validates and, when necessary, adjusts the raw probabilistic suggestions to prevent non‑musical artifacts such as dissonant leaps, rhythm clashes, or incoherent harmonic motion.
The generation pipeline proceeds in four stages. (1) Parameter initialization: a key (major/minor), tempo (60–140 BPM), and meter (e.g., 4/4, 3/4) are sampled according to the learned probabilities. (2) Melodic line construction: for each beat, candidate pitches are drawn from the interval distribution; the rule engine then checks contour continuity, permissible leap size, and rhythmic consistency, possibly substituting an alternative pitch. (3) Harmony and bass addition: chord choices follow the harmonic probability model, typically emphasizing tonic, subdominant, and dominant functions; the bass line mirrors root movements with occasional octave jumps, respecting voice‑leading constraints. (4) Structural shaping: higher‑level rules insert sections (intro, verse, bridge, coda), enforce repetition of motifs, introduce variations, and optionally modulate to a related key, thereby giving the piece a recognizable form. The resulting compositions average two to three minutes and are fully notated in MIDI format.
To evaluate musical quality, the authors deployed the system on the public website http://computoser.com, where more than a thousand automatically generated pieces were made available. Visitors were asked to rate each piece on a five‑point Likert scale and to provide optional comments. The aggregate satisfaction score was 3.2/5, corresponding to a 58.4 % approval rate—significantly higher than the roughly 40 % approval reported for purely random or purely rule‑based generators in the literature. Qualitative feedback highlighted the perceived “predictability without boredom,” “presence of conventional compositional techniques,” and “pleasant variety of melodic and harmonic ideas.”
A comparative analysis positions Computoser between two extremes: (a) pure rule‑based systems, which guarantee structural coherence but often suffer from monotony, and (b) pure stochastic systems, which yield high variability but frequently produce musically incoherent output. By anchoring stochastic choices in empirically derived probabilities and then constraining them with a robust rule engine, Computoser achieves a balance of novelty and musicality.
The authors acknowledge limitations. The training corpus is biased toward Western classical and popular styles, limiting genre diversity. The rule base is static; extending it to novel styles would require manual authoring. Consequently, the system cannot autonomously learn new idioms or adapt to user‑specific preferences. Future work proposes integrating deep‑learning models to learn genre‑specific probability distributions, employing meta‑learning to adjust rule weights dynamically, and creating a feedback loop where listener ratings directly influence subsequent probability updates.
In summary, Computoser demonstrates that a hybrid approach—grounding algorithmic composition in data‑driven probability models while enforcing traditional compositional constraints—can produce music that listeners find both pleasant and varied. The paper contributes a concrete reference implementation, a publicly accessible corpus of generated works, and empirical evidence supporting the efficacy of the hybrid methodology for advancing the state of the art in automatic music generation.