Abstract
Generating symbolic music with long-term structure and user controllability remains a significant challenge in deep learning. We present MusicFrameworks, a hierarchical system that decomposes melody generation into a multi-step process. By separating high-level structural "sketches"—including rhythm and pitch contour—from the final note realization, the system enables fine-grained user control and produces full-length melodies with consistent thematic structures. In subjective evaluations, MusicFrameworks achieved musicality comparable to human-composed pop songs.
Introduction
While deep learning models have excelled at generating realistic audio, symbolic music generation (the creation of musical scores) often lacks the long-term coherence found in human compositions. Most existing models generate music note-by-note, frequently losing thematic consistency over the course of a full song. Furthermore, these "black box" models offer limited controllability, making it difficult for users to specify structural constraints or variations. MusicFrameworks addresses these issues by treating a song as a hierarchy of structural elements rather than a flat sequence of notes.
The MusicFrameworks Hierarchy
The core of the proposed system is the "Music Framework," an abstract, human-readable representation of a song's structure. This framework operates across three distinct levels:
- Section Level: Defines the broad structure of the song (e.g., Intro, Verse, Chorus).
- Phrase Level: Captures repeating patterns and thematic relationships (e.g., an AABBB structure).
- Measure Level: Contains a "Basic Melody" (a simplified pitch contour) and a "Basic Rhythm Form."
Multi-Step Generation Process
Instead of employing a single end-to-end model, MusicFrameworks factors the generation process into several sub-tasks. This modular approach allows for smaller, more efficient models and incorporates musical domain knowledge as an inductive bias.
The generation pipeline follows these steps:
- Basic Melody Generation: A hybrid Transformer-LSTM model generates a "contour" (one note every two beats) based on the chord progression and song position.
- Rhythm Generation: The system generates 2-beat rhythm patterns guided by a rhythmic complexity descriptor.
- Realized Melody Generation: A final model synthesizes the basic melody, the generated rhythm, and the chord progression to produce the complete, note-level melody.
This factored approach provides unprecedented controllability. Users can manually edit the "skeleton" of the music—such as dragging the pitch contour—and the system will "fill in the blanks" to create a polished melody that adheres to those constraints.
Evaluation and Results
The system was trained on a cleaned version of the POP909 dataset, consisting of 909 Chinese pop songs. All songs were transposed to C Major and represented using scale degrees and 16th-note rhythmic units.
Key findings include:
- Architecture Performance: The hybrid Transformer-LSTM architecture outperformed standalone models, achieving a validation accuracy of 55.2% for melody prediction.
- Structural Advantage: Models utilizing the hierarchical framework significantly outperformed those without it, demonstrating the importance of structural constraints.
- Human-Level Quality: In a subjective listening test with 196 participants, melodies generated by MusicFrameworks were rated as being of equal or higher quality than human-composed music approximately 50% of the time.
- Controllability: The system demonstrated high fidelity to user constraints, matching specified pitch contours with over 92% accuracy.
Conclusion
MusicFrameworks demonstrates that factoring music generation into a hierarchical, interpretable framework significantly improves both long-term coherence and user controllability. While the current system is limited to monophonic melodies and simple triads, it provides a robust foundation for future work in polyphonic generation and automated structural analysis. By encoding musical rules into the model architecture, we can bridge the gap between probabilistic generation and intentional human composition.
Summary updated