Abstract
Generating harmonic chord progressions from monophonic melodies is a complex task requiring an understanding of long-term musical structure. This paper presents a novel approach using Bidirectional Long Short-Term Memory (BLSTM) networks to generate chord sequences from symbolic melodies. By extracting 12-semitone feature vectors and normalizing key and time signatures, the model learns temporal dependencies across entire musical phrases. Our evaluation shows that the BLSTM model achieves a 50.0% prediction accuracy, representing a 23.8% improvement over traditional Hidden Markov Models (HMMs). Subjective listener tests further validate that the generated progressions are perceived as more appropriate and harmonically sound than those produced by baseline models.
Introduction
For novice composers, the transition from a single-note melody to a full harmonic arrangement is often a significant barrier. While automatic accompaniment systems exist, they frequently rely on Hidden Markov Models (HMMs). A major limitation of HMMs is the "Markov assumption," which posits that the next state depends only on the current state. Music, however, is inherently structural; a chord choice in a later measure often depends on melodic motifs established much earlier. This research addresses these limitations by employing BLSTM networks, which can capture long-range dependencies by processing sequences in both forward and backward directions.
Methodology
Data Representation and Feature Extraction
The system processes symbolic music data by first normalizing all inputs. Lead sheets are transposed to C Major (or A Minor) to ensure a uniform key, and time signatures are standardized.
As shown in the data representation above, each bar of music is converted into a 12-semitone vector. Each element in the vector represents the total duration of a specific pitch class within that measure. This approach simplifies the melodic information into a format suitable for neural network processing while maintaining the harmonic essence of the bar.
BLSTM Network Architecture
The core of the proposed method is a multi-layer BLSTM architecture. Unlike standard Recurrent Neural Networks (RNNs), the BLSTM utilizes two hidden layers to process the sequence from both ends of the timeline simultaneously.
This bidirectional processing allows the model to utilize "future" melodic information to inform "past" chord choices, mimicking the way a human composer considers the resolution of a phrase when harmonizing its beginning. The final output layer uses a Softmax function to produce a probability distribution over 24 chord classes (12 roots × Major/Minor), with the final chord selected via an Argmax operation.
Experimental Setup and Datasets
The model was trained on a dataset of 2,252 Western music lead sheets from the Wikifonia database, covering genres such as pop, rock, and jazz. The data was split into 1,802 songs for training and 450 for testing. To maintain consistency, the study focused on major-key songs and simplified the output to one chord per bar. The BLSTM was compared against two baselines: a standard HMM and a hybrid DNN-HMM model.
Results and Discussion
Quantitative Performance
The BLSTM model significantly outperformed the probabilistic baselines:
- BLSTM: 50.0% accuracy
- DNN-HMM: 44.87% accuracy
- HMM: 40.41% accuracy
This 23.8% improvement over the HMM baseline suggests that the "memory" provided by the LSTM cells is crucial for capturing musical context. Furthermore, the BLSTM showed a more balanced distribution in its confusion matrix, avoiding the "safe bet" bias common in HMMs, which tend to over-rely on high-frequency chords like the tonic (I) and dominant (V).
Qualitative Evaluation
A user study involving 25 participants was conducted to assess the "appropriateness" of the generated chords. Listeners consistently preferred the BLSTM-generated progressions over those from the HMM-based models. While human-composed original chords remained the gold standard, the gap between the BLSTM and human performance was notably smaller than that of previous automated methods.
Conclusion and Future Work
This research demonstrates that BLSTM networks are highly effective at generating harmonically relevant chord progressions by leveraging global melodic context. Future work will focus on increasing rhythmic complexity (allowing multiple chords per bar), expanding the harmonic vocabulary to include 7th and suspended chords, and refining feature extraction to preserve the internal order of notes within a measure.
Summary updated