ElevenLabs music bed
Give it a brief (genre, mood, instruments, tempo, the arc and how it ends) and a length,
or a plan of timed sections; get an MP3 bed. Use a plan whenever the music must hit a
mark: with a prompt alone the timing is only a suggestion. For a spot effect (a whoosh,
a door), use elevenlabs-sound-effects; for a song the person brings, there is nothing
to generate.
Inputs
Either:
- A prompt and a length:
prompt(genre, mood, instruments, tempo, the arc, how it ends) andmusic_length_ms, 3 to 600 s. Good for a bed that only has to be roughly long enough. - A composition plan:
composition_planwithsections(eachsection_name,duration_msof 3 to 120 s,lines,positive_local_styles,negative_local_styles),positive_global_stylesandnegative_global_styles, plusrespect_sections_durations: trueso the lengths are kept. Lay the sections out on the cut's cue marks (a lift where the product appears, a final hit on the end card).
Run it
Call describe("fal/fal-ai/elevenlabs/music") before the first run in a job, and price
a batch with run(..., estimate: true).
From a prompt, instrumental:
run("fal/fal-ai/elevenlabs/music",
{"prompt": "Warm, optimistic indie pop bed, clean electric guitar, soft synth pad, light drums, 100 BPM. Builds gently, lifts at 22 s, ends on a single bright hit with a short ring-out.",
"music_length_ms": 30000, "force_instrumental": true},
into="<job>/audio/music/pass_a", unit="bed_a")
From a plan, to land on marks:
run("fal/fal-ai/elevenlabs/music",
{"composition_plan": {
"positive_global_styles": ["warm indie pop", "clean electric guitar", "soft synth pad", "100 BPM"],
"negative_global_styles": ["vocals", "banjo", "slide guitar"],
"sections": [
{"section_name": "intro", "duration_ms": 8000, "lines": [],
"positive_local_styles": ["guitar and pad only, sparse"], "negative_local_styles": ["drums"]},
{"section_name": "lift", "duration_ms": 16000, "lines": [],
"positive_local_styles": ["drums enter, fuller, rising"], "negative_local_styles": []},
{"section_name": "button", "duration_ms": 6000, "lines": [],
"positive_local_styles": ["one final bright hit, then ring out"], "negative_local_styles": []}]},
"respect_sections_durations": true},
into="<job>/audio/music/pass_a", unit="bed_plan_a")
- fal refuses
force_instrumentalwith a plan. Keep a plan instrumental with emptylinesin every section and "vocals" innegative_global_styles. - Name what must not be there in the negative styles (an instrument, a genre cliché), and check for it anyway (Tips and traps).
What you get
One MP3 per call. Convert it to 48 kHz WAV before mixing
(exec("ffmpeg", ["-i", "audio/music/pass_a/bed_a.mp3", "-ar", "48000", "audio/music/pass_a/bed_a.wav"], cwd))
and read its real length (ffprobe-inspect-media): it isn't always what was asked.
Tips and traps
- With a prompt alone, timing is a suggestion. One 30 s bed with its marks written in the prompt ("lifts at 22 s, final hit at 29.5 s") landed on them, but other beds faded out 3 to 5 s early, and one ran 37 s for 28 s asked. When a hit must land, use a plan.
- Listen to every take against the brief. Of two takes asked for "no twang", one had banjo and slide guitar. Put what must not be there in the negative styles, and check each take before it goes to the person.
- The person picks the music. It is taste, not a measurement: make two or three takes, put them on a review page with the picture under them, and wait for a pick before building the mix on one. This is a gate.
- The leaf makes the bed; mixing is elsewhere. Lay it under the voice in the
compositor spec's
audiolist at a lowervolume(hn4a-compositor-motion-graphics), or mix and duck it under the voice with ffmpeg (sidechaincompresskeyed on the voice). Normalize the finished mix once (ffmpeg-normalize-loudness), not the bed on its own. - Trim a bed that runs long with a short fade-out at the cut's end rather than asking for a new one; regenerate when it ends early or misses a mark.
Check it
- Its length (
ffprobe-inspect-media) against what was asked, and each section mark by ear against its cue in the cut. - No vocals, and nothing from the negative styles, over the whole take.
- Under the voice in the mix: every word stays clear at the bed's level.


