TL;DR
This paper introduces a hierarchical recurrent neural network (HRNN) for generating symbolic melodies. By breaking down melody generation into coarse-to-fine levels (bars, beats, and notes), the HRNN effectively captures long-term musical structure, outperforming single-layer LSTMs and recent models like MidiNet and MusicVAE in human evaluations.
What Problem Does This Paper Address?
Generating realistic and structurally coherent symbolic melodies using neural networks is a challenging task. While Recurrent Neural Networks (RNNs), particularly LSTMs, have shown promise, they struggle to capture the long-term dependencies and hierarchical structure inherent in music. Existing models often focus on note-level generation, making it difficult to learn overarching patterns like phrases or sections. This paper aims to address this limitation by explicitly modeling musical structure at multiple time scales.
Methods
The core of this work is the proposed Hierarchical Recurrent Neural Network (HRNN). This architecture consists of three interconnected LSTM-based sequence generators operating at different granularities:
- Bar Layer: Generates "bar profiles," representing high-level temporal features of an entire bar.
- Beat Layer: Generates "beat profiles," representing rhythmic patterns within a beat.
- Note Layer: Generates the actual sequence of musical notes, conditioned on the bar and beat profiles generated by the higher layers.
This hierarchical structure allows information to flow from coarse (bar) to fine (note) levels, guiding the generation process. The authors also incorporate a "lookback feature" into each LSTM layer, inspired by prior work, to help the model memorize and potentially repeat recent events.
Datasets
The primary dataset used in this study is the Wikifonia dataset, consisting of 3,859 lead sheets in MusicXML format. The dataset was preprocessed to include only melodies with a 4/4 time signature, and notes were octave-shifted to a specific range. 90% of the data was used for training, and 10% for validation.
Key Insights and Ideas
- Hierarchical Structure is Key for Long-Term Melody Generation: The paper strongly suggests that explicitly modeling music at different temporal resolutions (bars, beats, notes) is crucial for generating melodies with coherent long-term structures, something single-layer models struggle with.
- Profiles as High-Level Guidance: The concept of "bar profiles" and "beat profiles" as abstract representations of musical structure proves effective in guiding the note generation process, leading to more organized outputs.
- Coarse-to-Fine Generation Works: The flow of information from higher (bar/beat) to lower (note) layers effectively constrains and guides the generation of finer musical details, simplifying the learning problem for the note layer.
- Human Evaluation is Paramount: The authors emphasize the subjective nature of music quality and rely heavily on human behavioral experiments to validate their model's performance, highlighting the importance of user studies in this domain.
Key Results
- Improved Melody Quality: Human evaluations consistently favored melodies generated by the HRNN (especially the 3-layer version) over single-layer LSTMs (HRNN-1L). The HRNN-3L was preferred over HRNN-2L, indicating a benefit from the full hierarchical structure.
- Better Rhythm and Pitch Prediction: The Note Layer's accuracy curves showed that the presence of beat and bar profiles significantly improved both no-event (rhythm) and event (pitch) prediction accuracy.
- Competitive Performance: In comparisons with state-of-the-art models like MidiNet and MusicVAE, the HRNN-3L was favored by human evaluators in 2AFC experiments.
- Music Turing Test: While not fooling humans consistently (33.69% of HRNN-3L generated pieces were mistaken for human-composed), the HRNN-3L performed better than the HRNN-1L in a music Turing test.
Limitations and Future Work
- Rhythm Quantization: The paper acknowledges that quantizing bars into 16 time steps limits the representation of finer rhythmic details like triplets.
- Time Signature Constraint: The model was trained only on 4/4 time signatures, limiting its applicability to other musical meters.
- Lack of Phrase-Level Modeling: The current HRNN considers beats and bars but does not explicitly model higher-level structures like phrases, which are common in pop music.
- Dataset Quality: The authors note that the quality of the human-composed dataset itself was not perfect, potentially impacting the evaluation of how well the model could "fool" humans.
Future work could involve incorporating more complex rhythmic representations, supporting multiple time signatures, and extending the hierarchy to include phrase-level modeling for even more sophisticated melody generation.
Summary updated