---
name: kryptonite-sound-design
description: Sound-design a video edit with Kryptonite — find meme sounds, SFX and reactions via the Kryptonite MCP server (or REST API), plan a cue sheet against the timeline, download the MP3s and mix them in with ffmpeg at exact timestamps. Use when the user asks to add sound effects, meme sounds, whooshes, "vine booms", reactions or a sound cue sheet to a video, reel, TikTok, Short, YouTube video or podcast clip.
---

# Kryptonite sound design

Kryptonite is a catalog of ~750 meme sounds, SFX and reactions built for agents. Below, `$KRYPTONITE_URL` is the site this file was downloaded from (the same origin as the MCP URL in your client config).

- **MCP (preferred):** `$KRYPTONITE_URL/api/mcp/mcp` (Streamable HTTP). Tools: `search_sounds`, `suggest_sounds_for_scene`, `get_sound`, `download_sound`, `list_categories`, `get_quota`. Prompt: `edit_with_sounds`.
- **REST fallback:** `GET /api/v1/sounds?q=…`, `GET /api/v1/sounds/{id}`, `GET /api/v1/sounds/{id}/download` (302 → MP3, or `?format=json`), `GET /api/v1/quota`. Spec: `/api/v1/openapi.json`.
- **Auth:** optional `Authorization: Bearer kr_live_…`. Fair-use limits on API/MCP calls (not DRM, file URLs are public): anonymous = 5 searches + 5 downloads per day; with a free key = 1000 + 300. If you get `quota_exceeded`, tell the user to create an account at `$KRYPTONITE_URL/signup` and a key at `$KRYPTONITE_URL/dashboard`. Don't retry in a loop.

## Workflow

1. **Understand the timeline.** Get the script, shot list or transcript with timestamps. If you have the video file, get its length and cut points: `ffprobe -v error -show_entries format=duration -of csv=p=0 video.mp4`, and scene cuts with `ffmpeg -i video.mp4 -vf "select='gt(scene,0.35)',showinfo" -an -f null - 2>&1 | grep pts_time`.
2. **Ask about licensing once.** Monetised, ad, client or brand work → use `license: "cc0"` (or `"commercial"` = CC0 + CC BY with attribution). Personal/meme edits → `"any"`. Sounds with licence `unverified` are community-sourced: rights belong to their owners, **personal non-commercial use only**.
3. **Plan cues.** Call `suggest_sounds_for_scene` once with the whole script (one beat per line, keep timestamps), plus `platform` and `mood`. It costs 1 search and returns an ordered cue sheet with placement hints and alternatives.
4. **Refine.** For weak or missing cues call `search_sounds` with short concrete queries (`whoosh`, `vine boom`, `bruh`, `ding`, `crowd laugh`, `record scratch`, `camera shutter`). Use `max_duration_ms` (e.g. 1000) for hits on cuts. `get_sound` is free for details.
5. **Show the cue sheet** before downloading: `timestamp | beat | sound (id) | placement | duration | licence`.
6. **Download** each final pick with `download_sound` (`format: "url"`), then `curl -L -o <filename> "<url>"`. Use `base64` only when you can't make HTTP requests (≤ 1.5 MB).
7. **Mix** with ffmpeg (recipes below), render, and **add credits**: paste each `attribution_text` into the description/credits.

## Editing rules of thumb

- One hit per beat. Avoid two meme sounds within ~1 s; for TikTok/Reels/Shorts aim for a hit every 2–4 s at most.
- Never cover a key line of dialogue. Punchline sounds go ~200 ms **after** the line.
- Transitions: start the whoosh 100–150 ms **before** the cut so it peaks on the first frame of the new shot.
- Reveals/impacts: frame-accurate on the hit; duck music ~6 dB.
- Awkward silence: cut the music entirely and let the sound (crickets, "bruh") carry it.
- Podcast/talking-head: subtle UI stingers, SFX ~6 dB under the voice.
- Loudness: SFX peaks around −3 dBFS; final mix ~−14 LUFS for social platforms.

## ffmpeg recipes

`adelay` takes milliseconds per channel (`1500|1500` = 1.5 s on L and R). `amix … normalize=0` keeps original levels (ffmpeg ≥ 5.1; on older builds drop it and raise volumes).

**One SFX at 1.5 s, keep the original audio:**

```bash
ffmpeg -i video.mp4 -i vine-boom.mp3 -filter_complex \
  "[1:a]adelay=1500|1500,volume=0.8[s1];[0:a][s1]amix=inputs=2:duration=first:normalize=0[a]" \
  -map 0:v -map "[a]" -c:v copy -c:a aac -b:a 192k out.mp4
```

**Several SFX at different timestamps:**

```bash
ffmpeg -i video.mp4 -i whoosh.mp3 -i bruh.mp3 -i ding.mp3 -filter_complex \
  "[1:a]adelay=2850|2850[s1]; \
   [2:a]adelay=4200|4200,volume=0.9[s2]; \
   [3:a]adelay=9100|9100,volume=0.7[s3]; \
   [0:a][s1][s2][s3]amix=inputs=4:duration=first:normalize=0[a]" \
  -map 0:v -map "[a]" -c:v copy -c:a aac -b:a 192k out.mp4
```

**Duck the original audio while an SFX plays (sidechain):**

```bash
ffmpeg -i video.mp4 -i boom.mp3 -filter_complex \
  "[1:a]adelay=3000|3000,asplit=2[sfx][key]; \
   [0:a][key]sidechaincompress=threshold=0.05:ratio=8:attack=5:release=250[duck]; \
   [duck][sfx]amix=inputs=2:duration=first:normalize=0[a]" \
  -map 0:v -map "[a]" -c:v copy -c:a aac out.mp4
```

**Video has no audio track:** add a silent bed as input 1.

```bash
ffmpeg -i video.mp4 -f lavfi -i anullsrc=r=48000:cl=stereo -i sfx.mp3 -filter_complex \
  "[2:a]adelay=1200|1200[s];[1:a][s]amix=inputs=2:duration=first:normalize=0[a]" \
  -map 0:v -map "[a]" -c:v copy -c:a aac -shortest out.mp4
```

**Trim a long sound / fade it out:**

```bash
ffmpeg -i applause.mp3 -t 1.8 -af "afade=t=out:st=1.3:d=0.5" applause-short.mp3
```

**Timestamp → ms:** `0:03.40` → 3400; `1:12` → 72000. At 30 fps, frame N → `N / 30 * 1000` ms.

## Output checklist

- [ ] Cue sheet shown to the user and confirmed (or the user asked you to just do it)
- [ ] Every sound came from Kryptonite results (never invent ids)
- [ ] Licences match the use; `unverified` flagged as personal use only
- [ ] ffmpeg command(s) and rendered file path
- [ ] Credits block with every `attribution_text`
