Music Generation Usage for OpenMontage
Sources: ElevenLabs Music API documentation, ElevenLabs best practices guide, Artlist BPM
guide, existing Layer 3 skills at .agents/skills/music/ and .agents/skills/elevenlabs/
Quick Reference Card
API MODEL: music_v1
MIN DURATION: 3,000ms (3s)
MAX DURATION: 600,000ms (10 min)
INSTRUMENTAL: Always set force_instrumental=true for video background
COST: ~$0.05 per 30 seconds
KEY RULE: Music must be 18-20 dB below narration (see sound-design.md)
BPM Selection by Video Type
| Video Type |
BPM Range |
Prompt Fragment |
| Educational explainer |
80-100 |
"gentle ambient electronic, 90 BPM" |
| Corporate / tech |
100-120 |
"upbeat corporate pop, 110 BPM, positive" |
| Epic / dramatic reveal |
60-80 |
"cinematic orchestral, 70 BPM, building tension" |
| Fast-paced montage |
120-140 |
"energetic electronic, 130 BPM, driving beat" |
| Meditation / calm |
50-70 |
"ambient drone, 60 BPM, peaceful" |
| Comedy / lighthearted |
100-130 |
"playful ukulele pop, 120 BPM, whimsical" |
| Sad / reflective |
60-80 |
"melancholic piano, 65 BPM, minor key" |
| Action / hype |
140-170 |
"high-intensity drum and bass, 160 BPM" |
Key and Mood Mapping
| Mood |
Key |
Musical Characteristics |
| Happy / upbeat |
C major, G major |
Bright, resolved, energetic |
| Serious / professional |
D minor, A minor |
Grounded, authoritative |
| Mysterious / curious |
E minor, B minor |
Tension, anticipation |
| Triumphant / inspiring |
D major, Bb major |
Expansive, climactic |
| Melancholic / thoughtful |
F minor, C minor |
Reflective, emotional |
| Neutral / ambient |
C major, Am (no strong key) |
Unobtrusive, background |
Prompt Engineering
Structure
[GENRE/STYLE], [BPM], [KEY/MOOD], [INSTRUMENTS], [ENERGY LEVEL], [PURPOSE]
Examples
Educational explainer:
Gentle lo-fi ambient electronic, 90 BPM, C major, soft synth pads and light
percussion, calm and steady energy, background music for narration
Corporate product demo:
Modern upbeat corporate pop, 110 BPM, G major, acoustic guitar and light drums,
positive energy building gradually, underscore for product walkthrough
Technical deep-dive:
Minimal ambient electronic, 80 BPM, A minor, soft Rhodes piano and subtle
bass, contemplative and focused, background music for technical explanation
Key Prompting Rules
- Always include "background" or "underscore" — tells the model to stay dynamically even
- Always use
force_instrumental=true — lyrics compete with narration
- Specify BPM explicitly — don't rely on genre to set tempo
- Avoid "bright hi-hats" or "prominent vocals" — high-frequency busy elements compete with speech in the 2-4 kHz intelligibility band
- Include energy direction — "steady energy" for explainers, "building gradually" for reveals
Duration Matching
Exact Duration
result = music_gen.execute({
"prompt": "Gentle ambient, 90 BPM, background underscore",
"duration_seconds": 150, # Match video length
"output_path": "assets/music/background.mp3"
})
Section-Mapped (Advanced)
For videos with distinct acts, generate sections separately:
| Video Section |
Duration |
Music Style |
| Intro / hook |
8-10s |
Soft, building |
| Main explanation |
90-120s |
Steady, neutral |
| Key reveal |
20-30s |
Intensified, fuller |
| Outro |
10-15s |
Fading, gentle |
Generate each as a separate track and crossfade in the audio_mixer.
Looping for Long Videos
For videos longer than the generated track:
- Generate a track 30-60% of video length
- Use FFmpeg to create a seamless loop:
ffmpeg -stream_loop 2 -i music.mp3 -c copy music_looped.mp3
- Add a 2-3 second crossfade at loop points in
audio_mixer
Better approach: Generate at the exact video duration. ElevenLabs supports up to 10 minutes per generation.
Stem Isolation
For cleaner ducking control, generate isolated stems:
"solo electric guitar in E minor, 90 BPM" — guitar-only track
"soft ambient pad in C major, 80 BPM" — synth pad only
- Layer stems in FFmpeg during composition for precise ducking control
Applying to OpenMontage
When using the music_gen tool:
- Match BPM to content type using the table above — don't default to a generic prompt
- Always set
force_instrumental=true — no lyrics under narration
- Include "background" or "underscore" in every prompt
- Set duration to match video length — avoid looping when possible
- Budget check — at $0.05/30s, a 3-minute video costs ~$0.30 for music
- Duck music 18-20 dB below narration — see
skills/creative/sound-design.md for ducking rules
- Cut 2-4 kHz on the music bed in
audio_mixer to clear the speech intelligibility band
- Test on phone speakers — if narration disappears behind music, duck more aggressively
- One track per video — avoid switching music styles mid-video unless there's a clear narrative shift
1---2name: openmontage-music-gen-usage3version: "1.0.0"4description: 指导在 OpenMontage 中调用 music_gen 工具生成视频背景音乐,涵盖 BPM 选型、调性与情绪映射、提示词工程、时长匹配、循环与分轨处理,适用于需要为解说、宣传、教程等视频配置无版权背景乐的创作场景。5metadata:6 source: https://skillmd.com/skills/wanfeng1028/openmontage-music-gen-usage7 license: AGPL-3.08---910# Music Generation Usage for OpenMontage1112> Sources: ElevenLabs Music API documentation, ElevenLabs best practices guide, Artlist BPM13> guide, existing Layer 3 skills at `.agents/skills/music/` and `.agents/skills/elevenlabs/`1415## Quick Reference Card1617```18API MODEL: music_v119MIN DURATION: 3,000ms (3s)20MAX DURATION: 600,000ms (10 min)21INSTRUMENTAL: Always set force_instrumental=true for video background22COST: ~$0.05 per 30 seconds23KEY RULE: Music must be 18-20 dB below narration (see sound-design.md)24```2526## BPM Selection by Video Type2728| Video Type | BPM Range | Prompt Fragment |29|-----------|-----------|-----------------|30| Educational explainer | 80-100 | "gentle ambient electronic, 90 BPM" |31| Corporate / tech | 100-120 | "upbeat corporate pop, 110 BPM, positive" |32| Epic / dramatic reveal | 60-80 | "cinematic orchestral, 70 BPM, building tension" |33| Fast-paced montage | 120-140 | "energetic electronic, 130 BPM, driving beat" |34| Meditation / calm | 50-70 | "ambient drone, 60 BPM, peaceful" |35| Comedy / lighthearted | 100-130 | "playful ukulele pop, 120 BPM, whimsical" |36| Sad / reflective | 60-80 | "melancholic piano, 65 BPM, minor key" |37| Action / hype | 140-170 | "high-intensity drum and bass, 160 BPM" |3839## Key and Mood Mapping4041| Mood | Key | Musical Characteristics |42|------|-----|----------------------|43| Happy / upbeat | C major, G major | Bright, resolved, energetic |44| Serious / professional | D minor, A minor | Grounded, authoritative |45| Mysterious / curious | E minor, B minor | Tension, anticipation |46| Triumphant / inspiring | D major, Bb major | Expansive, climactic |47| Melancholic / thoughtful | F minor, C minor | Reflective, emotional |48| Neutral / ambient | C major, Am (no strong key) | Unobtrusive, background |4950## Prompt Engineering5152### Structure5354```55[GENRE/STYLE], [BPM], [KEY/MOOD], [INSTRUMENTS], [ENERGY LEVEL], [PURPOSE]56```5758### Examples5960**Educational explainer:**61```62Gentle lo-fi ambient electronic, 90 BPM, C major, soft synth pads and light63percussion, calm and steady energy, background music for narration64```6566**Corporate product demo:**67```68Modern upbeat corporate pop, 110 BPM, G major, acoustic guitar and light drums,69positive energy building gradually, underscore for product walkthrough70```7172**Technical deep-dive:**73```74Minimal ambient electronic, 80 BPM, A minor, soft Rhodes piano and subtle75bass, contemplative and focused, background music for technical explanation76```7778### Key Prompting Rules79801. **Always include "background" or "underscore"** — tells the model to stay dynamically even812. **Always use `force_instrumental=true`** — lyrics compete with narration823. **Specify BPM explicitly** — don't rely on genre to set tempo834. **Avoid "bright hi-hats" or "prominent vocals"** — high-frequency busy elements compete with speech in the 2-4 kHz intelligibility band845. **Include energy direction** — "steady energy" for explainers, "building gradually" for reveals8586## Duration Matching8788### Exact Duration8990```python91result = music_gen.execute({92 "prompt": "Gentle ambient, 90 BPM, background underscore",93 "duration_seconds": 150, # Match video length94 "output_path": "assets/music/background.mp3"95})96```9798### Section-Mapped (Advanced)99100For videos with distinct acts, generate sections separately:101102| Video Section | Duration | Music Style |103|--------------|----------|-------------|104| Intro / hook | 8-10s | Soft, building |105| Main explanation | 90-120s | Steady, neutral |106| Key reveal | 20-30s | Intensified, fuller |107| Outro | 10-15s | Fading, gentle |108109Generate each as a separate track and crossfade in the `audio_mixer`.110111## Looping for Long Videos112113For videos longer than the generated track:1141151. Generate a track 30-60% of video length1162. Use FFmpeg to create a seamless loop:117 ```bash118 ffmpeg -stream_loop 2 -i music.mp3 -c copy music_looped.mp3119 ```1203. Add a 2-3 second crossfade at loop points in `audio_mixer`121122**Better approach:** Generate at the exact video duration. ElevenLabs supports up to 10 minutes per generation.123124## Stem Isolation125126For cleaner ducking control, generate isolated stems:127128- `"solo electric guitar in E minor, 90 BPM"` — guitar-only track129- `"soft ambient pad in C major, 80 BPM"` — synth pad only130- Layer stems in FFmpeg during composition for precise ducking control131132## Applying to OpenMontage133134When using the `music_gen` tool:1351361. **Match BPM to content type** using the table above — don't default to a generic prompt1372. **Always set `force_instrumental=true`** — no lyrics under narration1383. **Include "background" or "underscore"** in every prompt1394. **Set duration to match video length** — avoid looping when possible1405. **Budget check** — at $0.05/30s, a 3-minute video costs ~$0.30 for music1416. **Duck music 18-20 dB below narration** — see `skills/creative/sound-design.md` for ducking rules1427. **Cut 2-4 kHz on the music bed** in `audio_mixer` to clear the speech intelligibility band1438. **Test on phone speakers** — if narration disappears behind music, duck more aggressively1449. **One track per video** — avoid switching music styles mid-video unless there's a clear narrative shift