Abstract
Recent advancements in deep learning have enabled automatic music composition, yet providing high-level emotional control remains a significant challenge. This paper introduces a novel conditional sequence-to-sequence (seq2seq) framework that allows composers to "steer" music generation using emotional intent. By mapping chord types to psychological valence and treating music generation as a translation task, the proposed system generates lead sheets that adhere to musical conventions while evoking specific intended emotions.
Introduction: The Challenge of Controllability
While deep learning models can generate music, they often function as "black boxes" with limited user control. A composer seeking a "melancholy" or "joyful" piece typically lacks the tools to guide a model toward these specific high-level qualities. Furthermore, training emotional AI is hindered by the lack of large-scale, objectively labeled datasets. This research addresses these gaps by proposing an objective "valence proxy" for data labeling and a controllable architecture that treats musical constraints as input instructions.
Methodology
The Valence Proxy
To avoid the subjectivity and labor of manual human tagging, the authors leveraged music theory to create an objective emotional labeling system. They utilized a pre-defined mapping of chord types to specific mood tags, which were then converted into numerical valence values (positivity vs. negativity) based on Scherer’s circumplex model of affect.
By calculating the median valence of chords within a single bar, the researchers could automatically label their entire training dataset with emotional metadata.
The Conditional seq2seq Architecture
The core of the system treats music generation as a Neural Machine Translation (NMT) problem. Instead of translating languages, the model translates "musical conditions" into "musical events."
The architecture consists of:
- Encoder (The Instructions): Processes a sequence of four high-level features per bar: Chord Valence (5 levels), Time Signature, Grouping Indicators (structural position within a phrase), and Event Density (rhythmic "busyness").
- Decoder (The Music): Generates the actual lead sheet events, including chord symbols, melody pitches, and durations.
The team compared two primary architectures: a Bidirectional Long Short-Term Memory (Bi-LSTM) network and a Transformer model. The Transformer, utilizing its attention mechanism, was hypothesized to better capture long-range musical relationships.
Dataset and Preprocessing
The study utilized the Wikifonia dataset, comprising 6,675 lead sheets in MusicXML format. To ensure consistency, all songs were transposed to C Major or A Minor. The data was filtered to include only common time signatures and chord types, resulting in a final dataset of 4,776 lead sheets.
Key Results and Insights
The researchers evaluated the models using both quantitative pattern metrics and subjective listening tests involving 42 music industry professionals.
- Structural Superiority of Transformers: The Transformer model significantly outperformed the LSTM in pattern metrics, demonstrating a superior ability to create repetitive, structured themes characteristic of human-composed music.
- Human-Level Quality: In listening tests, the Transformer’s ratings for melody and harmony were remarkably close to—and in some instances exceeded—the ratings given to human-composed pieces.
- Effective Emotional Steering: The "steering" mechanism proved successful; listeners correctly identified the intended emotion in 11 out of 15 generated tracks. Interestingly, the AI was often more consistent in its emotional signaling than the human composers in the test set.
Limitations and Future Directions
A primary limitation of the current study is the exclusion of arousal (energy/intensity), largely due to a lack of tempo markings in the dataset. Additionally, while the chord-to-emotion mapping is grounded in theory, musical perception remains culturally subjective. Future work will explore adding arousal as a control parameter and implementing noise-robust loss functions to better handle the inherent ambiguity of musical expression.
Summary updated