The Sound of AI
In 2024, AI-generated music crossed a threshold: it became indistinguishable from human-produced tracks for many listeners. Suno v3 and Udio went viral with millions of users generating everything from lo-fi hip-hop to orchestral film scores from simple text prompts. The music industry is still processing the implications.
How AI Music Generation Works
Language-Model Approach (AudioCraft, MusicGen)
Meta's MusicGen treats audio as a sequence of discrete tokens — similar to how LLMs treat text — and trains an autoregressive transformer to predict the next audio token given a text prompt and previous audio context. The model never directly synthesises audio; it generates tokens that a codec (Encodec) converts back to waveforms.
Diffusion-Based Approach
Suno and Stable Audio use diffusion models applied in a compressed latent audio space, similar to how Stable Diffusion works for images. These produce higher quality but are slower to generate.
Comparing the Tools
| Tool | Best For | Vocals | Length | Cost |
|---|---|---|---|---|
| Suno v4 | Songs with vocals | Excellent | Up to 4 min | Free tier + subscription |
| Udio | Genre diversity | Very good | Up to 3 min | Free tier + subscription |
| MusicGen | Instrumental, open-source | None | 30 sec | Free (self-host) |
| Stable Audio | Sound design, loops | None | Up to 3 min | Subscription |
Using MusicGen Locally
from audiocraft.models import MusicGen
import torchaudio
model = MusicGen.get_pretrained("facebook/musicgen-large")
model.set_generation_params(duration=30)
descriptions = ["upbeat electronic music with driving bass, 120bpm"]
wav = model.generate(descriptions)
torchaudio.save("output.wav", wav[0].cpu(), model.sample_rate)
The legal question of whether AI training on copyrighted music constitutes infringement is being litigated in multiple jurisdictions. Until resolved, commercial use of AI-generated music carries legal risk depending on which training data the model used.