MusiConGen: Rhythm and Chord Control for Transformer-Based Text-to-Music Generation

Yun-Han Lan, Wen-Yi Hsiao, Hao-Chung Cheng, Yi-Hsuan Yang · DOI

Abstract: While large-scale transformer models have demonstrated remarkable capabilities in generating high-quality music from text prompts, they often lack the fine-grained temporal control required for professional music production. We present MusiConGen, an extension of the MusicGen framework designed to follow specific rhythmic and harmonic constraints. By utilizing a dual-stream conditioning approach and a parameter-efficient "jump finetuning" technique, MusiConGen achieves superior alignment with user-provided chord progressions and beat structures. Experimental results show significant improvements in rhythm F-measure (from 30.67% to 79.40%) and chord accuracy compared to baseline models.

1. Introduction

Current text-to-music models like MusicGen are effective at capturing general stylistic "vibes" but suffer from "temporal vagueness." A prompt such as "a happy pop song" cannot specify that a chord transition should occur at a precise timestamp. Previous solutions often relied on reference audio or lacked synchronization between symbolic inputs and generated tokens. MusiConGen addresses these gaps by providing a framework that follows a musical blueprint—BPM, meter, and chord progression—without requiring reference audio.

2. Methodology

MusiConGen is built upon the 1.5B parameter MusicGen-melody model, incorporating three primary innovations to enable precise control.

2.1 Dual-Stream Conditioning

The model processes chords through two distinct signals: a global downsampled chromagram and a frame-wise chord condition injected directly into internal layers to prevent temporal drift. For rhythm, the model utilizes one-hot embeddings for beats and downbeats, smoothed with a 70ms soft kernel to maintain a natural yet strict pulse.

2.2 Jump Finetuning

To manage the computational demands of a 1.5B parameter model, we employ "Jump Finetuning." In this approach, only the first self-attention layer within each four-layer block is updated, while the remaining layers are frozen. This reduces the trainable parameter count to approximately 352 million (25% of the total), enabling training on consumer-grade hardware like RTX-3090 GPUs.

MusiConGen architecture featuring jump finetuning and multi-modal conditioning.

2.3 Adaptive In-Attention

To balance structural adherence with creative generation, conditioning signals are injected into the first 75% of Transformer blocks. The final 25% remain unconditioned, allowing the model to refine audio quality and maintain cohesion in the final output stages.

3. Experiments and Results

The model was trained on 250 hours of diverse backing tracks and evaluated using the MUSDB18 and RWC-pop-100 datasets.

3.1 Quantitative Performance

MusiConGen demonstrates substantial improvements over the baseline MusicGen:

  • Rhythm Accuracy: Rhythm F-measure increased from 30.67% to 79.40%.
  • Chord Accuracy: Triad correctness (matching root and quality) rose from 48.54% to 68.42%.
  • Audio Quality: Fréchet Audio Distance (FAD) improved from 2.30 to 0.96 (lower is better).

3.2 Subjective Evaluation

Listening tests were conducted to assess text relevance, rhythm consistency, and chord relevance using Mean Opinion Scores (MOS).

As shown in the MOS results, MusiConGen significantly outperforms the baseline in rhythm and chord consistency. However, there is a slight trade-off in text relevance, as the model prioritizes structural constraints over nuanced text descriptions.

4. Conclusion

MusiConGen provides a robust solution for controllable music generation. By integrating frame-wise conditioning and efficient finetuning, it allows for the creation of music that strictly follows user-defined harmonic and rhythmic structures. Future work will explore scaling to larger model sizes and incorporating additional controls such as specific instrumentation and video synchronization.

Summary updated

BibTeX
@misc{lan2024musicongen,
  author = {Yun-Han Lan and Wen-Yi Hsiao and Hao-Chung Cheng and Yi-Hsuan Yang},
  title = {{MusiConGen: Rhythm and Chord Control for Transformer-Based Text-to-Music Generation}},
  year = {2024},
  eprint = {2407.15060},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.15060},
}
Figure