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: Use this skill for AI music generation. Triggers include: "generate music", "create a song", "make music", "compose", "create a beat", "generate audio", "make a soundtrack", "create a jingle", "instrumental music", "background music", "lo-fi beats", "electronic music" Supports vocals (Suno/Udio) and instrumental-only (Google Lyria).4---56# Music Generation Skill78Generate music, songs, and audio using AI (Suno, Udio, Google Lyria).910## Prerequisites1112At least one API key is required:1314- `GOOGLE_API_KEY` - For Google Lyria (same key as video/image) ✅15- `SUNO_API_KEY` - For Suno music generation16- `UDIO_API_KEY` - For Udio music generation1718## Available APIs1920### Google Lyria (Instrumental Only)21- **Best for**: Background music, beats, soundtracks, game audio22- **Duration**: Any length (streams in real-time)23- **Features**: BPM control, key/scale, brightness, density24- **Output**: 48kHz stereo WAV25- **API Key**: Same `GOOGLE_API_KEY` as video/image generation ✅26- **⚠️ INSTRUMENTAL ONLY** - Cannot generate vocals2728### Suno (Recommended for Songs with Vocals)29- **Best for**: Full songs with vocals, catchy melodies, various genres30- **Duration**: Up to 4 minutes31- **Features**: Lyrics generation, instrumental mode, style tags32- **Genres**: Pop, rock, jazz, electronic, classical, hip-hop, and more3334### Udio35- **Best for**: High-fidelity audio, experimental styles, remixes36- **Duration**: Up to 2 minutes per generation37- **Features**: Style control, audio quality options38- **Genres**: Wide variety with strong electronic/experimental support3940## Workflow4142### Step 1: Ask Key Question - Vocals or Instrumental?4344**This determines which API to use:**4546| Need | API | Why |47|------|-----|-----|48| **Vocals/Lyrics** | Suno or Udio | Lyria cannot generate vocals |49| **Instrumental only** | Lyria (preferred) | Same API key as video/image, real-time control |50| **Background music** | Lyria | Best for soundtracks, game audio |51| **Full songs** | Suno | Best vocal quality |5253**Example prompt to user:**5455"I'll generate that music! Quick question:56571. **Do you need vocals/lyrics?**58 - Yes → I'll use Suno (best for songs)59 - No, instrumental only → I'll use Lyria (same key as video/image)60612. **What genre/mood?** (e.g., chill lo-fi, epic orchestral, upbeat pop)62633. **How long?** (Lyria: any length, Suno: up to 4 min)64654. **Any BPM preference?** (e.g., 90 for chill, 128 for dance)"6667---6869### Step 2: Understand the Request7071Parse the user's music request for:72- **Genre/style**: Pop, rock, jazz, electronic, classical, etc.73- **Mood**: Happy, sad, energetic, calm, dramatic74- **Tempo**: Fast, slow, medium, specific BPM75- **Vocals**: With vocals → Suno/Udio, Instrumental → Lyria76- **Purpose**: Background music, song, jingle, soundtrack77- **Duration**: How long should it be?7879### Step 2: Craft the Prompt8081Transform the user request into an effective music generation prompt:82831. **Specify genre**: Be specific about the style842. **Describe mood**: Emotional tone and energy level853. **Include instruments**: What should be prominent864. **Add production style**: Lo-fi, polished, vintage, modern875. **Set tempo**: BPM or descriptive (upbeat, slow)8889**Example transformation:**90- User: "happy summer song"91- 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"9293### Step 3: Handle Lyrics (If Needed)9495For songs with vocals:96- **User provides lyrics**: Use them directly97- **Generate lyrics**: Ask Suno/Udio to generate, or use Claude to write them first98- **Instrumental**: Specify "instrumental" to skip vocals99100Lyrics format for Suno:101```102[Verse 1]103Your lyrics here104105[Chorus]106Catchy chorus lyrics107108[Verse 2]109More lyrics110```111112### Step 4: Select the API113114Choose based on requirements:115116| Use Case | Recommended API | Reason |117|----------|----------------|--------|118| **Instrumental/background** | Lyria | Same API key, any duration, real-time control |119| **Full songs with vocals** | Suno | Best vocal quality |120| **Lo-fi beats** | Lyria | Great for ambient/chill |121| **Experimental/electronic** | Udio | Strong in these genres |122| **Specific lyrics needed** | Suno | Lyrics input support |123| **Game/video soundtrack** | Lyria | Precise BPM/key control |124125### Step 5: Generate the Music126127Execute the appropriate script from `${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/`:128129**For Google Lyria (Instrumental):**130```bash131python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/lyria.py \132 --prompt "chill lo-fi hip hop, jazzy piano, vinyl crackle" \133 --duration 60 \134 --bpm 85135```136137**Lyria with key/scale:**138```bash139python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/lyria.py \140 --prompt "ambient, ethereal synths, dreamy" \141 --duration 120 \142 --scale "C" \143 --brightness 0.7144```145146**Lyria with multiple prompts (blended):**147```bash148python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/lyria.py \149 --prompt "minimal techno" \150 --prompt "deep bass, 808" \151 --bpm 128 \152 --duration 90153```154155**For Suno (with vocals):**156```bash157python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/suno.py \158 --prompt "upbeat indie pop, summer vibes, acoustic guitar" \159 --title "Summer Days"160```161162**For Udio:**163```bash164python3 ${CLAUDE_PLUGIN_ROOT}/skills/music-generation/scripts/udio.py \165 --prompt "cinematic orchestral, epic trailer music" \166 --duration 120167```168169### Step 6: Deliver the Result1701711. Provide the generated audio file path1722. Share the prompt and settings used1733. Mention the duration and format1744. Offer to:175 - Generate variations176 - Try different style/genre177 - Adjust tempo or mood178 - Extend the track179 - Add or remove vocals180181## Error Handling182183**Missing API key**: Inform the user which key is needed:184- Lyria: Same `GOOGLE_API_KEY` as video/image - https://aistudio.google.com/apikey185- Suno: https://suno.com/api (or app.suno.ai)186- Udio: https://udio.com/api187188**Lyria requires google-genai package**: `pip install google-genai`189190**User wants vocals but only has GOOGLE_API_KEY**: Explain Lyria is instrumental-only, suggest Suno/Udio.191192**Content policy violation**: Rephrase lyrics or prompt.193194**Generation failed**: Retry with simplified prompt.195196**Quota exceeded**: Suggest waiting or trying other provider.197198## Prompt Engineering Tips199200### Genre Tags (Suno Style)201Include specific genre tags for best results:202- `[pop, upbeat, female vocals, 128 BPM]`203- `[jazz, smooth, saxophone, laid-back]`204- `[electronic, synthwave, 80s, driving]`205- `[classical, orchestral, emotional, strings]`206207### Mood Descriptors208- **Energetic**: upbeat, driving, powerful, intense209- **Calm**: relaxing, ambient, peaceful, gentle210- **Happy**: cheerful, bright, sunny, joyful211- **Sad**: melancholic, emotional, heartfelt, somber212- **Epic**: cinematic, dramatic, sweeping, grand213214### Production Style215- **Lo-fi**: warm, vintage, tape hiss, nostalgic216- **Polished**: crisp, modern, radio-ready, professional217- **Raw**: garage, live, organic, unpolished218- **Electronic**: synthesizers, digital, processed219220## API Comparison221222| Feature | Lyria | Suno | Udio |223|---------|-------|------|------|224| API Key | `GOOGLE_API_KEY` ✅ | `SUNO_API_KEY` | `UDIO_API_KEY` |225| Max duration | **Unlimited** | 4 minutes | 2 minutes |226| Vocals | ❌ **No** | ✅ Excellent | ✅ Good |227| Instrumentals | ✅ Excellent | ✅ Great | ✅ Excellent |228| BPM control | ✅ 60-200 | ❌ No | ❌ No |229| Key/Scale control | ✅ Yes | ❌ No | ❌ No |230| Audio quality | 48kHz WAV | Very good | Excellent |231| Lyrics input | ❌ No | ✅ Yes | ✅ Yes |232| Real-time steering | ✅ Yes | ❌ No | ❌ No |233| Best for | Beats, soundtracks | Songs | Experimental |234235## Example Prompts236237### Pop Song238```239Catchy pop song with female vocals, bright synths, and an anthemic chorus. 240Feel-good energy, summer vibes, 120 BPM, radio-friendly production.241```242243### Cinematic Score244```245Epic orchestral trailer music with building tension. Powerful brass, 246sweeping strings, thundering percussion. Dramatic and emotional.247```248249### Lo-fi Beat250```251Chill lo-fi hip hop beat, jazzy piano samples, vinyl crackle, 252relaxed drums, perfect for studying. 85 BPM, nostalgic mood.253```254255### Electronic Dance256```257High-energy EDM track with massive drops, pulsing synths, 258four-on-the-floor beat. Festival-ready, 128 BPM.259```260261## Lyria-Specific Examples262263### Lo-fi Study Beats264```bash265python3 lyria.py -p "lo-fi hip hop, jazzy piano, vinyl crackle, chill" \266 --duration 300 --bpm 85 --brightness 0.3267```268269### Techno/Dance270```bash271python3 lyria.py -p "minimal techno, deep bass, 808 drums" \272 --duration 120 --bpm 128 --density 0.7273```274275### Ambient/Meditation276```bash277python3 lyria.py -p "ambient, ethereal, soft pads, dreamy" \278 --duration 180 --brightness 0.8 --density 0.2279```280281### Game Soundtrack282```bash283python3 lyria.py -p "epic orchestral, cinematic, dramatic strings" \284 --duration 90 --scale "D" --mode quality285```286287### Lyria Prompt Tips288- **Instruments**: piano, guitar, synth, drums, bass, strings, 808, Rhodes, Moog289- **Genres**: lo-fi hip hop, minimal techno, ambient, jazz fusion, synthwave, chillout290- **Moods**: chill, energetic, dreamy, dark, upbeat, melancholic, epic291- **Combine prompts**: Use multiple `-p` flags to blend styles