$npx -y skills add QinghongLin/data2story-skill --skill openrouter-text2musicGenerate atmospheric sound-design / SFX (NOT speech, NOT the front-of-blog BGM) via OpenRouter using Google Lyria 3 Pro.
| 1 | # openrouter-text2music |
| 2 | |
| 3 | Text → audio via OpenRouter. Default model: `google/lyria-3-pro-preview`. |
| 4 | |
| 5 | **Role in Data2Story: atmospheric sound-design / SFX only — never the front BGM.** Use this for a sound the story needs that has NO findable real recording: an ambient bed (tension drone, texture, room tone) or best-effort sharp foley (e.g. a glass-shatter texture). Lyria's strength is ambient/textural beds, not crisp transients, so sharp foley is best-effort. The result is an opt-in, event/section-bound, reader-controlled element. **The front-of-blog BGM must be a SOURCED real track (sourced_bgm via the Scout) — never generated here.** |
| 6 | |
| 7 | **⚠️ This is a generative audio model, not TTS.** It produces 48kHz stereo audio; for narration/voiceover use a dedicated TTS tool (e.g., OpenAI `tts-1`, ElevenLabs). |
| 8 | |
| 9 | ## Usage |
| 10 | |
| 11 | Resolve `TOOL_DIR` = the directory containing this `SKILL.md`. Commands below use `TOOL_DIR` as a symbolic placeholder; replace it with the resolved, quoted path before running Bash. |
| 12 | |
| 13 | ```bash |
| 14 | export OPENROUTER_API_KEY=sk-or-v1-... |
| 15 | |
| 16 | python3 TOOL_DIR/scripts/generate_music.py \ |
| 17 | --prompt "Low rumbling tension drone, sub-bass swell, no melody, slowly building unease" \ |
| 18 | --download PROJECT_DIR/assets/sfx_drone.wav |
| 19 | ``` |
| 20 | |
| 21 | ## SFX prompting |
| 22 | |
| 23 | Describe a TEXTURE, not a song — no genre/BPM/lead/vocals. Examples: |
| 24 | |
| 25 | - `"low rumbling tension drone, sub-bass swell, no melody"` |
| 26 | - `"sharp glass-shatter texture, brittle high transients"` (foley — best-effort) |
| 27 | - `"distant wind and creaking-ice ambience, cold and hollow"` |
| 28 | |
| 29 | ## Flags |
| 30 | |
| 31 | | Flag | Default | Description | |
| 32 | |---|---|---| |
| 33 | | `--prompt` | required | Text prompt — describe the atmospheric texture / SFX (mood, materials, motion); avoid song structure | |
| 34 | | `--download` | required | Output audio file path | |
| 35 | | `--model` | `google/lyria-3-pro-preview` | Alt: `google/lyria-3-clip-preview` (shorter clips) | |
| 36 | |
| 37 | ## Pricing |
| 38 | |
| 39 | - `lyria-3-pro-preview`: $0.08 per call |
| 40 | |
| 41 | ## Notes |
| 42 | |
| 43 | - Request uses `POST /api/v1/chat/completions` with `modalities: ["audio","text"]`. |
| 44 | - Response parsing handles several shapes: `message.audio`, a content part with `type=audio`, or a `data:audio/...` URL embedded in the text content. |
| 45 | - Output format is typically WAV (48kHz stereo); the script saves whatever bytes the API returns — choose the extension to match. |