prepare-song
Skill4 starsChanged 46 days agoMITView on GitHub
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 cover and melody for this link", "download and transcribe this song", "set up tsumugi". Downloads a link's audio with yt-dlp, has the local pianoize CLI install tsumugi and tsumugi-piano-cover once, transcribe the song with tsumugi, take its melody where it has one and generate its 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), for polishing a cover (that is polish-cover), or for rendering the audio or the falling-notes video.
- Installs packages
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- arrange-coverSkill
- arrange-transcriptionSkill
- arrange-vocalSkill
- make-videoSkill
- polish-coverSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Ask the user for any input that is missing and stop until you have it.
- Distinctive: line 49
Hand off, without starting the arrangement: Ask the user which path to take, recommending the song's default, and stop until they answer.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
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; tsumugi-piano-cover's piano cover, cover.mid; and 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. This skill makes them. Given a link, you download the audio. pianoize setup installs the two models once, pinned, outside the repository. pianoize prepare decodes the audio, transcribes it, fits the grid, takes the melody, generates the cover and measures the stems into the table.
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>underwork/, 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 throughuvx, andpianoize setupinstalls into its own home. Never install a tool yourself: tell the user what is missing, and stop. - An existing
transcription.midis kept. Each transcription is one draw, sopreparereuses 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 runprepareagain. - Relay the terms. The first
pianoize setupprints the terms of tsumugi-piano-cover's weights before it downloads them: CC BY-NC 4.0, attribution, non-commercial use only. Tell the user, and that the cover, and anything arranged from it, is treated as non-commercial.
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 withmkdir -p.preparereuses 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 apyproject.tomlin it, this skill runs from the pianoize Claude Code plugin, and that directory is the plugin's own copy of pianoize: runuv 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 nopyproject.tomlthere) there is no plugin root: in a pianoize checkout, runuv run pianoize <command> …there; anywhere else, tell the user to install the pianoize plugin, and stop. - Without
uvonPATH, 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, ordocs/preparing.mdin the checkout, documents both commands: what setup installs and where,prepare's files, its reuse, its errors and its summary.pianoize <command> --helplists 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 PATHoruv 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
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 the two models 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 ffmpegon macOS) and stop, installing nothing.- Get the audio. For a
<link>, followreferences/download.md: it leaves the audio in<song>and gives you<audio>. For a file, use it as<audio>where it is. - Set up:
pianoize setup. 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 two torch environments and downloads about 1.6 GB of weights, tsumugi's checkpoints and the cover's, which takes minutes. 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. It prints the cover weights' terms before their download: relay them (see Rules). Later runs check the install, hash tsumugi's checkpoints and download nothing. A setup that failed or was stopped is finished by running it again, once the user has fixed the cause. - Prepare:
pianoize prepare '<audio>' -o '<song>', in the background. It decodes the audio tosong.wav, transcribes it intotranscription.mid, writessource.midfrom it on a steady tempo grid, takesmelody.midfrom that and generatescover.mid, and last separates the stems and measures them intostems.npz. Itstempo grid:line says whether the grid was applied or tsumugi's tempo map kept, and why. For an instrumental, which has nomelodytrack,melody.midis left out; when the user names the instrument that carries the lead, runpianoize prepare '<audio>' -o '<song>' --melody-track '<track>', a track ofsource.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<song>/generate.log, then<song>/stems.log: check the current one withtail -n 5 '<log>'now and then, not continuously. A filepreparefinds 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 orkill) exits 130 with no message, keeping the outputs it finished. - 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 ornoneon an instrumental,cover.mid's notes and length, andstems.npz's length and stems), and the files in<song>. 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-tracktookmelody.midfrom an instrument.../arrange-vocal/SKILL.md, the default for a sung song:<song>/source.midand<song>/melody.mid, and no cover.../arrange-transcription/SKILL.md, the default for an instrumental:<song>/source.midand, whenpreparewrote one,<song>/melody.mid, and no cover.../arrange-cover/SKILL.md, when the user asks for the cover's arrangement:<song>/cover.midas its<cover>,<song>/melody.midas<melody>whenpreparewrote one, and<song>/source.midas<source>. Withoutmelody.mid, it runs without<melody>.
The first two read no cover, so they carry none of its CC BY-NC terms. 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.npzgoes 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, 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 |
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 | 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 throughuvx, 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, andprepare's files, reuse, redoing a step, errors and summary.
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
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.

