Skip to content
Back to skills

Prepare Song

ASecurity

This skill should be used when the user wants a song's arranging inputs made with pianoize from a YouTube link or an audio file, e.g. "prepare this song", "get the melody for this link", "prepare it with the cover", "download and transcribe this song", "set up tsumugi". Downloads a link's audio with yt-dlp, has the local pianoize CLI install tsumugi once, transcribe the song with tsumugi, take its melody where it has one and, asked to, generate its piano cover with tsumugi-piano-cover, report...

  • 6 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
ai-agentspythongoshellgit

Works with

  • claude code
  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 5, 2026

npx -y skills add zeikar/pianoize --skill prepare-song --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prepare Song?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Prepare Song
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/zeikar-prepare-song/badge)](https://www.skillsdirectory.com/skills/zeikar-prepare-song)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: prepare-song
description: This skill should be used when the user wants a song's arranging inputs made with pianoize from a YouTube link or an audio file, e.g. "prepare this song", "get the melody for this link", "prepare it with the cover", "download and transcribe this song", "set up tsumugi". Downloads a link's audio with yt-dlp, has the local pianoize CLI install tsumugi once, transcribe the song with tsumugi, take its melody where it has one and, asked to, generate its piano cover with tsumugi-piano-cover, reports what it wrote, and offers the files to an arranging skill. Not for arranging (that is arrange-vocal, arrange-transcription or arrange-cover), or for rendering the audio or the falling-notes video.
---

# Prepare a song for arranging

pianoize arranges a song from files made from its recording: tsumugi's transcription of the band, `transcription.mid`, and the same notes on a steady tempo grid, `source.mid`; its sung melody, `melody.mid`, where the song has one; `stems.npz`, a table of what the recording's separated stems sound over time, which the transcription skills read to check a transcribed line against the audio; and, when the user asks for the cover's arrangement, tsumugi-piano-cover's piano cover, `cover.mid`. This skill makes them. Given a link, you download the audio. `pianoize setup` installs tsumugi once, pinned, outside the repository. `pianoize prepare` decodes the audio, transcribes it, fits the grid, takes the melody, measures the stems into the table and, asked to, generates the cover.

pianoize's commands never call an LLM. You run them, wait for them and report what they wrote; nothing here asks you to judge the music.

## Rules

- **Audio never leaves the machine.** The download and the models run here. Upload nothing.
- **Never commit, and never paste song content into the repository.** The audio and every file made from it stay in `<song>` under `work/`, which is never committed. The song's title, link, track list and note counts go into no docs, tests, code, commit messages or issues.
- **Install nothing on `PATH`.** yt-dlp runs from uv's cache through `uvx`, and `pianoize setup` installs into its own home. Never install a tool yourself: tell the user what is missing, and stop.
- **An existing `transcription.mid` is kept.** Each transcription is one draw, so `prepare` reuses it, as it reuses every output it finds. Redoing any step is the user's call: only when they ask, delete that output and the ones made from it, as "Reusing outputs" in the docs lists, and run `prepare` again.
- **MIT by default; non-commercial weights only when asked.** Without options, `setup` and `prepare` run no weights with non-commercial terms, so what they make carries no model's terms (the song's own rights still apply). Two options add weights under CC BY-NC 4.0 (attribution, non-commercial use only), each to both commands:
  - `--sheetsage`: SheetSage2-Refined takes the beats and the sung melody, more accurately than tsumugi's own trackers. Only when the user asks for it, e.g. "the more accurate transcription", "with SheetSage".
  - `--cover`: tsumugi-piano-cover generates the piano cover, for `arrange-cover`. Only when the user asks for the cover's arrangement.

  `setup` prints an option's terms before its download: relay them, and that what is made with it is treated as non-commercial.
- **One transcription per song.** A `<song>` transcribed with `--sheetsage` stays so, and one without stays without: `prepare` refuses to reuse it the other way. To switch, prepare into another `<song>`.

## Inputs

Ask the user for any input that is missing and stop until you have it.

- `<link>`, a YouTube link, or `<audio>`, an audio file: wav, flac, ogg or mp3. Convert any other format, an m4a for one, locally first: `ffmpeg -i '<file>' '<song>/<file stem>.flac'`.
- `<song>`: this recording's directory, `work/<name>/`, with a name the user gives. Create it with `mkdir -p`. `prepare` reuses any of its outputs it finds there, by name alone, so a directory that holds another recording's files would mix two songs: ask for another.

Single-quote every path in a command, writing a `'` inside it as `'\''`: song file names carry spaces, brackets and other characters the shell would read.

## Running pianoize

- **Plugin root:** `${CLAUDE_PLUGIN_ROOT}`. If that is a directory with a `pyproject.toml` in it, this skill runs from the pianoize Claude Code plugin, and that directory is the plugin's own copy of pianoize: run `uv run --project "<plugin root>" pianoize <command> …` from the current directory. Its first run builds the environment, so allow a few minutes. Otherwise (empty, still a `${…}` placeholder, or no `pyproject.toml` there) there is no plugin root: in a pianoize checkout, run `uv run pianoize <command> …` there; anywhere else, tell the user to install the pianoize plugin, and stop.
- Without `uv` on `PATH`, tell the user to install it (https://docs.astral.sh/uv/) and stop.
- Below, `pianoize <command> …` stands for that command line.
- **The docs:** `<plugin root>/docs/preparing.md`, or `docs/preparing.md` in the checkout, documents both commands: what setup installs and where, `prepare`'s files, its reuse, its errors and its summary. `pianoize <command> --help` lists a command's options.
- **Errors.** A failing command prints `error: …` and exits 1, most naming the step, and the tool where one failed: `tsumugi transcribe failed (1): RuntimeError: …; log: …/transcribe.log`. Show the user the message and, where it names a log, the log's last lines (`tail -n 20 '<log>'`), and stop. A missing tool, `git not found on PATH` or `uv not found on PATH`, is the user's to install: tell them, and don't work around it. Exit 2 is a usage error: show its message. An error saying the tools are not installed under the pianoize home means step 3 didn't finish: run it.

## Workflow

1. **Check the tools,** for a link and a file alike, before anything downloads or installs:
   - `command -v uv`: setup, prepare and yt-dlp all run through it;
   - `command -v git`: setup clones tsumugi and tsumugi-piano-cover with it;
   - `command -v ffmpeg`: yt-dlp converts the audio with it, and tsumugi reads the audio through torchcodec, which loads FFmpeg's libraries. On macOS, Homebrew's ffmpeg provides both, and the libraries must be Homebrew's, since the worker looks only there: `ls /opt/homebrew/lib/libavutil*.dylib`.

   Without any of them, tell the user what to install (uv: https://docs.astral.sh/uv/; git: the system's; ffmpeg: `brew install ffmpeg` on macOS) and stop, installing nothing.
2. **Get the audio.** For a `<link>`, follow **`references/download.md`**: it leaves the audio in `<song>` and gives you `<audio>`. For a file, use it as `<audio>` where it is.
3. **Set up:** `pianoize setup`, with the options the user asked for (see Rules). Run it in the background and wait for it to end; its progress is the background task's output. The first run clones two repositories, builds tsumugi's torch environment and downloads about 850 MB of tsumugi's checkpoints, which takes minutes; `--sheetsage` adds about 2.7 GB, and `--cover` a second torch environment and about 750 MB. uv may also download a Python 3.12 into its own directory. Tell the user in one line before it starts, and go on without waiting for a reply. With an option it prints that option's terms before the download: relay them (see Rules). Later runs check the install, hash the checkpoints and download nothing. A setup that failed or was stopped is finished by running it again, once the user has fixed the cause.
4. **Prepare:** `pianoize prepare '<audio>' -o '<song>'`, with the same options, in the background. It decodes the audio to `song.wav`, transcribes it into `transcription.mid`, writes `source.mid` from it on a steady tempo grid, takes `melody.mid` from that, with `--cover` generates `cover.mid`, and last separates the stems and measures them into `stems.npz`. Its `tempo grid:` line says whether the grid was applied or tsumugi's tempo map kept, and why. For an instrumental, which has no `melody` track, `melody.mid` is left out; when the user names the instrument that carries the lead, run `pianoize prepare '<audio>' -o '<song>' --melody-track '<track>'`, a track of `source.mid`. On an Apple-silicon Mac the transcription takes about twice the song's length, the cover about a third and the stem table about as long as the song; tsumugi on the CPU takes longer. Tell the user the expected time once. Progress is in `<song>/transcribe.log`, then, with `--cover`, `<song>/generate.log`, then `<song>/stems.log`: check the current one with `tail -n 5 '<log>'` now and then, not continuously. A file `prepare` finds in `<song>` is reused (`reusing …`), so after a failure or a stop, the same command picks up where it stopped. A song prepared before the table gets it by running the same command again: only the stem calls run. A stopped run (Ctrl-C or `kill`) exits 130 with no message, keeping the outputs it finished.
5. **Report** the `tempo grid:` line and the summary it prints last (the song's length, `source.mid`'s tracks with their notes, `melody.mid`'s notes or `none` on an instrumental, `cover.mid`'s notes and length when it made one, and `stems.npz`'s length and stems), and the files in `<song>`.
6. **Hand off, without starting the arrangement.** Ask the user which path to take, recommending the song's default, and stop until they answer. A song is an instrumental when it has no sung melody: the summary says `melody.mid: none`, or `--melody-track` took `melody.mid` from an instrument.
   - **`../arrange-vocal/SKILL.md`**, the default for a sung song: `<song>/source.mid` and `<song>/melody.mid`, and no cover.
   - **`../arrange-transcription/SKILL.md`**, the default for an instrumental: `<song>/source.mid` and, when `prepare` wrote one, `<song>/melody.mid`, and no cover.
   - **`../arrange-cover/SKILL.md`**, when the user asks for the cover's arrangement: `<song>/cover.mid` as its `<cover>`, which a song prepared without `--cover` gets by `setup --cover` and the same `prepare` command with `--cover` added, `<song>/melody.mid` as `<melody>` when `prepare` wrote one, and `<song>/source.mid` as `<source>`. Without `melody.mid`, it runs without `<melody>`.

   The first two read no cover, so their terms are the transcription's: MIT, or non-commercial where it was made with `--sheetsage`. And where the grid was not applied, the cover model builds its beats from tsumugi's tempo map, so where the beat tracking went wrong, bars at half speed or squeezed, the cover's rhythm bends with it, while the transcription's notes stay timed from the audio (pianoize's `docs/decisions.md`, "The transcription-only arrangement").

   `<song>/stems.npz` goes to the first two as well, for their audio check; the cover path doesn't read it.

   Give them the chosen skill's inputs. Arranging starts when they ask for it.

## Output files

All in `<song>`:

| file | written by | holds |
| --- | --- | --- |
| `<title> [<id>].mp3` | yt-dlp, for a link | the downloaded audio, `<audio>` |
| `song.wav` | `prepare` | the audio as a 16-bit WAV at its own rate and channels |
| `transcription.mid` | `prepare`, with tsumugi | the band's transcription as tsumugi wrote it: a track per instrument, the drums among them, a tempo map, chord markers and the lead vocal, `melody` |
| `source.mid` | `prepare`, from `transcription.mid` | the transcription on a steady tempo grid, or a byte copy of it where the grid was not applied |
| `melody.mid` | `prepare` | the `melody` track, or the track `--melody-track` names, on `source.mid`'s tempo changes and time signatures; none on an instrumental without it |
| `cover.mid` | `prepare --cover`, with tsumugi-piano-cover | the piano cover generated from `source.mid`, seed 0 |
| `transcribe.log` | `prepare` | tsumugi's output: its progress, and its error after a failure; it names SheetSage2-Refined where `--sheetsage` ran it, which is what the video's terms are read from |
| `stems.npz` | `prepare`, with tsumugi's stem splitter | the stem table: per frame, the vocals' pitch and level and a level per semitone for the guitar, other and piano stems; the stems themselves are not kept |
| `generate.log` | `prepare --cover` | the generator's output |
| `stems.log` | `prepare` | the stem splitter's and the table worker's output |

## Additional resources

- **`references/download.md`:** downloading a link's audio with yt-dlp through `uvx`, what it prints, a playlist link, and its failures.
- **pianoize's `docs/preparing.md`** (see "Running pianoize"): what setup installs and where, its pins and how to remove it, and `prepare`'s files, reuse, redoing a step, errors and summary.

Files in this skill

  • SKILL.md10.4 KB
  • references/download.md2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.