agentleFS
brandonbryant12brandonbryant12/clearframe/skills/lyria-music/SKILL.md

lyria-music

Skill1 starsChanged 25 days agoMITView on GitHub

Score a video with Google Lyria via the Gemini API — lyria-3.5 (full instrumental beds, duration and timestamped structure steered by prompt) or lyria-3-clip-preview (30 s), plus experimental Lyria RealTime (WebSocket, exact length/BPM). Exact contracts, prompt recipes for calm professional beds, structure derived from the edit, mixing levels, pricing. Use when a ClearFrame film longer than about 20 seconds needs music.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use it when you need an exact BPM or scale, or a bed longer than a song.

    line 52
  2. Very specific:

    If the film has no narration, raise volume to about 0.5 and let the music carry the rhythm.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Lyria music

Music gives a professional film warmth and pace, if it stays under the voice. One bed per film costs $0.08.

Use it

"music": {
  "model": "lyria-3.5",
  "prompt": "Minimal modern ambient, soft felt piano, warm analog pads, a very light pulse",
  "bpm": 80, "key": "D major", "volume": 0.2,
  "arc": { "The forecast": "Intro: a single felt-piano figure over a soft pad.", "Recap": "Resolve on a sustained chord." }
}
clearframe music <dir> --draft   # free synthesized pad, for timing and mix checks
clearframe plan <dir>            # ≈ $0.08
clearframe music <dir>           # → assets/music/bed.mp3 (+ bed.json with prompt and model notes)
node packages/engine/dist/skills/lyria-music/scripts/music.mjs --style "…" --bpm 80 --key "D major" --seconds 60 --section "0:00-0:08|sparse intro" --dry-run

The engine writes the structure for you. It groups beats by chapter, converts them to timestamps ([0:00 - 0:09] Intro: …), asks for about the film's length plus 2 s, adds "Instrumental only, no vocals" and a mix note ("sits under a spoken voiceover"), and asks for a clean ending on a sustained chord. Override per chapter with music.arc or fully with music.sections.

Contract: Lyria 3.5 / 3 Clip (MP3 path checked 2026-09-28)

POST https://generativelanguage.googleapis.com/v1beta/interactions with header x-goog-api-key

{ "model": "lyria-3.5",
  "input": "Minimal modern ambient, 80 BPM, in D major.\nInstrumental only, no vocals.\nDuration: about 48 seconds.\n[0:00 - 0:09] Intro: …\nEnding: end cleanly on a sustained chord, no fade-out.",
  "response_format": { "type": "audio" } }
  • The response holds steps[type="model_output"].content[]: a text block (structure or lyrics) and an audio block { mime_type, data }.
  • Output is 44.1 kHz stereo. Use the MP3 default without a MIME override. The Google music guide mentions WAV in prose but its request examples omit mime_type; WAV requests have failed in this project. The script accepts --format mp3 only. Convert locally with FFmpeg if WAV is needed; changing a filename does not convert audio.
  • Save using the response MIME type (audio/mpeg and audio/mp3 both mean .mp3). Unknown formats fail explicitly. Draft music and RealTime still produce WAV locally.
  • bed.json records the active generated file. Cache reuse requires both matching musical intent and a nonempty audio file; clearframe plan uses the same check. A format-default change alone does not regenerate an existing paid bed.
  • input may also be an array with up to 10 images (mood references).
  • Duration is steered in the prompt ("about 60 seconds") and by timestamped sections. lyria-3-clip-preview is always 30 s.
  • There is no negative prompt and no seed, and identical calls vary. Everything is SynthID-watermarked. Named-artist prompts are blocked.
ModelOutputPrice
lyria-3.5 (default)full track, up to a couple of minutes$0.08 / song
lyria-3-clip-preview30 s clip; good for shorts and auditioning a style$0.04 / clip
lyria-realtime-expendless steerable stream (experimental)not listed

Lyria RealTime (experimental)

Use it when you need an exact BPM or scale, or a bed longer than a song. Set "model": "lyria-realtime" with weightedPrompts, bpm, density, brightness and scale, or run scripts/realtime.mjs.

  • Endpoint: wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateMusic
  • Protocol: send {setup:{model:"models/lyria-realtime-exp"}} and wait for setupComplete. Then send {clientContent:{weightedPrompts:[…]}}, {musicGenerationConfig:{bpm, density, brightness, scale, guidance, …}} and {playbackControl:"PLAY"}. Collect serverContent.audioChunks[].data: raw s16le PCM, 48 kHz, stereo.
  • Each client message carries exactly one field. A config message replaces the whole config, and bpm or scale changes need RESET_CONTEXT.
  • Unverified in the docs: raw-socket API-key auth (?key=, the Live API convention) and a v1beta URL. Prefer Lyria 3.5 unless you need RealTime's control.

Prompt recipes

Lead with genre, then instruments, tempo, key and mood. Keep it spare: the voice is the lead.

FilmPrompt coreBPM / key
Calm explainer (default)Minimal modern ambient, soft felt piano, warm analog pads, very light pulse76–84 · D major
Confident updateUnderstated electronic, muted plucked synth arpeggio, soft kick on quarters, warm sub bass96–104 · A minor
Sober, reflectiveSlow cinematic strings and piano, sparse, lots of space, no percussion60–70 · C minor
Restrained launchBright minimal house groove, filtered chords, soft claps, restrained energy112–118 · F major
Technical deep-diveMinimal techno pulse, soft Rhodes, gentle glitch-free texture, steady and focused90–100 · E minor

Useful Lyria vocabulary: Chillout, Minimal Techno, Deep House, Synthpop, Trip Hop, Orchestral Score, Piano Ballad. Instruments: Rhodes Piano, Synth Pads, Moog Oscillations, Cello, Harp, Marimba, Vibraphone, Kalimba, Precision Bass. Moods: Ambient, Chill, Dreamy, Relaxed, Upbeat, Triumphant (sparingly), Ethereal.

Mixing (the engine does this)

  • The bed sits at volume 0.18–0.22 (about −14 dB) and is sidechain-ducked under the narration by a further ~4–6 dB.
  • 1.5 s fade in, 2.5 s fade out, loudness-normalised master (−14 LUFS web, −16 internal via mix.loudness).
  • If the film has no narration, raise volume to about 0.5 and let the music carry the rhythm; cut on bars (60 / bpm × 4 s).
  • Short films: on 2026-10-04, Lyria returned 60–70 s songs for a 20 s request and put the timestamped drop about 17 s late, though it honoured the BPM. Splice bar-aligned pieces (open + the bars before the drop) rather than re-rolling. See docs/google-generation-field-notes.md.
  • Land the drop. A composed bed's sections are a request, not a measurement. Run beatmap DIR on the MP3 that came back: it measures the tempo (listing half and double, since a 74 BPM half-time track reads as 148) and the drop (the bass jumping in 20 ms windows). Then music.drop: {"beat": "title"} (optionally at: "word:now", or song: 12.96 to override the measurement) starts the track so the drop plays on that beat. A drop later in the film than in the song delays the song's start. qa DIR confirms it is heard there in the final mix.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.