Generate music from text prompts using Google Lyria 3 Pro via OpenRouter. Create original compositions with detailed control over genre, instrumentation, mood, tempo, and structure.
- 🎵 Text-to-Music: Describe any music in natural language and get a WAV/MP3 file
- 🎻 Multi-Genre: Classical, jazz, electronic, ambient, cinematic, lo-fi, rock, and more
- ⚙️ Detailed Control: Specify genre, instruments, mood, tempo/BPM, key, structure
- 🔄 Streaming: Audio streams in real-time via SSE — no waiting for full generation
- 🔌 OpenRouter Powered: Uses the existing OpenRouter API key — no additional signup needed
- 🧩 Skill-Integrated: Automatically loaded as a skill when installed
a0 install music_generationOr manually clone this repo into /a0/usr/plugins/music_generation/ and enable it in the Plugin Manager.
Load the skill:
skills_tool action=load skill_name=music-generation
Then generate music via code execution:
export OPENROUTER_API_KEY="$API_KEY_OPENROUTER"
python /a0/usr/plugins/music_generation/skills/music-generation/scripts/lyria-gen.py \
"Atmospheric ambient drone, slow evolving pads, field recordings, peaceful 60 BPM" \
--output /a0/usr/workdir/ambient.wav --timeout 300- An OpenRouter API key (Agent Zero's existing
API_KEY_OPENROUTERis used automatically) - Python package:
requests
- Default:
google/lyria-3-pro-preview - Sample rate: 48,000 Hz stereo, 16-bit
- Output formats: WAV (default) or MP3 (auto-detected)
| Element | Examples |
|---|---|
| Genre | jazz, classical, EDM, lo-fi, ambient, cinematic |
| Instruments | piano, strings, synth, drums, orchestra, cello |
| Mood | melancholic, upbeat, peaceful, dramatic |
| Structure | verse-chorus, adagio, building tension, crescendo |
| Tempo | 70 BPM, slow, 128 BPM, fast |
| Key | D minor, C major, A minor |
| Path | Purpose |
|---|---|
plugin.yaml |
Plugin manifest for Agent Zero |
skills/music-generation/SKILL.md |
Skill instructions loaded into agent context |
skills/music-generation/scripts/lyria-gen.py |
Music generation engine |
MIT