betaFeedback

WorksComputer Science

DiffSynth-Music: Audio-Conditioned KV-Cache Adapters for Controllable Music Generation

Abstract

Text and lyrics specify broad musical characteristics and sung content but offer limited control over musical timing, melody, and reference-based style. We introduce DiffSynth-Music (https://modelscope.cn/models/DiffSynth-Studio/DiffSynth-Music), a framework that adds composable audio conditioning to a music synthesis backbone through layer-wise key-value injection. The three template models, Control, Prosody, and Reference, are initialized from the backbone diffusion transformer and trained with conditional flow matching. They support five control types: beats, vocals, accompaniment, prosody, and reference audio. A shared variational autoencoder maps conditioning waveforms into a common latent space, enabling their attention memories to be combined. With the template timestep fixed at the clean-data endpoint and other inputs held constant, each control cache is computed once and reused throughout sampling. Training pairs are derived from music recordings using beat extraction, source separation, vocal resynthesis, and reference-excerpt selection. Single-control evaluations on Mandarin and English songs demonstrate improved adherence across all five control types and better lyric fidelity under vocal conditioning relative to the backbone. Automatic music-quality and instruction-following scores remain broadly comparable to those of the evaluated base models, with metric-specific trade-offs. We release the three template models to support research and creative applications in controllable music generation.

Introduction

Recent advances in music generation have improved the ability of generative models to synthesize music from natural-language descriptions and lyrics. MusicGen [1], Stable-Audio-Open [2], and the ACE-Step family [3, 4] explore different approaches to translating semantic descriptions into musical audio. Full-song generation systems, including MiniMax-Music3 [5], DiffRhythm-2 [6],

HeartMuLa [7], SongBloom [8], and LeVo-2 [9], further address lyric alignment, musical coherence, and generation quality. Together, these developments provide a foundation for generating songs whose broad musical characteristics and sung content are specified through text.

Specifying a song through text, however, differs from controlling its musical realization. A prompt can describe genre, instrumentation, or mood, while lyrics specify the words to be sung; neither directly determines the timing of individual beats, the progression of a vocal melody, or the phrasing of a performance. For tasks that require following an existing musical idea, these details are more directly conveyed through audio. This motivates extending text- and lyrics-conditioned generators with audio-based control, allowing users to guide not only the overall character of a song but also specific aspects of its performance.

Prior work [10, 11] introduces time-varying conditions to complement global text descriptions. Audio references provide such temporal information while also conveying acoustic characteristics that are difficult to specify verbally. Temporally aligned signals can constrain the progression of a composition, whereas a short excerpt can guide style, vocal delivery, and timbre without prescribing an output timeline. Integrating these complementary forms of guidance within a pretrained generator is the central objective of this work.

We propose DiffSynth-Music, an audio-conditioned adapter initialized from a pretrained music-generation DiT. The adapter transforms control-audio latents into attention keys and values that are injected into the generation branch. This design introduces reference-dependent attention memory while preserving the backbone’s text-conditioning and waveform-decoding pathways.

The framework supports five complementary control types. Beats encode rhythmic events; vocals provide melodic and performance information; accompaniment specifies instrumental context; prosody represents vocal pitch and timing with reduced pronunciation cues; and Reference supplies global stylistic context from a short excerpt. Their shared representation also permits joint conditioning. In particular, accompaniment and prosody can constrain instrumental structure and vocal melody without requiring preservation of the original vocal timbre. Such flexibility is a design objective whose realization must be assessed separately from basic target adherence.

The contributions of this work are as follows:

  • Architecture. We propose DiffSynth-Music, a DiT-based audio-conditioning architecture that injects layer-wise key-value representations into a pretrained generation backbone. A shared waveform-to-latent interface unifies five control types and enables their composition through joint attention memory.

  • Open-source models. Using conditional flow matching, we train and open-source three audio-conditioned template models: Control, Prosody, and Reference. Control supports beat, vocal, and accompaniment control, while Prosody and Reference provide vocal pitch and timing guidance and reference-based stylistic conditioning, respectively. All three models can be combined at inference.

  • Experimental validation. Experiments on Mandarin and English song generation demonstrate that DiffSynth-Music improves adherence across all five audio-control types while maintaining automatic music-quality and instruction-following scores broadly comparable to those of the evaluated base models.

Diffusion and Flow Matching

Diffusion and flow-based models provide a foundation for continuous generative modeling. Denoising diffusion probabilistic models [12] learn to reverse a gradual noising process, while latent diffusion [13] moves generation into a pretrained autoencoder’s representation space. Diffusion transformers (DiTs) [14] replace convolutional denoisers with transformers operating on latent tokens. These developments motivate the use of latent representations and transformer backbones for music synthesis.

Flow matching [15] learns continuous-time vector fields by regressing velocities along prescribed probability paths, without simulating the generative dynamics during training. Its formulation accommodates both diffusion-derived and alternative transport paths. Rectified flow [16] learns transport along straight-line interpolations between source and target samples. DiffSynth-Music uses a linear noise-to-data path and augments the resulting conditional velocity model with audio-derived attention memory, rather than introducing a new generative objective.

Music Generation Architectures

Music-generation systems differ in how they represent audio and coordinate long-range structure with local acoustic detail. MusicGen [1] autoregressively models discrete audio tokens under text and melody conditioning. YuE [17] extends token-based modeling to long-form lyrics-to-song generation, while HeartMuLa [7] combines an audio-token language model with conditioning on musical descriptions and lyrics. These approaches use sequence modeling to organize musical content over time. Stable-Audio-Open [2] and ACE-Step [3] use latent diffusion architectures; ACE-Step-1.5 [4] combines language-model planning with a DiT. DiffRhythm [6] uses semi-autoregressive block flow matching to address lyric-vocal alignment. MiniMax-Music3 [5] combines hierarchical language modeling with flow-matching synthesis from fused language-model hidden states. SongBloom [8] interleaves autoregressive musical sketching and diffusion refinement. LeVo-2 [9] first models mixed musical tokens for semantic planning, then predicts vocal and accompaniment tokens in parallel before diffusion-based waveform reconstruction.

These systems explore complementary choices of representation, generation order, and acoustic synthesis. DiffSynth-Music instead focuses on extending an existing generator: it uses ACE-Step-1.5-XL-SFT [4] as its backbone and adds composable audio-conditioned templates while keeping the generation backbone frozen.

Controllable Music Generation

Controllable generation complements global descriptions with conditions that specify musical content more directly. MusicGen [1] supports melody conditioning, and Music-ConditionNet [10] introduces time-varying melody, dynamics, and rhythm controls into spectrogram diffusion. JASCO [11] uses flow matching to combine text with symbolic and audio conditions, including chords, melodies, and drum references. Its information bottleneck and temporal blurring selectively preserve information relevant to each condition. Reference-based song generation is also supported by YuE [17], HeartMuLa [7], and SongBloom [8], illustrating that audio prompting is not restricted to diffusion architectures.

DiffSynth-Music builds on these directions by representing five audio-control types through a shared waveform-to-latent interface and combining their layer-wise attention memories. To reduce pronunciation cues, DiffSynth-Music constructs its prosody condition through pitch- and envelope-based vocal resynthesis rather than through the bottleneck and temporal-blurring strategy used by JASCO. The focus is on composing temporally aligned musical constraints and global reference guidance within a frozen pretrained DiT, not on introducing audio conditioning itself.

Adapting Pretrained Generators

Pretrained generators can be adapted through additional conditioning branches, attention context, or constrained parameter updates. ControlNet [18] connects a trainable branch to a frozen diffusion backbone through zero-initialized convolutions. T2I-Adapter [19] learns lightweight modules that translate control inputs into features for a frozen text-to-image model. LoRA [20] instead represents trainable weight updates with low-rank factors. These methods provide distinct mechanisms for adapting generation without retraining all backbone parameters.

Attention-based adaptation is particularly relevant to our design. Prefix-tuning [21] supplies learned task-specific attention context, whereas IP-Adapter [22] derives conditioning from input images and uses separate text and image cross-attention pathways. DiffSynth-Music likewise derives context from each conditioning input, but uses DiT-initialized audio templates to produce layer-wise keys and values. These are concatenated with the generation branch’s keys and values within joint attention, rather than processed through IP-Adapter’s decoupled cross-attention. This distinction separates our conditioning interface from both fixed learned prefixes and residual feature injection.

Music Analysis

Music analysis provides tools for constructing audio-derived control signals. Essentia [23] includes multi-feature and reliability-informed beat trackers [24, 25]. Hybrid-Transformer-Demucs [26] combines waveform- and spectrogram-domain representations for source separation, while pYIN [27] estimates fundamental-frequency trajectories. In our framework, these tools support beat, source, and prosody extraction. Their outputs are estimated annotations and signals, so extraction errors can affect the resulting conditioning data.

Beyond task-specific signal analysis, multimodal large language models such as Qwen3-Omni [28] support audio understanding and can generate textual annotations from audio inputs. These capabilities complement beat tracking, source separation, and pitch estimation by providing semantic descriptions and transcriptions of vocal content. In our data-annotation pipeline, Qwen3-Omni supplies descriptive prompts and lyric annotations for the evaluation recordings, linking the musical audio to the textual conditions used for generation.

Methodology

Problem Formulation

Let x\mathbf{x} denote a target music waveform and y\mathbf{y} its textual condition, including the prompt and lyrics. The set of control identifiers is M={beats,vocals,accompaniment,prosody,reference}\mathcal{M} = \{\mathrm{beats}, \mathrm{vocals}, \mathrm{accompaniment}, \mathrm{prosody}, \mathrm{reference}\}. A nonempty subset S⊆M\mathcal{S} \subseteq\mathcal{M} identifies the active conditions, and cS={cm}m∈S\mathbf{c}_{\mathcal{S}} = \{\mathbf{c}_m\}_{m \in\mathcal{S}} denotes their waveforms. Single-condition generation corresponds to ∣S∣=1|\mathcal{S}| = 1. The objective is to synthesize a waveform that is consistent with the text and with the musical attributes specified by the active conditions.

The backbone consists of a text encoder TψT_{\psi}, a VAE encoder-decoder pair (Eω,Dω)(E_{\omega}, D_{\omega}), and a generation DiT FθF_{\theta}, where θ\theta denotes the pretrained parameters of the base DiT and remains frozen during template training. This decomposition follows latent-space generative modeling [13, 14, 29] and its audio applications [2, 4]. The text encoder produces the text representation hy\mathbf{h}_y, while the shared VAE encoder maps the target and control waveforms to the clean target latent z1\mathbf{z}_1 and control latents zc,m\mathbf{z}_{c,m}, respectively. The encoder EωE_{\omega} includes the audio preprocessing required by the backbone. Sharing the VAE places target and control waveforms in a common latent space. Throughout the paper, t∈[0,1]t \in[0,1] denotes dimensionless flow time, with t=0t = 0 denoting the noise endpoint and t=1t = 1 denoting the data endpoint. The generated terminal latent is decoded as x^=Dω(z^1)\hat{\mathbf{x}} = D_{\omega}(\hat{\mathbf{z}}_1).

Figure 1 summarizes the architecture. Each active control waveform is encoded by the shared VAE and processed by the adapter; the resulting key-value representations condition the generation branch. The following formulation combines concatenation-based attention fusion with adapter-only optimization.

DiffSynth-Music architecture conditioning a generation DiT through audio-derived KV representations

Figure 1. DiffSynth-Music conditions a pretrained generation DiT through audio-derived KV representations. The shared VAE and adapter process each active control, and their keys and values are combined at matched attention blocks. The connection from the DiT to the decoder summarizes the integration of the learned vector field from noise at t=0t = 0 to the generated latent at t=1t = 1.

DiT-Based Template Modules

The architecture of DiffSynth-Music is built on Diffusion-Templates [30], a unified plugin framework that separates base-model inference from the injection of controllable capabilities. Within this framework, we organize the five audio control modes into three separately parameterized template modules: Control (C), Prosody (P), and Reference (R). Control handles beat, vocal, and accompaniment inputs; Prosody processes resynthesized vocals that preserve pitch and timing; and Reference processes short music excerpts for stylistic guidance. Thus, the five modes describe the conditioning signals, whereas C, P, and R identify the three modules that process them. Multiple modes can be activated together through the shared KV-injection interface; the construction of these signals is detailed in Section 3.4.

This three-module organization is an empirical design choice rather than a theoretically prescribed partition of the five modes. We do not assume that this is the optimal partition among all possible module organizations.

Each template module AϕjA_{\phi_j} follows the backbone DiT architecture, where j∈{C,P,R}j \in\{C, P, R\} indexes the three modules and ϕ=(ϕC,ϕP,ϕR)\phi= (\phi_C, \phi_P, \phi_R) collects their parameters. The parameters of each module are initialized from pretrained DiT weights. The template modules and generation branch maintain separate parameters with compatible hidden-state and attention-head dimensions; the generation branch retains the frozen pretrained parameters θ\theta. For control type mm, let g(m)∈{C,P,R}g(m) \in\{C, P, R\} identify the corresponding template module. The selected module processes zc,mz_{c,m}, while the generation branch processes the current flow state ztz_t.

For an attention block ℓ\ell and one attention head, let HℓA,m∈RLℓ,m×dℓ\mathbf{H}_{\ell}^{A,m} \in\mathbb{R}^{L_{\ell,m} \times d_{\ell}} denote the adapter states associated with control mm, where Lℓ,mL_{\ell,m} is the token count and dℓd_{\ell} is the hidden width. Head indices and dependence on auxiliary inputs are suppressed for readability. Keys and values are obtained through the module-specific attention projections [31].

KℓA,m=HℓA,mWℓ,g(m)A,K,VℓA,m=HℓA,mWℓ,g(m)A,V.(1)\begin{aligned} \mathbf{K}_{\ell}^{A,m} &= \mathbf{H}_{\ell}^{A,m}\mathbf{W}_{\ell,g(m)}^{A,K},\\ \mathbf{V}_{\ell}^{A,m} &= \mathbf{H}_{\ell}^{A,m}\mathbf{W}_{\ell,g(m)}^{A,V}. \tag*{(1)} \end{aligned}

Both projection matrices have shape dℓ×dhd_{\ell} \times d_h, where dhd_h is the per-head width, so each projected key or value matrix has shape Lℓ,m×dhL_{\ell,m} \times d_h. Controls assigned to the same template share its projection parameters; different templates have separate parameters. Equation (1) describes the linear projections before any backbone-specific key normalization or positional transformation. The cache and attention equations use the resulting attention-ready keys and values, retaining the same symbols for brevity. The cache for control mm is

Ct(m)=Aϕg(m)(zc,m;ηt)={(KℓA,m,VℓA,m)}ℓ∈J,(2)\begin{aligned} \mathcal{C}_{t}^{(m)} &= A_{\phi_{g(m)}}(z_{c,m}; \eta_t)\\ &= \{(\mathbf{K}_{\ell}^{A,m}, \mathbf{V}_{\ell}^{A,m})\}_{\ell\in\mathcal{J}}, \tag*{(2)} \end{aligned}

where J\mathcal{J} is the set of injection blocks and ηt\eta_t contains the auxiliary template inputs, including the time embedding and any text context. Because the control inputs are noise-free, the template timestep is fixed at the clean-data endpoint, 11, and its time embedding is evaluated at this fixed value rather than at the current generation timestep tt. The remaining template inputs are also held fixed during generation. Consequently, ηt=η1\eta_t = \eta_1 and Ct(m)=C1(m)\mathcal{C}_{t}^{(m)} = \mathcal{C}_{1}^{(m)} throughout inference: the template outputs do not change across sampling steps. Each active control therefore requires only one template forward pass before iterative generation, after which its layer-wise KV cache is reused at every step. This avoids repeated template computation and substantially reduces the computational overhead of audio conditioning.

KV Injection

The conditioned DiT predicts a latent velocity field:

v^t=Fθ(zt,t,hy;Ct).(3)\hat{\mathbf{v}}_t = F_{\theta}(z_t, t, h_y; \mathcal{C}_t). \tag*{(3)}

This velocity parameterization is optimized using the flow-matching objective in Section 3.5.

At each selected block, the control keys and values are concatenated with those of the generation branch. The fusion operation uses scaled dot-product attention [31]. Additional reference context is conceptually related to attention-prefix conditioning [21], although it is computed from the input audio rather than a fixed prefix. For one head, the augmented keys are

K~ℓ=[KℓG;KℓA],(4)\widetilde{\mathbf{K}}_{\ell} = [\mathbf{K}_{\ell}^{G}; \mathbf{K}_{\ell}^{A}], \tag*{(4)}

and the augmented values are

V~ℓ=[VℓG;VℓA],(5)\widetilde{\mathbf{V}}_{\ell} = [\mathbf{V}_{\ell}^{G}; \mathbf{V}_{\ell}^{A}], \tag*{(5)}

where the superscript GG denotes the generation branch and AA denotes the combined control memory. The resulting attention output is

OℓG=softmax⁡(QℓGK~ℓTdh)V~ℓ.(6)\mathbf{O}^{G}_{\ell}=\operatorname{softmax}\left(\frac{\mathbf{Q}^{G}_{\ell}\widetilde{\mathbf{K}}_{\ell}^{\mathsf{T}}}{\sqrt{d_h}}\right)\widetilde{\mathbf{V}}_{\ell}. \tag*{(6)}

Keys and values are concatenated along the token dimension, and softmax is applied over all generation and control keys. Only generation queries produce outputs; multi-head aggregation follows the backbone.

Positional encoding must reflect the semantics of each condition. Beats, vocals, accompaniment, and prosody retain temporal correspondence with the generated sequence, whereas Reference preserves the internal ordering of an excerpt without assigning its events to absolute output positions. Control and generation sequences may therefore differ in length.

Audio Conditioning

We construct control-target pairs from a private dataset of approximately 60k music recordings. Beats, vocals, accompaniment, and prosody are temporally aligned with the target, whereas Reference provides global context from the same recording. With text annotations yiy_i and active control subsets SiS_i, the training dataset is

D={(xi,yi,Si,ci,Si)}i=1N,(7)\mathcal{D}=\left\{(\mathbf{x}_i,y_i,S_i,\mathbf{c}_{i,S_i})\right\}_{i=1}^{N}, \tag*{(7)}

where NN is the number of constructed examples and ci,Si={ci,m}m∈Si\mathbf{c}_{i,S_i}=\{\mathbf{c}_{i,m}\}_{m\in S_i} contains their control waveforms.

Beats. We estimate beat timestamps using Essentia’s implementation of the Degara tracker [23, 25] and render them as exponentially decaying sinusoidal pulses:

b(s)=∑k=1Nbhbeat(s−τk),cbeats(s)=b(s)∥b∥∞,(8)b(s)=\sum_{k=1}^{N_b}h_{\mathrm{beat}}(s-\tau_k),\qquad c_{\mathrm{beats}}(s)=\frac{b(s)}{\lVert b\rVert_{\infty}}, \tag*{(8)}

where NbN_b is the beat count, τk\tau_k is the kkth timestamp, and hbeath_{\mathrm{beat}} is a 10 ms pulse with a 1 kHz carrier, zero outside its support. The waveform spans 0≤s<Tx0\le s<T_x, with TxT_x the source duration, and ∥b∥∞\lVert b\rVert_{\infty} is its peak absolute amplitude. Unlike a drum stem, this synthetic track conveys beat timing without source timbre or rhythmic subdivisions.

Vocals and accompaniment. Demucs [26] separates each recording into vocal and accompaniment estimates, which serve as the corresponding control inputs. Vocals guide melody and performance and may retain lyrics and singer identity; accompaniment supplies instrumental harmony, rhythm, and arrangement.

Prosody. We resynthesize the channel-averaged vocal signal v[n]v[n] using a sinusoidal carrier to retain pitch and timing while reducing phonetic and timbral detail. Rectification followed by fourth-order 30 Hz and second-order 80 Hz Butterworth low-pass filtering yields the normalized envelope:

e~[n]=F80(2)(F30(4)(∣v∣))[n],\widetilde{e}[n]=\mathcal{F}^{(2)}_{80}\left(\mathcal{F}^{(4)}_{30}(|v|)\right)[n],
e[n]=e~[n]max⁡ke~[k]+ϵ.(9)e[n]=\frac{\widetilde{e}[n]}{\max_k\widetilde{e}[k]+\epsilon}. \tag*{(9)}

Here, Ffc(p)\mathcal{F}^{(p)}_{f_c} applies a filter of one-pass order pp and cutoff fcf_c in both directions, giving zero phase and doubling its effective order; ϵ>0\epsilon>0 stabilizes normalization. Filtering may produce negative samples, and no additional clipping is specified.

We estimate fundamental frequency with pYIN [27] over 65–1000 Hz using a hop of H=512H=512 samples. Missing estimates are forward-filled, leading gaps are filled with the first valid estimate, and the trajectory is linearly interpolated to the sample grid with constant boundary extension. At least one valid estimate is required. For an interpolated frequency f[n]f[n] in hertz and a processing sample rate fsf_s, the carrier is

φ[n]=2πfs∑k=0nf[k],r[n]=e[n]sin⁡(φ[n]),(10)\varphi[n]=\frac{2\pi}{f_s}\sum_{k=0}^{n}f[k],\qquad r[n]=e[n]\sin(\varphi[n]), \tag*{(10)}

with initial phase φ[−1]=0\varphi[-1]=0. No voicing mask is applied; the envelope controls amplitude during intervals with imputed pitch. Peak scaling approximately matches the peak amplitude of the vocal reference:

cprosody[n]=r[n]max⁡k∣v[k]∣max⁡k∣r[k]∣+ϵ.(11)c_{\mathrm{prosody}}[n]=r[n]\frac{\max_k|v[k]|}{\max_k|r[k]|+\epsilon}. \tag*{(11)}

The monaural result is replicated across output channels. This transformation reduces, but does not guarantee removal of, linguistic content or vocal identity.

Reference. We select the loudest contiguous Δ=10\Delta=10 s excerpt of the mixed recording to guide style, timbre, and production without prescribing an output timeline. For Tx≥ΔT_x\ge\Delta, let Tx\mathcal{T}_x be the nonempty set of candidate start times on the sample grid within [0,Tx−Δ][0,T_x-\Delta]:

τ⋆∈arg⁡max⁡τ∈Tx Loudness⁡(x[τ:τ+Δ]),(12)\tau^\star\in\underset{\tau\in\mathcal{T}_x}{\arg\max}\ \operatorname{Loudness}\bigl(\mathbf{x}[\tau:\tau+\Delta]\bigr), \tag*{(12)}
creference=x[τ⋆:τ⋆+Δ].(13)\mathbf{c}_{\mathrm{reference}}=\mathbf{x}[\tau^\star:\tau^\star+\Delta]. \tag*{(13)}

The slice x[τ:τ+Δ]\mathbf{x}[\tau:\tau+\Delta] denotes samples in [τ,τ+Δ)[\tau,\tau+\Delta). Candidate windows are scored without independent gain normalization; the loudness measure and candidate spacing are preprocessing settings.

Joint conditioning and alignment. Each active control is encoded separately. At block ℓ\ell, its keys and values are concatenated in a fixed order as KℓA=[KℓA,m]m∈S\mathbf{K}^{A}_{\ell}=[\mathbf{K}^{A,m}_{\ell}]_{m\in\mathcal{S}} and VℓA=[VℓA,m]m∈S\mathbf{V}^{A}_{\ell}=[\mathbf{V}^{A,m}_{\ell}]_{m\in\mathcal{S}}, forming Cℓ={(KℓA,m,VℓA,m)}m∈S\mathcal{C}_{\ell}=\{(\mathbf{K}^{A,m}_{\ell},\mathbf{V}^{A,m}_{\ell})\}_{m\in\mathcal{S}} for Equations (4) and (5). Composition thus combines attention memories, not waveforms. For example, jointly enabling Accompaniment and Prosody allows the model to generate a cover of a song with a user-specified vocal timbre while following its instrumental structure and vocal melody. Combining different controls supports a broader range of music-generation applications.

Training Formulation and Inference

We formulate adapter optimization as conditional flow matching [15]: a neural vector field is trained to predict the velocity along a prescribed conditional probability path. Given a clean audio latent z1=Eω(x)\mathbf{z}_1 = E_{\omega}(\mathbf{x}), we independently sample Gaussian noise z0∼N(0,I)\mathbf{z}_0 \sim\mathcal{N}(\mathbf{0}, \mathbf{I}) and a training time t∼p(t)t \sim p(t), where pp is a probability distribution on [0,1][0, 1] induced by the backbone’s training timestep schedule expressed in our noise-to-data time convention. We adopt the linear interpolation used in straight-path flow formulations [16].

zt=(1−t)z0+tz1.(14)\mathbf{z}_t = (1-t)\mathbf{z}_0 + t\mathbf{z}_1. \tag*{(14)}

Differentiating with respect to this flow time while holding the sampled endpoints fixed gives the conditional target velocity

ut∗=dztdt=z1−z0.(15)\mathbf{u}_t^* = \frac{d\mathbf{z}_t}{dt} = \mathbf{z}_1 - \mathbf{z}_0. \tag*{(15)}

The conditional flow-matching objective [15] minimizes squared error between the predicted and target velocities.

LCFM(ϕ)=ED, t, z0[w(t)∥v^t(ϕ)−ut∗∥22].(16)\mathcal{L}_{\mathrm{CFM}}(\phi) = \mathbb{E}_{\mathcal{D},\,t,\,\mathbf{z}_0}\left[w(t)\left\lVert\widehat{\mathbf{v}}_t(\phi)-\mathbf{u}_t^*\right\rVert_2^2\right]. \tag*{(16)}

Here, v^t(ϕ)\widehat{\mathbf{v}}_t(\phi) is the prediction in (3), with dependence on ϕ\phi through the injected cache. The expectation is taken over (x,y,S,cS)∼D(x, y, S, c_S) \sim\mathcal{D}, scheduler-sampled times, and independent Gaussian noise. The nonnegative loss weight w(t)w(t) is specified separately from the sampling distribution pp.

In template-only optimization, the text encoder, VAE, and generation DiT remain frozen, while gradients propagate through the injected key-value tensors to update the selected template parameters. At inference, the separately parameterized Control, Prosody, and Reference modules can be combined through their attention caches.

The terminal state is decoded as x^=Dω(z^1)\widehat{\mathbf{x}} = D_{\omega}(\widehat{\mathbf{z}}_1). At inference, the template timestep is fixed at 1, and the other template inputs are held constant. The control caches are computed once before integration and reused throughout all sampling steps; only the generation DiT is evaluated iteratively. Auxiliary planning and lyric-conditioning modules are retained when present in the backbone.

Experiments

DiffSynth-Music uses ACE-Step-1.5-XL-SFT [4] as its backbone, with the audio-conditioned template modules optimized while the generation backbone remains frozen.

We evaluate DiffSynth-Music on Mandarin and English song generation and compare it with representative music-generation systems. The evaluation focuses on adherence to audio-derived control signals, including beats, vocals, accompaniment, prosody, and reference audio. We also assess acoustic quality, lyric fidelity, and text–music alignment to examine whether adding controllable generation capabilities preserves general music-generation quality.

Experimental Setup

Dataset. We collect 100 test music samples: 50 with English lyrics from MUSDB18-HQ [32] and 50 with Mandarin lyrics from our private dataset. Each sample is annotated with a descriptive prompt and lyrics using Qwen3-Omni [28]. For each recording, we extract beats, vocals, accompaniment, prosody, and a reference excerpt as conditioning inputs, following the signal-construction procedures in Section 3.4. These sample-specific conditions provide the targets for evaluating controllability.

Parameters. For DiffSynth-Music, we use a classifier-free guidance (CFG) scale of 4 and 50 inference steps. The generation duration matches the duration of the corresponding test sample.

Baselines. We compare against ACE-Step-1.5-XL-SFT [4], DiffRhythm-2 [6], HeartMuLa-3B [7], MiniMax-Music3 [5], and Levo-2-Large [9]. DiffSynth-Music is built on ACE-Step-1.5-XL-SFT, which does not provide the audio-control capabilities evaluated here. This backbone baseline allows us to examine the effect of adding audio-conditioned templates, while the other systems provide broader comparisons of general song-generation quality.

Evaluation Metrics

Beat consistency. We use Beat-F1 and Cemgil to evaluate agreement between the input beat sequence and beats extracted from the generated music, following standardized music information retrieval evaluation procedures [34]. Beat-F1 measures beat-position matches within a temporal tolerance, whereas Cemgil uses a Gaussian timing score to quantify deviations from target beats. Higher values indicate better rhythmic alignment.

Vocal control. Under vocal conditioning, V-MSE measures the mean squared error between the input vocals and vocals separated from the generated music, using the same signal representation and temporal sampling. Lower values indicate closer vocal reconstruction. We use phoneme error rate (PER) [7] to evaluate lyric fidelity under vocal conditioning. We separate generated vocals, transcribe them, and compare the resulting phoneme sequence with the input lyrics. PER is the total number of phoneme substitutions, deletions, and insertions divided by the number of reference phonemes. Lower PER indicates better lyric fidelity.

ModelBeatsVocalsAccompanimentProsodyReference
Beat-F1↑\uparrowCemgil↑\uparrowV-MSE↓\downarrowPER↓\downarrowA-MSE↓\downarrowPitch50_{50} ↑\uparrowMuLan-A↑\uparrow
ACE-Step-1.5-XL-SFT0.30310.19830.01580.19280.02210.03660.6836
DiffRhythm-20.30490.19980.01190.32640.02040.03140.6820
HeartMuLa-3B0.30120.19560.01820.26260.03200.03470.5712
MiniMax-Music30.29210.19230.01600.26630.02370.04020.6566
LeVo-2-Large0.28920.19100.01650.27070.02810.03490.5144
DiffSynth-Music0.84960.80880.00060.14510.00230.46710.8088

Table 1. Control adherence. Arrows indicate the preferred direction, and bold denotes the best reported value in each column. The DiffSynth-Music row combines results from separate single-control configurations, each using the control indicated by its column group.

Accompaniment control. Under accompaniment conditioning, A-MSE measures the mean squared error between the input accompaniment and accompaniment separated from the generated music, using the same signal representation and temporal sampling. Lower values indicate closer accompaniment reconstruction.

Prosody consistency. We use Pitch50_{50} to evaluate vocal pitch adherence to the prosody input. Vocal fundamental frequency is estimated with pYIN [27] and compared with the target pitch trajectory on the same timeline. The score is the proportion of target-voiced frames for which the generated vocal is voiced and its pitch lies within 50 cents of the target. Higher values indicate better melodic target following.

Reference-audio consistency. MuLan-A measures cosine similarity between the generated audio and the corresponding reference excerpt in the MuQ-MuLan embedding space [35]. A higher similarity score indicates closer alignment with the reference audio. Unlike point-wise control-signal MSE, this metric evaluates global audio resemblance without requiring temporal correspondence.

General music-generation quality. We use the following metrics to assess whether introducing controllable generation capabilities preserves acoustic quality and text–music alignment, rather than treating control adherence alone as evidence of generation quality.

  • AudioBox-Aesthetics. AudioBox-Aesthetics [36] provides four automatic scores: Content-Enjoyment (CE), Content-Usefulness (CU), Production-Complexity (PC), and Production-Quality (PQ). These characterize the appeal and usefulness of the generated content, production complexity, and technical quality, respectively. They serve as proxies for listening quality rather than human listening judgments.

  • Instruction following. We use MuLan-T, the cosine similarity between the generated audio and its annotated prompt in MuQ-MuLan [35], to evaluate adherence to textual instructions. Higher values indicate stronger text–music alignment.

Experimental Results

Tables 1 and 2 report control adherence and general generation quality, respectively. Each DiffSynth-Music configuration uses one control type. Lower values are better for MSE and PER; higher values are better for all other metrics.

Control adherence. DiffSynth-Music achieves the best reported value on all seven control metrics. Beat conditioning raises Beat-F1 from 0.3031 to 0.8496 and Cemgil from 0.1983 to 0.8088 relative to the frozen backbone, indicating substantially closer rhythmic alignment. Vocal conditioning reduces V-MSE from 0.0158 to 0.0006 and PER from 0.1928 to 0.1451, while accompaniment conditioning reduces A-MSE from 0.0221 to 0.0023. The simultaneous improvement in vocal reconstruction and PER suggests that vocal conditioning supports both target adherence and lyric fidelity on the evaluated songs. Prosody conditioning increases Pitch50 from 0.0366 to 0.4671, also exceeding the strongest baseline score of 0.0402 from MiniMax-Music3. Reference conditioning improves MuLan-A from 0.6836 to 0.8088. These results support the effectiveness of pitch-and-timing guidance and global reference conditioning, respectively.

Music quality and instruction following. Table 2 shows that DiffSynth-Music retains music quality and instruction-following performance broadly comparable to those of the evaluated base models while adding audio control. Its PQ scores range from 8.0555 to 8.2418, close to the backbone’s 8.1016, and its MuLan-T scores of 0.3452–0.3900 fall within the baseline range of 0.2383–0.4565. Beats and Reference also improve CE, CU, and PQ over the backbone. Although some aesthetics scores and all MuLan-T scores are lower than the backbone’s, the overall results suggest that controllability is gained while largely retaining these generation capabilities.

ModelCE↑\uparrowCU↑\uparrowPC↑\uparrowPQ↑\uparrowMuLan-T↑\uparrow
ACE-Step-1.5-XL-SFT7.37487.69756.43358.10160.4024
DiffRhythm-27.26117.55676.03458.01520.4565
HeartMuLa-3B7.66347.85236.27288.27120.3757
MiniMax-Music37.39147.67606.23548.04650.3604
LeVo-2-Large7.74887.99516.79548.45140.2383
DiffSynth-Music (Beats)7.44847.80416.00638.21550.3810
DiffSynth-Music (Vocals)7.10207.42636.11198.06040.3452
DiffSynth-Music (Accompaniment)7.35357.57736.41198.05550.3485
DiffSynth-Music (Prosody)7.27427.64716.13388.07040.3625
DiffSynth-Music (Reference)7.44367.73286.01398.24180.3900

Table 2. Automatic music-quality and instruction-following scores. Higher is better for every metric. CE, CU, PC, and PQ are AudioBox-Aesthetics scores, and MuLan-T evaluates text–music alignment.

Conclusion

We presented DiffSynth-Music, which extends the frozen ACE-Step-1.5-XL-SFT backbone with three audio-conditioned templates: Control, Prosody, and Reference. Trained with conditional flow matching, these templates support five composable control types through layer-wise KV injection, with control memories computed once and reused throughout sampling. Experiments on Mandarin and English songs demonstrate improved control adherence and vocal-conditioned lyric fidelity, while automatic music-quality and instruction-following scores remain broadly comparable to those of the evaluated base models despite some decreases relative to the backbone. We release the template models to support research and creative applications. Future work will evaluate joint conditioning and musical quality through human listening studies.

Acknowledgments

This manuscript was prepared with assistance from GPT for grammar correction and language polishing.

References

  1. [1]Jade Copet, Felix Kreuk, Itai Gat, Tal Remez, David Kant, Gabriel Synnaeve, Yossi Adi, and Alexandre Défossez. Simple and controllable music generation. Advances in neural information processing systems, 36:47704–47720, 2023.arxiv.org/abs/2306.05284
  2. [2]Zach Evans, Julian D Parker, CJ Carr, Zack Zukowski, Josiah Taylor, and Jordi Pons. Stable audio open. In ICASSP 2025-2025 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 1–5. IEEE, 2025.arxiv.org/abs/2407.14358
  3. [3]Junmin Gong, Sean Zhao, Sen Wang, Shengyuan Xu, and Joe Guo. Ace-step: A step towards music generation foundation model. arXiv preprint arXiv:2506.00045, 2025.arxiv.org/abs/2506.00045
  4. [4]Junmin Gong, Yulin Song, Wenxiao Zhao, Sen Wang, Shengyuan Xu, Jing Guo, and Xuerui Yang. Ace-step 1.5: Pushing the boundaries of open-source music generation. arXiv preprint arXiv:2602.00744, 2026.arxiv.org/abs/2602.00744
  5. [5]MiniMax. MiniMax-Music3: Official repository, 2026. URL https://github.com/MiniMax-AI/MiniMax-Music3. Software and model documentation; accessed September 6, 2026.
  6. [6]Yuepeng Jiang, Huakang Chen, Ziqian Ning, Jixun Yao, Zerui Han, Di Wu, Meng Meng, Jian Luan, Zhonghua Fu, and Lei Xie. Diffrythm 2: Efficient and high fidelity song generation via block flow matching. arXiv preprint arXiv:2510.22950, 2025.arxiv.org/abs/2510.22950
  7. [7]Dongchao Yang, Yuxin Xie, Yuguo Yin, Zheyu Wang, Xiaoyu Yi, Gongxi Zhu, Xiaolong Weng, Zihan Xiong, Yingzhe Ma, Dading Cong, et al. Heartmula: A family of open sourced music foundation models. arXiv preprint arXiv:2601.10547, 2026.arxiv.org/abs/2601.10547
  8. [8]Chenyu Yang, Shuai Wang, Hangting Chen, Wei Tan, Jianwei Yu, and Haizhou Li. SongBloom: Coherent song generation via interleaved autoregressive sketching and diffusion refinement. Advances in Neural Information Processing Systems, 38:34256–34277, 2025.arxiv.org/abs/2506.07634
  9. [9]Shun Lei, Huaicheng Zhang, Dapeng Wu, Yaoxun Xu, Lishi Zuo, Wei Tan, Hangting Chen, Guangzhou Leng, Jianwei Yu, Zhiyong Wu, et al. Levo 2: Stable and melodious song generation via hierarchical representation modeling and progressive post-training. arXiv preprint arXiv:2606.30642, 2026.arxiv.org/abs/2606.30642
  10. [10]Shih-Lun Wu, Chris Donahue, Shinjj Watanabe, and Nicholas J Bryan. Music controlnet: Multiple time-varying controls for music generation. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 32:2692–2703, 2024.arxiv.org/abs/2311.07069
  11. [11]Or Tal, Alon Ziv, Itai Gat, Felix Kreuk, and Yossi Adi. Joint audio and symbolic conditioning for temporally controlled text-to-music generation. arXiv preprint arXiv:2406.10970, 2024.arxiv.org/abs/2406.10970
  12. [12]Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840–6851, 2020.arxiv.org/abs/2006.11239
  13. [13]Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In 2022 IEEE/CVF conference on computer vision and pattern recognition (CVPR), pages 10674–10685. ieee, 2022.arxiv.org/abs/2112.10752
  14. [14]William Peebles and Saining Xie. Scalable diffusion models with transformers. In 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pages 4172–4182. IEEE, 2023.arxiv.org/abs/2212.09748
  15. [15]Yaron Lipman, Ricky TQ Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le. Flow matching for generative modeling. arXiv preprint arXiv:2210.02747, 2022.arxiv.org/abs/2210.02747
  16. [16]Xingchao Liu, Chengyue Gong, and Qiang Liu. Flow straight and fast: Learning to generate and transfer data with rectified flow. arXiv preprint arXiv:2209.03003, 2022.arxiv.org/abs/2209.03003
  17. [17]Ruibin Yuan, Hanfeng Lin, Shuyue Guo, Ge Zhang, Jiahao Pan, Yongyi Zang, Haohe Liu, Yiming Liang, Wenyi Ma, Xingjian Du, et al. Yue: Scaling up foundation models for long-form music generation. In International Conference on Learning Representations, 2026. URL https://openreview.net/forum?id=hZy6YG2Ij8.arxiv.org/abs/2503.08638
  18. [18]Lvmin Zhang, Anyi Rao, and Maneesh Agrawala. Adding conditional control to text-to-image diffusion models. In 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pages 3813–3824. IEEE, 2023.arxiv.org/abs/2302.05543
  19. [19]Chong Mou, Xintao Wang, Liangbin Xie, Yanze Wu, Jian Zhang, Zhongang Qi, and Ying Shan. T2i-adapter: Learning adapters to dig out more controllable ability for text-to-image diffusion models. In Proceedings of the AAAI conference on artificial intelligence, volume 38, pages 4296–4304, 2024.arxiv.org/abs/2302.08453
  20. [20]Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685, 2021.arxiv.org/abs/2106.09685
  21. [21]Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of the 59th annual meeting of the association for computational linguistics and the 11th international joint conference on natural language processing (volume 1: Long papers), pages 4582–4597, 2021.arxiv.org/abs/2101.00190
  22. [22]Hu Ye, Jun Zhang, Sibo Liu, Xiao Han, and Wei Yang. Ip-adapter: Text compatible image prompt adapter for text-to-image diffusion models. arXiv preprint arXiv:2308.06721, 2023.arxiv.org/abs/2308.06721
  23. [23]Dmitry Bogdanov, Nicolas Wack, Emilia Gómez Gutiérrez, Sankalp Gulati, Perfecto Herrera Boyer, Oscar Mayor, Gerard Roma Trepat, Justin Salamon, José Ricardo Zapata González, and Xavier Serra. Essentia: An audio analysis library for music information retrieval. In Britto A, Gouyon F, Dixon S, editors. 14th Conference of the International Society for Music Information Retrieval (ISMIR); 2013 Nov 4-8; Curitiba, Brazil.[place unknown]: ISMIR; 2013. p. 493-8. International Society for Music Information Retrieval (ISMIR), 2013.
  24. [24]José R Zapata, Matthew EP Davies, and Emilia Gómez. Multi-feature beat tracking. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 22(4):816–825, 2014.DOI
  25. [25]Norberto Degara, Enrique Argones Rúa, Antonio Pena, Soledad Torres-Guijarro, Matthew EP Davies, and Mark D Plumbley. Reliability-informed beat tracking of musical signals. IEEE Transactions on Audio, Speech, and Language Processing, 20(1):290–301, 2012.DOI
  26. [26]Simon Rouard, Francisco Massa, and Alexandre Défossez. Hybrid transformers for music source separation. In ICASSP 2023-2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 1–5. IEEE, 2023.arxiv.org/abs/2211.08553
  27. [27]Matthias Mauch and Simon Dixon. pyin: A fundamental frequency estimator using probabilistic threshold distributions. In 2014 ieee international conference on acoustics, speech and signal processing (icassp), pages 659–663. IEEE, 2014.DOI
  28. [28]Jin Xu, Zhifang Guo, Hangrui Hu, Yunfei Chu, Xiong Wang, Jinzheng He, Yuxuan Wang, Xian Shi, Ting He, Xinfa Zhu, et al. Qwen3-omni technical report. arXiv preprint arXiv:2509.17765, 2025.arxiv.org/abs/2509.17765
  29. [29]Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.arxiv.org/abs/1312.6114
  30. [30]Zhongjie Duan, Hong Zhang, and Yingda Chen. Diffusion templates: A unified plugin framework for controllable diffusion. arXiv preprint arXiv:2604.24351, 2026.arxiv.org/abs/2604.24351
  31. [31]Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.arxiv.org/abs/1706.03762
  32. [32]Zafar Rafi, Antoine Liutkus, Fabian-Robert Stöter, Stylianos Ioannis Mimilakis, and Rachel Bittner. MUSDB18-HQ – an uncompressed version of MUSDB18. Zenodo, 2019.
  33. [34]Colin Raffel, Brian McFee, Eric J Humphrey, Justin Salamon, Oriol Nieto, Dawen Liang, and Daniel P. W. Ellis. mir_eval: A transparent implementation of common MIR metrics. In Proceedings of the 15th International Society for Music Information Retrieval Conference, pages 367–372, 2014.DOI
  34. [35]Haina Zhu, Yizhi Zhou, Hangting Chen, Jianwei Yu, Ziyang Ma, Rongzhi Gu, Yi Luo, Wei Tan, and Xie Chen. Muq: Self-supervised music representation learning with mel residual vector quantization. IEEE Transactions on Audio, Speech and Language Processing, 2025.arxiv.org/abs/2501.01108
  35. [36]Andros Tjandra, Yi-Chiao Wu, Baishan Guo, John Hoffman, Brian Ellis, Apoorv Vyas, Bowen Shi, Sanyuan Chen, Matt Le, Nick Zacharov, et al. Meta Audiobox Aesthetics: Unified automatic quality assessment for speech, music, and sound. In 2025 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pages 1–8. IEEE, 2025.arxiv.org/abs/2502.05139

Paper details

vlnc:W_5ysugszv
Version
v1 · latest
Published
Added
License
CC BY 4.0
Usage

views · 9

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents