[Paper Review] Transformer-XL Based Music Generation with Multiple Sequences of Time-valued Notes
This paper proposes a Transformer-XL-based music generation framework that uses four time-valued note sequences—on-to-on duration, on-to-off duration, pitch, and velocity—instead of absolute timing to model music more naturally. By jointly training four separate Transformer-XL networks on these sequences, the model generates stable, hour-long music with improved rhythmic consistency, dynamic control, and harmonic structure, outperforming Music Transformer, DeepJ, and single-sequence Transformer-XL in both automatic and manual evaluations.
Current state-of-the-art AI based classical music creation algorithms such as Music Transformer are trained by employing single sequence of notes with time-shifts. The major drawback of absolute time interval expression is the difficulty of similarity computing of notes that share the same note value yet different tempos, in one or among MIDI files. In addition, the usage of single sequence restricts the model to separately and effectively learn music information such as harmony and rhythm. In this paper, we propose a framework with two novel methods to respectively track these two shortages, one is the construction of time-valued note sequences that liberate note values from tempos and the other is the separated usage of four sequences, namely, former note on to current note on, note on to note off, pitch, and velocity, for jointly training of four Transformer-XL networks. Through training on a 23-hour piano MIDI dataset, our framework generates significantly better and hour-level longer music than three state-of-the-art baselines, namely Music Transformer, DeepJ, and single sequence-based Transformer-XL, evaluated automatically and manually.
Motivation & Objective
- To address the limitations of absolute timing in music generation, which hinders tempo-invariant similarity computation and proper modeling of relative note durations.
- To overcome the constraints of single-sequence modeling by decoupling temporal, pitch, and velocity information into four distinct sequences for joint learning.
- To enable stable, long-form music generation (up to 36 hours) with consistent note density, proper rhythmic patterns, and expressive dynamics.
- To improve music quality by modeling music from composers' scores (relative timing) rather than performers' recordings (absolute timing).
Proposed method
- Proposes a 4-tuple time-valued note representation: (on2on, on2off, pitch, velocity), where on2on and on2off encode relative durations independent of tempo.
- Decomposes the music sequence into four separate sequences—on2on, on2off, pitch, and velocity—each processed by an individual Transformer-XL network.
- Uses shared token embeddings across the four sequences and combines their cross-entropy losses during joint training to enable multi-stream representation learning.
- Applies relative positional encoding and segment-level recurrence from Transformer-XL to model long-range dependencies across extended musical sequences.
- Trains the framework on a 23-hour piano MIDI dataset, using standard MIDI processing tools like pretty_midi for feature extraction.
- Employs a priming mechanism with fixed initial sequences to evaluate long-form generation stability and coherence.
Experimental results
Research questions
- RQ1Can modeling music using relative time-valued note sequences (on2on, on2off) instead of absolute timing improve the model's ability to generate musically coherent and tempo-invariant music?
- RQ2Does decoupling temporal, pitch, and velocity information into four separate sequences enhance the model’s capacity to learn and generate complex musical structures like chord progressions and dynamic contours?
- RQ3Can a multi-sequence, multi-Transformer-XL framework generate stable, high-quality music over hour-long durations without significant degradation in note density or rhythmic consistency?
- RQ4How does the proposed framework compare to state-of-the-art models like Music Transformer, DeepJ, and single-sequence Transformer-XL in terms of objective metrics and human evaluation?
Key findings
- The model successfully generated a continuous 36-hour music sample with stable note density, demonstrating unprecedented long-form generation capability.
- Note density remained consistent over long sequences, while Music Transformer and single-sequence Transformer-XL showed significant density drops due to NOTE_ON/OFF matching errors.
- The pitch distribution of generated music was closest to the original dataset, indicating strong learning of pitch class and register patterns.
- The model learned common chord progressions such as tonic-to-dominant (e.g., C major to D major), showing evidence of harmonic structure learning.
- Velocity patterns were smooth and expressive, with gradual changes and emotional contrasts between sections, resembling real musical phrasing.
- Human evaluation confirmed that the model’s output was more stable and musically coherent than baselines, especially in long-form generation, with fewer unnatural or erratic note patterns.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.