Logo designed by Michele Whitlow.
Abnormelodies is a procedural melody generator designed as a creative playground to inspire songwriters and musicians with unexpected musical ideas. Rather than attempting to compose finished songs, Abnormelodies generates melodies within user-defined constraints such as key, scale, register, time signature, and rhythmic options. The goal was never to replace creativity, but to spark it—sometimes with beautiful phrases, often with unusual ones, and occasionally with melodies strange enough to make you laugh.
The core idea was simple:
Even a single measure could become the starting point for an entirely new piece.
Abnormelodies was born in a conversation with a songwriter friend who wished for a tool that could generate unexpected melodic ideas to inspire new compositions. Although I had almost no knowledge of music theory at the time, I became fascinated by the challenge of translating musical concepts into software.
What started as an exploration of melody generation quickly became an exploration of systems: modeling notes, rhythm, notation, musical constraints, and the rules that shape a melody. I set out to build a playground for musicians, but instead found my own playground in the backend. There, I discovered a fascination with procedural generation, rule-based systems, and emergent behavior that continues to shape the projects I build today.
Built while I was teaching myself Ruby, this repository contains the procedural melody generation engine behind Abnormelodies, with Rails providing the API layer. It represents a period of intensive exploration into procedural generation, music notation, and software design.
Although the project is no longer under active development, I've chosen to preserve it as an important milestone in my journey as a software engineer. It represents an honest snapshot of my thinking as a self-taught developer early in my journey—how I approached architecture, problem-solving, and procedural generation while learning through experimentation, documentation, and persistence.
The repository remains public not because it reflects how I would build the project today, but because it accurately reflects an important stage in how I learned to think about software systems.
- Generate melodies procedurally within user-defined musical constraints.
- Support for any key, major or minor scale, and configurable register ranges.
- Configurable time signatures including 4/4, 3/4, and 6/8.
- Rule-based generation system for shaping melodic behavior (e.g. Smooth Resolve).
- Custom MusicXML generation pipeline that models musical notation directly rather than relying on an external notation library.
- Support for notes, rests, ties, dots, triplets, and clef selection.
- Implements a custom Beaming Service that automatically calculates note groupings for readable sheet music.
- Character system designed to influence melodic tendencies through configurable traits and behaviors.
- Object-oriented architecture built around musical concepts including notes, measures, fragments, pitches, notation, and generation rules.
The architecture of Abnormelodies centers around a generation pipeline that transforms a set of musical constraints into fully notated sheet music.
Melody generation begins with user-defined parameters such as key, scale, register, time signature, and enabled rules. From these constraints, the system constructs a melody by combining objects that model musical concepts such as notes, measures, fragments, rests, pitches, triplets, ties, and rhythmic augmentation.
Once the melody has been generated, the notation process calculates beaming and other notation details before translating the completed composition into explicit MusicXML for rendering by notation software.
Looking back, one of the most technically challenging aspects of this project was not the melody generation but modeling musical notation itself and designing a pipeline that could transform abstract musical ideas into correctly notated MusicXML.
- Ruby 3.1.0
- Rails 7.0.4
- PostgreSQL
- musicXML
- Action Mailer (Rails)
- nokogiri gem
- rest-client gem
- rack-cors gem
Although Abnormelodies is now an archived project, the playground remains online and fully functional. If you'd like to experience the project as it was originally intended, you can explore it here:
The React frontend that powers the playground is also available:
I began this project with almost no knowledge of music theory. Much of what appears in this repository was learned specifically to solve the software problems involved in procedural melody generation and musical notation. One of the most rewarding aspects of the project was discovering how much could be learned simply by trying to build something ambitious.
Although Abnormelodies is now an archived project, these were some of the ideas planned during active development. I've chosen to preserve them because they capture the original vision and direction of the project.
Expanded Character System — Characters would influence melody generation through configurable musical preferences and behaviors. For example, Antsy Adam might favor repeated triplets while rarely choosing rests. The underlying Character architecture is already implemented, with support for additional personalities.
Additional Rule Types — Expand the rule system with new musical behaviors that could be selected independently or combined to shape each character's personality.
Expanded Musical Vocabulary — Support additional rhythmic values, triplet variations, slurs, staccato markings, and other notation features to broaden the expressive range of generated melodies.
A planned interface for saving, rearranging, and layering generated measures into larger compositions, allowing musicians to develop ideas beyond a single generated melody.