Music Generation — MusicGen, Stable Audio, Suno, and the Licensing Earthquake
By 2026, the generation problem is basically solved: Suno v5 and Udio v4 own commercial music generation, while MusicGen, Stable Audio Open, and ACE-Step lead the open-source side. What actually reshaped the field in 2025-2026 wasn't a new model. It was Warner Music's $500M settlement with Suno, and UMG's matching settlement with Udio.
Learning Objectives
- Split music generation into its three sub-problems (instrumental, song generation with vocals, and conditional/controllable generation) and name a representative model for each.
- Explain the two core architecture families, autoregressive token-LM over neural-codec tokens and diffusion over mel spectrograms or latents, including where each one wins and where it struggles.
- Generate and evaluate music with MusicGen: plain text-to-music, melody-conditioned generation from a chromagram, and FAD/CLAP/ELO scoring against 2026 benchmarks.
- Apply the 2025-2026 legal landscape (the Warner-Suno and UMG-Udio settlements, EU AI Act, California SB 942) to pick a safe-to-ship licensing strategy and avoid the pitfalls that still ship in 2026.
The Problem
Music generation takes a text prompt and turns it into a finished clip, anywhere from 30 seconds to 4 minutes, complete with lyrics, vocals, and structure. That splits into three sub-problems:
- Instrumental generation. Text like "lo-fi hip-hop drums with warm keys" becomes audio directly. MusicGen, Stable Audio, and AudioLDM live here.
- Song generation (with vocals and lyrics). "Country song about rainy Texas nights" becomes a full song, vocals included. Suno, Udio, YuE, and ACE-Step do this.
- Conditional / controllable generation. Extend an existing clip, regenerate just the bridge, swap genre, separate stems, or inpaint a section. Udio's inpainting plus stem separation is the feature every other 2026 platform is racing to match.
The Concept
Every music-generation model comes down to one of two architecture families, or a closed-weight hybrid of both: autoregressive token language models predicting neural-codec tokens, and diffusion models running over mel spectrograms or latents.
Token LM over neural-codec tokens
Meta's MusicGen (2023, MIT) and its many derivatives condition on text or melody embeddings and autoregressively predict EnCodec tokens (32 kHz, 4 codebooks), then decode with EnCodec. Parameter counts run 300M to 3.3B. It's a strong baseline, but it struggles past 30 seconds.
ACE-Step (open-source, 4B XL, released April 2026) extends the same approach to full-song, lyric-conditioned generation. It's the open community's closest thing to Suno.
Diffusion over mels or latents
Stable Audio (2023) and Stable Audio Open (2024) run latent diffusion on compressed audio. Both excel at loops, sound design, and ambient textures, and neither is great at structured full songs.
AudioLDM / AudioLDM2 does text-to-audio through T2I-style latent diffusion, generalized to music, sound effects, and speech alike.
Hybrid (production): Suno, Udio, Lyria
These are closed weights, likely an autoregressive codec LM paired with a diffusion-based vocoder and specialized voice, drum, and melody heads. Suno v5 (2026) leads on quality at ELO 1293. Udio v4 adds inpainting plus stem separation, so bass, drums, and vocals download as separate files.
Evaluation
- FAD (Fréchet Audio Distance). Embedding-level distance between the generated and real audio distributions, computed with VGGish or PANNs features. Lower is better: MusicGen small scores 4.5 FAD on MusicCaps, against a SOTA of ~3.0.
- Musicality (subjective). Human preference. Suno v5 leads at ELO 1293.
- Text-audio alignment. The CLAP score, a contrastive text-audio embedding (the audio analog of CLIP), between prompt and output.
- Musicality artifacts. Off-beat transitions, vocal-phrase drift, and loss of structure past 30 seconds.
2026 model map
| Model | Params | Length | Vocals | License |
|---|---|---|---|---|
| MusicGen-large | 3.3B | 30 s | no | MIT |
| Stable Audio Open | 1.2B | 47 s | no | Stability non-commercial |
| ACE-Step XL (Apr 2026) | 4B | > 2 min | yes | Apache-2.0 |
| YuE | 7B | > 2 min | yes, multilingual | Apache-2.0 |
| Suno v5 (closed) | ? | 4 min | yes, ELO 1293 | commercial |
| Udio v4 (closed) | ? | 4 min | yes + stems | commercial |
| Google Lyria 3 (closed) | ? | real-time | yes | commercial |
| MiniMax Music 2.5 | ? | 4 min | yes | commercial API |
The legal landscape (2025-2026)
- Warner Music vs. Suno settlement. $500M. The settlement gives WMG oversight of AI likeness, music rights, and user-generated tracks on Suno, and UMG landed a similar settlement with Udio.
- EU AI Act and California SB 942. Both now require disclosure when music is AI-generated.
- Riffusion and MusicGen, both MIT-licensed, carry no compliance baggage, but they also don't do commercial-grade vocals.
Safe-to-ship patterns:
- Generate instrumental only (MusicGen, Stable Audio Open, MIT/CC0 outputs).
- Use commercial APIs (Suno, Udio, ElevenLabs Music) with a per-generation license.
- Train on an owned or licensed catalog, which is where most enterprises end up.
- Tag every generation with watermarks and metadata.
Build It
Step 1: generate with MusicGen
from audiocraft.models import MusicGen
import torchaudio
model = MusicGen.get_pretrained("facebook/musicgen-small")
model.set_generation_params(duration=10)
wav = model.generate(["upbeat synthwave with driving drums, 128 BPM"])
torchaudio.save("out.wav", wav[0].cpu(), 32000)Three sizes ship: small (300M, fast), medium (1.5B), and large (3.3B). small is enough to answer "does the idea land."
Step 2: melody conditioning
MusicGen-melody takes a chromagram (a 12-dimensional, per-frame pitch representation) as input and preserves the tune while it swaps out the timbre, so "give me this melody as a string quartet" is exactly the kind of request it's built for.
melody, sr = torchaudio.load("humming.wav")
wav = model.generate_with_chroma(
["jazz piano cover"],
melody.squeeze(),
sr,
)Step 3: FAD evaluation
from frechet_audio_distance import FrechetAudioDistance
fad = FrechetAudioDistance()
fad.get_fad_score("generated_folder/", "reference_folder/")It computes VGGish-embedding distance, which is useful for genre-level regression tests, but it's no substitute for human listeners.
Step 4: adding to the LLM-music workflow
Combine this with the ideas from Lessons 7-8:
prompt = "Write a 30-second jazz loop. Describe the drums, bass, and piano voicing."
description = llm.complete(prompt)
music = musicgen.generate([description], duration=30)Use It
| Goal | Stack |
|---|---|
| Instrumental sound design | Stable Audio Open |
| Game / adaptive music | Google Lyria RealTime (closed) |
| Full songs with vocals (commercial) | Suno v5 or Udio v4 with explicit license |
| Full songs with vocals (open) | ACE-Step XL or YuE |
| Short ad jingle | MusicGen melody-conditioned on a hummed reference |
| Music-video background | MusicGen + Stable Video Diffusion |
Pitfalls that still ship in 2026
- Copyright-laundering prompts. Commercial platforms filter out prompts like "song in the style of Taylor Swift" now; Suno and Udio both do it. Open models don't, so add your own filter list.
- Repetition / drift past 30 s. AR models loop past that point. Crossfade multiple generations, or use ACE-Step for structural coherence.
- Tempo drift. Models wander off the target BPM. Tag the BPM in the prompt and post-filter with librosa's
beat_track. - Vocal intelligibility. Suno is excellent at this; open models are often mushy on words. If the lyrics matter, reach for a commercial API or fine-tune.
- Mono output. Open models generate mono, or fake stereo. Fix it with a proper stereo reconstruction step, like ezst or Cartesia's stereo diffusion.
Ship It
Save it as outputs/skill-music-designer.md. Pick the model, the license strategy, a length and structure plan, and the disclosure metadata your deployment needs.
The technical half of this lesson is the easy half. Anyone can have MusicGen or ACE-Step generating something listenable by the end of an afternoon. What actually kills music-gen projects in 2026 is skipping the legal review until after the demo ships, then finding out the "in the style of X" prompts your test users loved are the exact pattern that just cost Suno and Udio $500M-plus in settlements. Default to instrumental-only or a licensed commercial API until someone on the team has actually read the consent and disclosure rules for your market. It's the boring choice, and it's also the one that doesn't end with a call from legal.
Exercises
- Easy. Run
code/main.py. It produces a "generative" chord progression and drum pattern as ASCII symbols, a music-gen cartoon you can play back through any MIDI renderer if you want. - Medium. Install
audiocraft, generate 10-second clips across 4 genre prompts with MusicGen-small, and measure FAD against a reference genre set. - Hard. Using ACE-Step (or MusicGen-melody), generate three variations of the same tune with different timbre prompts, then compute CLAP similarity to the prompt to verify alignment.
Key Terms
| Term | What people say | What it actually means |
|---|---|---|
| FAD | Audio FID | Fréchet distance between embedding distributions of real vs generated. |
| Chromagram | Melody as pitches | 12-dim per-frame vector; input to melody conditioning. |
| Stems | Instrument tracks | Separated bass / drums / vocals / melody as WAV. |
| Inpainting | Regen a section | Mask a time window; model regenerates just that. |
| CLAP | Text-audio CLIP | Contrastive audio-text embedding; eval text-audio alignment. |
| EnCodec | Music codec | Meta's neural codec used by MusicGen; 32 kHz, 4 codebooks. |
Further Reading
- Copet et al. (2023). MusicGen: the open autoregressive benchmark.
- Evans et al. (2024). Stable Audio Open: the sound-design default.
- ACE-Step: open 4B full-song generator, April 2026.
- Suno v5 platform docs: the commercial quality leader.
- AudioLDM2: latent diffusion for music + sound effects.
- WMG-Suno settlement coverage: Nov 2025 precedent.
Code
- main.py (python, 127 lines)