Audio Prompt Adapter: Unleashing Music Editing Abilities for Text-to-Music with Lightweight Finetuning

Fang-Duo Tsai, Shih-Lun Wu, Haven Kim, Bo-Yu Chen, Hao-Chung Cheng, Yi-Hsuan Yang

Abstract

Text-to-music models allow users to generate nearly realistic musical audio with textual commands. However, editing music audios remains challenging due to the conflicting desiderata of performing fine-grained alterations on the audio while maintaining a simple user interface. To address this challenge, we propose Audio Prompt Adapter (or AP-Adapter), a lightweight addition to pretrained text-to-music models. We utilize AudioMAE to extract features from the input audio, and construct attention-based adapters to feed these features into the internal layers of AudioLDM2, a diffusion-based text-to-music model. With 22M trainable parameters, AP-Adapter empowers users to harness both global (e.g., genre and timbre) and local (e.g., melody) aspects of music, using the original audio and a short text as inputs. Through objective and subjective studies, we evaluate AP-Adapter on three tasks: timbre transfer, genre transfer, and accompaniment generation. Additionally, we demonstrate its effectiveness on out-of-domain audios containing unseen instruments during training.

Introduction

While text-to-music generation has seen significant progress, precise editing of existing audio remains a difficult task. The primary challenge lies in balancing fidelity—preserving the original musical structure like melody and rhythm—with transferability—ensuring the output accurately reflects the changes requested in a text prompt. Existing methods often struggle with this trade-off; simple diffusion-based editing like SDEdit can lose structural integrity, while more complex models are often computationally prohibitive.

The AP-Adapter Framework

The proposed AP-Adapter is a lightweight "plug-in" designed for diffusion-based music models, specifically AudioLDM2. It adds only 22 million trainable parameters, representing approximately 1.5% of the backbone's total size.

Overview of the AP-Adapter architecture, illustrating the decoupled cross-attention mechanism for text and audio features.

The architecture relies on several key components:

  1. Audio Feature Extraction: AudioMAE is used to extract rich acoustic features from the input audio.
  2. Decoupled Cross-Attention: Instead of concatenating text and audio features, the model employs separate cross-attention layers. This prevents the high-dimensional audio signal from overwhelming the text instructions, allowing for more precise control.
  3. Tunable Parameters: The model introduces "knobs" such as the pooling rate ($\omega$) to control feature resolution and the AP scale ($\alpha$) to weight the audio prompt's influence.

Experimental Results

The AP-Adapter was evaluated across three primary tasks: timbre transfer, genre transfer, and accompaniment generation. Training was conducted on a 500-hour subset of AudioSet using a single NVIDIA RTX 3090 GPU, demonstrating high efficiency.

Quantitative Performance

Objective metrics show that AP-Adapter achieves a superior balance between fidelity and transferability compared to established baselines.

Quantitative results comparing AP-Adapter with MusicGen and AudioLDM2 across transferability (CLAP), fidelity (Chroma), and overall quality (FAD).

As shown in the table above, AP-Adapter achieves the highest Chroma Similarity (0.777), indicating excellent preservation of the original audio's harmonic content. It also maintains a competitive CLAP score (0.314), ensuring strong alignment with text prompts.

Qualitative and Zero-Shot Generalization

In subjective listening tests, AP-Adapter outperformed baselines in 16 out of 18 comparisons. Notably, the model demonstrates impressive zero-shot capabilities, successfully editing audio featuring ethnic instruments (e.g., Chinese and Korean instruments) that were not present in the training data. This suggests that the underlying AudioMAE features effectively capture universal musical primitives.

Conclusion

AP-Adapter provides a practical and efficient solution for high-fidelity music editing. By decoupling modality-specific attention and utilizing lightweight adapters, it enables sophisticated audio manipulation through simple text commands. Future work will explore localized editing capabilities and the application of this framework to other generative architectures.

Summary updated

BibTeX
@inproceedings{tsai2024audio,
  author = {Fang-Duo Tsai and Shih-Lun Wu and Haven Kim and Bo-Yu Chen and Hao-Chung Cheng and Yi-Hsuan Yang},
  title = {{Audio Prompt Adapter: Unleashing Music Editing Abilities for Text-to-Music with Lightweight Finetuning}},
  booktitle = {ISMIR},
  year = {2024},
  url = {https://openreview.net/forum?id=TChqoG9BUU},
}
Figure