Music Generation Skill
Generate music, songs, and audio using AI (Suno, Udio, Google Lyria).
Prerequisites
At least one API key is required:
GOOGLE_API_KEY - For Google Lyria (same key as video/image) ✅
SUNO_API_KEY - For Suno music generation
UDIO_API_KEY - For Udio music generation
Available APIs
Google Lyria (Instrumental Only)
- Best for: Background music, beats, soundtracks, game audio
- Duration: Any length (streams in real-time)
- Features: BPM control, key/scale, brightness, density
- Output: 48kHz stereo WAV
- API Key: Same
GOOGLE_API_KEY as video/image generation ✅
- ⚠️ INSTRUMENTAL ONLY - Cannot generate vocals
Suno (Recommended for Songs with Vocals)
- Best for: Full songs with vocals, catchy melodies, various genres
- Duration: Up to 4 minutes
- Features: Lyrics generation, instrumental mode, style tags
- Genres: Pop, rock, jazz, electronic, classical, hip-hop, and more
Udio
- Best for: High-fidelity audio, experimental styles, remixes
- Duration: Up to 2 minutes per generation
- Features: Style control, audio quality options
- Genres: Wide variety with strong electronic/experimental support
Workflow
Step 1: Ask Key Question - Vocals or Instrumental?
This determines which API to use:
| Need |
API |
Why |
| Vocals/Lyrics |
Suno or Udio |
Lyria cannot generate vocals |
| Instrumental only |
Lyria (preferred) |
Same API key as video/image, real-time control |
| Background music |
Lyria |
Best for soundtracks, game audio |
| Full songs |
Suno |
Best vocal quality |
Example prompt to user:
"I'll generate that music! Quick question:
Do you need vocals/lyrics?
- Yes → I'll use Suno (best for songs)
- No, instrumental only → I'll use Lyria (same key as video/image)
What genre/mood? (e.g., chill lo-fi, epic orchestral, upbeat pop)
How long? (Lyria: any length, Suno: up to 4 min)
Any BPM preference? (e.g., 90 for chill, 128 for dance)"
Step 2: Understand the Request
Parse the user's music request for:
- Genre/style: Pop, rock, jazz, electronic, classical, etc.
- Mood: Happy, sad, energetic, calm, dramatic
- Tempo: Fast, slow, medium, specific BPM
- Vocals: With vocals → Suno/Udio, Instrumental → Lyria
- Purpose: Background music, song, jingle, soundtrack
- Duration: How long should it be?
Step 2: Craft the Prompt
Transform the user request into an effective music generation prompt:
- Specify genre: Be specific about the style
- Describe mood: Emotional tone and energy level
- Include instruments: What should be prominent
- Add production style: Lo-fi, polished, vintage, modern
- Set tempo: BPM or descriptive (upbeat, slow)
Example transformation:
- User: "happy summer song"
- Enhanced: "Upbeat indie pop song with bright acoustic guitar, cheerful ukulele, and sunny vibes. Feel-good summer anthem with catchy hooks and positive energy. Male vocals, 120 BPM, radio-friendly production"
Step 3: Handle Lyrics (If Needed)
For songs with vocals:
- User provides lyrics: Use them directly
- Generate lyrics: Ask Suno/Udio to generate, or use Claude to write them first
- Instrumental: Specify "instrumental" to skip vocals
Lyrics format for Suno:
[Verse 1]
Your lyrics here
[Chorus]
Catchy chorus lyrics
[Verse 2]
More lyrics
Step 4: Select the API
Choose based on requirements:
| Use Case |
Recommended API |
Reason |
| Instrumental/background |
Lyria |
Same API key, any duration, real-time control |
| Full songs with vocals |
Suno |
Best vocal quality |
| Lo-fi beats |
Lyria |
Great for ambient/chill |
| Experimental/electronic |
Udio |
Strong in these genres |
| Specific lyrics needed |
Suno |
Lyrics input support |
| Game/video soundtrack |
Lyria |
Precise BPM/key control |
Step 5: Generate the Music
Execute the appropriate script from ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/:
For Google Lyria (Instrumental):
python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/lyria.py \
--prompt "chill lo-fi hip hop, jazzy piano, vinyl crackle" \
--duration 60 \
--bpm 85
Lyria with key/scale:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/lyria.py \
--prompt "ambient, ethereal synths, dreamy" \
--duration 120 \
--scale "C" \
--brightness 0.7
Lyria with multiple prompts (blended):
python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/lyria.py \
--prompt "minimal techno" \
--prompt "deep bass, 808" \
--bpm 128 \
--duration 90
For Suno (with vocals):
python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/suno.py \
--prompt "upbeat indie pop, summer vibes, acoustic guitar" \
--title "Summer Days"
For Udio:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/udio.py \
--prompt "cinematic orchestral, epic trailer music" \
--duration 120
Step 6: Deliver the Result
- Provide the generated audio file path
- Share the prompt and settings used
- Mention the duration and format
- Offer to:
- Generate variations
- Try different style/genre
- Adjust tempo or mood
- Extend the track
- Add or remove vocals
Error Handling
Missing API key: Inform the user which key is needed:
Lyria requires google-genai package: pip install google-genai
User wants vocals but only has GOOGLE_API_KEY: Explain Lyria is instrumental-only, suggest Suno/Udio.
Content policy violation: Rephrase lyrics or prompt.
Generation failed: Retry with simplified prompt.
Quota exceeded: Suggest waiting or trying other provider.
Prompt Engineering Tips
Genre Tags (Suno Style)
Include specific genre tags for best results:
[pop, upbeat, female vocals, 128 BPM]
[jazz, smooth, saxophone, laid-back]
[electronic, synthwave, 80s, driving]
[classical, orchestral, emotional, strings]
Mood Descriptors
- Energetic: upbeat, driving, powerful, intense
- Calm: relaxing, ambient, peaceful, gentle
- Happy: cheerful, bright, sunny, joyful
- Sad: melancholic, emotional, heartfelt, somber
- Epic: cinematic, dramatic, sweeping, grand
Production Style
- Lo-fi: warm, vintage, tape hiss, nostalgic
- Polished: crisp, modern, radio-ready, professional
- Raw: garage, live, organic, unpolished
- Electronic: synthesizers, digital, processed
API Comparison
| Feature |
Lyria |
Suno |
Udio |
| API Key |
GOOGLE_API_KEY ✅ |
SUNO_API_KEY |
UDIO_API_KEY |
| Max duration |
Unlimited |
4 minutes |
2 minutes |
| Vocals |
❌ No |
✅ Excellent |
✅ Good |
| Instrumentals |
✅ Excellent |
✅ Great |
✅ Excellent |
| BPM control |
✅ 60-200 |
❌ No |
❌ No |
| Key/Scale control |
✅ Yes |
❌ No |
❌ No |
| Audio quality |
48kHz WAV |
Very good |
Excellent |
| Lyrics input |
❌ No |
✅ Yes |
✅ Yes |
| Real-time steering |
✅ Yes |
❌ No |
❌ No |
| Best for |
Beats, soundtracks |
Songs |
Experimental |
Example Prompts
Pop Song
Catchy pop song with female vocals, bright synths, and an anthemic chorus.
Feel-good energy, summer vibes, 120 BPM, radio-friendly production.
Cinematic Score
Epic orchestral trailer music with building tension. Powerful brass,
sweeping strings, thundering percussion. Dramatic and emotional.
Lo-fi Beat
Chill lo-fi hip hop beat, jazzy piano samples, vinyl crackle,
relaxed drums, perfect for studying. 85 BPM, nostalgic mood.
Electronic Dance
High-energy EDM track with massive drops, pulsing synths,
four-on-the-floor beat. Festival-ready, 128 BPM.
Lyria-Specific Examples
Lo-fi Study Beats
python3 lyria.py -p "lo-fi hip hop, jazzy piano, vinyl crackle, chill" \
--duration 300 --bpm 85 --brightness 0.3
Techno/Dance
python3 lyria.py -p "minimal techno, deep bass, 808 drums" \
--duration 120 --bpm 128 --density 0.7
Ambient/Meditation
python3 lyria.py -p "ambient, ethereal, soft pads, dreamy" \
--duration 180 --brightness 0.8 --density 0.2
Game Soundtrack
python3 lyria.py -p "epic orchestral, cinematic, dramatic strings" \
--duration 90 --scale "D" --mode quality
Lyria Prompt Tips
- Instruments: piano, guitar, synth, drums, bass, strings, 808, Rhodes, Moog
- Genres: lo-fi hip hop, minimal techno, ambient, jazz fusion, synthwave, chillout
- Moods: chill, energetic, dreamy, dark, upbeat, melancholic, epic
- Combine prompts: Use multiple
-p flags to blend styles
1---2name: music-generation3description: Music Generation Skill4---5# Music Generation Skill67Generate music, songs, and audio using AI (Suno, Udio, Google Lyria).89## Prerequisites1011At least one API key is required:1213- `GOOGLE_API_KEY` - For Google Lyria (same key as video/image) ✅14- `SUNO_API_KEY` - For Suno music generation15- `UDIO_API_KEY` - For Udio music generation1617## Available APIs1819### Google Lyria (Instrumental Only)20- **Best for**: Background music, beats, soundtracks, game audio21- **Duration**: Any length (streams in real-time)22- **Features**: BPM control, key/scale, brightness, density23- **Output**: 48kHz stereo WAV24- **API Key**: Same `GOOGLE_API_KEY` as video/image generation ✅25- **⚠️ INSTRUMENTAL ONLY** - Cannot generate vocals2627### Suno (Recommended for Songs with Vocals)28- **Best for**: Full songs with vocals, catchy melodies, various genres29- **Duration**: Up to 4 minutes30- **Features**: Lyrics generation, instrumental mode, style tags31- **Genres**: Pop, rock, jazz, electronic, classical, hip-hop, and more3233### Udio34- **Best for**: High-fidelity audio, experimental styles, remixes35- **Duration**: Up to 2 minutes per generation36- **Features**: Style control, audio quality options37- **Genres**: Wide variety with strong electronic/experimental support3839## Workflow4041### Step 1: Ask Key Question - Vocals or Instrumental?4243**This determines which API to use:**4445| Need | API | Why |46|------|-----|-----|47| **Vocals/Lyrics** | Suno or Udio | Lyria cannot generate vocals |48| **Instrumental only** | Lyria (preferred) | Same API key as video/image, real-time control |49| **Background music** | Lyria | Best for soundtracks, game audio |50| **Full songs** | Suno | Best vocal quality |5152**Example prompt to user:**5354"I'll generate that music! Quick question:55561. **Do you need vocals/lyrics?**57 - Yes → I'll use Suno (best for songs)58 - No, instrumental only → I'll use Lyria (same key as video/image)59602. **What genre/mood?** (e.g., chill lo-fi, epic orchestral, upbeat pop)61623. **How long?** (Lyria: any length, Suno: up to 4 min)63644. **Any BPM preference?** (e.g., 90 for chill, 128 for dance)"6566---6768### Step 2: Understand the Request6970Parse the user's music request for:71- **Genre/style**: Pop, rock, jazz, electronic, classical, etc.72- **Mood**: Happy, sad, energetic, calm, dramatic73- **Tempo**: Fast, slow, medium, specific BPM74- **Vocals**: With vocals → Suno/Udio, Instrumental → Lyria75- **Purpose**: Background music, song, jingle, soundtrack76- **Duration**: How long should it be?7778### Step 2: Craft the Prompt7980Transform the user request into an effective music generation prompt:81821. **Specify genre**: Be specific about the style832. **Describe mood**: Emotional tone and energy level843. **Include instruments**: What should be prominent854. **Add production style**: Lo-fi, polished, vintage, modern865. **Set tempo**: BPM or descriptive (upbeat, slow)8788**Example transformation:**89- User: "happy summer song"90- Enhanced: "Upbeat indie pop song with bright acoustic guitar, cheerful ukulele, and sunny vibes. Feel-good summer anthem with catchy hooks and positive energy. Male vocals, 120 BPM, radio-friendly production"9192### Step 3: Handle Lyrics (If Needed)9394For songs with vocals:95- **User provides lyrics**: Use them directly96- **Generate lyrics**: Ask Suno/Udio to generate, or use Claude to write them first97- **Instrumental**: Specify "instrumental" to skip vocals9899Lyrics format for Suno:100```101[Verse 1]102Your lyrics here103104[Chorus]105Catchy chorus lyrics106107[Verse 2]108More lyrics109```110111### Step 4: Select the API112113Choose based on requirements:114115| Use Case | Recommended API | Reason |116|----------|----------------|--------|117| **Instrumental/background** | Lyria | Same API key, any duration, real-time control |118| **Full songs with vocals** | Suno | Best vocal quality |119| **Lo-fi beats** | Lyria | Great for ambient/chill |120| **Experimental/electronic** | Udio | Strong in these genres |121| **Specific lyrics needed** | Suno | Lyrics input support |122| **Game/video soundtrack** | Lyria | Precise BPM/key control |123124### Step 5: Generate the Music125126Execute the appropriate script from `${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/`:127128**For Google Lyria (Instrumental):**129```bash130python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/lyria.py \131 --prompt "chill lo-fi hip hop, jazzy piano, vinyl crackle" \132 --duration 60 \133 --bpm 85134```135136**Lyria with key/scale:**137```bash138python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/lyria.py \139 --prompt "ambient, ethereal synths, dreamy" \140 --duration 120 \141 --scale "C" \142 --brightness 0.7143```144145**Lyria with multiple prompts (blended):**146```bash147python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/lyria.py \148 --prompt "minimal techno" \149 --prompt "deep bass, 808" \150 --bpm 128 \151 --duration 90152```153154**For Suno (with vocals):**155```bash156python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/suno.py \157 --prompt "upbeat indie pop, summer vibes, acoustic guitar" \158 --title "Summer Days"159```160161**For Udio:**162```bash163python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/udio.py \164 --prompt "cinematic orchestral, epic trailer music" \165 --duration 120166```167168### Step 6: Deliver the Result1691701. Provide the generated audio file path1712. Share the prompt and settings used1723. Mention the duration and format1734. Offer to:174 - Generate variations175 - Try different style/genre176 - Adjust tempo or mood177 - Extend the track178 - Add or remove vocals179180## Error Handling181182**Missing API key**: Inform the user which key is needed:183- Lyria: Same `GOOGLE_API_KEY` as video/image - https://aistudio.google.com/apikey184- Suno: https://suno.com/api (or app.suno.ai)185- Udio: https://udio.com/api186187**Lyria requires google-genai package**: `pip install google-genai`188189**User wants vocals but only has GOOGLE_API_KEY**: Explain Lyria is instrumental-only, suggest Suno/Udio.190191**Content policy violation**: Rephrase lyrics or prompt.192193**Generation failed**: Retry with simplified prompt.194195**Quota exceeded**: Suggest waiting or trying other provider.196197## Prompt Engineering Tips198199### Genre Tags (Suno Style)200Include specific genre tags for best results:201- `[pop, upbeat, female vocals, 128 BPM]`202- `[jazz, smooth, saxophone, laid-back]`203- `[electronic, synthwave, 80s, driving]`204- `[classical, orchestral, emotional, strings]`205206### Mood Descriptors207- **Energetic**: upbeat, driving, powerful, intense208- **Calm**: relaxing, ambient, peaceful, gentle209- **Happy**: cheerful, bright, sunny, joyful210- **Sad**: melancholic, emotional, heartfelt, somber211- **Epic**: cinematic, dramatic, sweeping, grand212213### Production Style214- **Lo-fi**: warm, vintage, tape hiss, nostalgic215- **Polished**: crisp, modern, radio-ready, professional216- **Raw**: garage, live, organic, unpolished217- **Electronic**: synthesizers, digital, processed218219## API Comparison220221| Feature | Lyria | Suno | Udio |222|---------|-------|------|------|223| API Key | `GOOGLE_API_KEY` ✅ | `SUNO_API_KEY` | `UDIO_API_KEY` |224| Max duration | **Unlimited** | 4 minutes | 2 minutes |225| Vocals | ❌ **No** | ✅ Excellent | ✅ Good |226| Instrumentals | ✅ Excellent | ✅ Great | ✅ Excellent |227| BPM control | ✅ 60-200 | ❌ No | ❌ No |228| Key/Scale control | ✅ Yes | ❌ No | ❌ No |229| Audio quality | 48kHz WAV | Very good | Excellent |230| Lyrics input | ❌ No | ✅ Yes | ✅ Yes |231| Real-time steering | ✅ Yes | ❌ No | ❌ No |232| Best for | Beats, soundtracks | Songs | Experimental |233234## Example Prompts235236### Pop Song237```238Catchy pop song with female vocals, bright synths, and an anthemic chorus. 239Feel-good energy, summer vibes, 120 BPM, radio-friendly production.240```241242### Cinematic Score243```244Epic orchestral trailer music with building tension. Powerful brass, 245sweeping strings, thundering percussion. Dramatic and emotional.246```247248### Lo-fi Beat249```250Chill lo-fi hip hop beat, jazzy piano samples, vinyl crackle, 251relaxed drums, perfect for studying. 85 BPM, nostalgic mood.252```253254### Electronic Dance255```256High-energy EDM track with massive drops, pulsing synths, 257four-on-the-floor beat. Festival-ready, 128 BPM.258```259260## Lyria-Specific Examples261262### Lo-fi Study Beats263```bash264python3 lyria.py -p "lo-fi hip hop, jazzy piano, vinyl crackle, chill" \265 --duration 300 --bpm 85 --brightness 0.3266```267268### Techno/Dance269```bash270python3 lyria.py -p "minimal techno, deep bass, 808 drums" \271 --duration 120 --bpm 128 --density 0.7272```273274### Ambient/Meditation275```bash276python3 lyria.py -p "ambient, ethereal, soft pads, dreamy" \277 --duration 180 --brightness 0.8 --density 0.2278```279280### Game Soundtrack281```bash282python3 lyria.py -p "epic orchestral, cinematic, dramatic strings" \283 --duration 90 --scale "D" --mode quality284```285286### Lyria Prompt Tips287- **Instruments**: piano, guitar, synth, drums, bass, strings, 808, Rhodes, Moog288- **Genres**: lo-fi hip hop, minimal techno, ambient, jazz fusion, synthwave, chillout289- **Moods**: chill, energetic, dreamy, dark, upbeat, melancholic, epic290- **Combine prompts**: Use multiple `-p` flags to blend styles