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.
The architecture relies on several key components:
- Audio Feature Extraction: AudioMAE is used to extract rich acoustic features from the input audio.
- 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.
- 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.
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