Skip to content
Back to skills

Mc Noteblock Schematic

ASecurity

Convert a song (YouTube URL, audio file or MIDI file) into a playable Minecraft .litematic note block schematic, plus a preview image and a preview WAV. Looks for a MIDI version of the song first (preferred), and transcribes the recording only as a fallback. Use whenever the user asks to turn a song, YouTube link, audio or MIDI file into a Minecraft note block build, schematic, or .litematic file.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 1, 2026
developmentpythongojavabashdebugginggitapi

Works with

  • claude code
  • terminal
  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

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

Scanned December 1, 2026

npx -y skills add PeanutGT/NutsSkills --skill mc-noteblock-schematic --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mc Noteblock Schematic?

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

Security grade badge for Mc Noteblock Schematic
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/peanutgt-mc-noteblock-schematic/badge)](https://www.skillsdirectory.com/skills/peanutgt-mc-noteblock-schematic)

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: mc-noteblock-schematic
description: Convert a song (YouTube URL, audio file or MIDI file) into a playable Minecraft .litematic note block schematic, plus a preview image and a preview WAV. Looks for a MIDI version of the song first (preferred), and transcribes the recording only as a fallback. Use whenever the user asks to turn a song, YouTube link, audio or MIDI file into a Minecraft note block build, schematic, or .litematic file.
allowed-tools: Bash, Read, Write, Edit, Glob, WebSearch, WebFetch, AskUserQuestion
license: Apache-2.0
compatibility: Runs locally (Claude Code or Codex) with Python 3.10 or 3.11 (tested on 3.11), ffmpeg for audio input, and about 1.5 GB of Python packages (torch, TensorFlow, Demucs). Not for the Claude.ai sandbox.
metadata:
  version: "1.0.0"
  author: PeanutGT
  repository: https://github.com/PeanutGT/NutsSkills
---

# Minecraft Note Block Schematic

**Core rule:** Always run the bundled scripts with the skill's own `.venv` interpreter. Do not rewrite the conversion logic or install packages into the user's global Python.

**Source priority:** a MIDI file first, the recording second. MIDI builds are clearly better (exact notes, real melody track), so always search for one, and fall back to transcribing the recording only when no usable MIDI is found or the user says so.

**Goal:** a *clean, recognizable* note block version of the song, not a note-for-note copy. The melody must stay clear on top; chords and harmony voices are simplified to support it. **Drums are never simplified:** every kick, snare and hi-hat hit is kept.

`SKILL_DIR` below means the folder that contains this SKILL.md (for example `~/.claude/skills/mc-noteblock-schematic`, or the plugin's folder when installed as a plugin). `<venv python>` is `SKILL_DIR/.venv/Scripts/python.exe` on Windows and `SKILL_DIR/.venv/bin/python` on macOS and Linux.

## Workflow

### 1. Parse the input
From the user's request, extract:
- **Input** (required): a YouTube URL, a local audio file (`.wav`, `.mp3`, `.flac`, ...), or a `.mid` / `.midi` file. If none was given, **ask the user for one and stop**. Do not guess.
- **Output name** (optional): pass as `--output`. Default: `<song_name>.litematic` in the current working directory.
- **Options** (optional): see [Options](#options).

### 2. Check the isolated environment
1. **Install or update the dependencies.** If the venv interpreter is missing, create the venv first. Then run the pip install every time `requirements.txt` is newer than the venv, or when an import fails. The first install downloads torch, TensorFlow and Demucs (about 1.5 GB), so use a 10-minute timeout. `beat_this` installs from GitHub; if that fails, the pipeline still works with librosa beat tracking.
   ```bash
   python -m venv "SKILL_DIR/.venv"     # only if it is missing; use python3 on macOS/Linux
   "<venv python>" -m pip install -r "SKILL_DIR/requirements.txt"
   ```
2. **Check ffmpeg (YouTube and audio input only).** Run `ffmpeg -version`. If it is missing, tell the user how to install it and stop: Windows `winget install Gyan.FFmpeg`, macOS `brew install ffmpeg`, Debian/Ubuntu `sudo apt install ffmpeg`.

### 3. Find a MIDI first (YouTube or audio input only)
A good MIDI file has exact notes and a real melody track, so it gives a much better build than transcribing a recording. This step is the default: do it **without asking whether to search**. Skip it only when the input already is a `.mid` file, or the user explicitly asked to use the recording ("from the audio", "no MIDI").

1. **Tell the user** in one line that you are looking for a MIDI version first.
2. **Get the song's name and length** without downloading audio:
   ```bash
   "<venv python>" "SKILL_DIR/scripts/midi_tools.py" info "<youtube url>"
   ```
   For a local audio file, use its file name and ask the user for the title if it is unclear.
3. **Search.** WebSearch for `<artist> <title> midi`, preferring sites that host `.mid` files: bitmidi.com, freemidi.org, midiworld.com, onlinesequencer.net. Clean the title first: drop "(Official Music Video)", channel names and the like.
4. **Let the user choose.** Show up to 3 candidates: page title, site, what is known about it (tracks, length), and the link. Prefer multi-track arrangements over solo piano versions: separate tracks give a cleaner melody. Use AskUserQuestion with one option per candidate plus *None of these, use the recording*. **Never download a file the user did not pick.** If the search finds nothing, say so and continue with the recording.
5. **Download the picked file** into a new folder `midi/` in the working directory. Use the page's direct `.mid` link (WebFetch the page to find it) and limit the size:
   ```bash
   curl -L --max-filesize 5000000 -o "midi/<song>.mid" "<direct .mid link>"
   ```
   If the site needs a login, a captcha or a button click, or refuses automated access (MIDIShow does), don't work around it. Give the user the link, ask them to download it themselves and send the file path, and offer *use the recording instead* as the alternative.
6. **Check it before using it:**
   ```bash
   "<venv python>" "SKILL_DIR/scripts/midi_tools.py" check "midi/<song>.mid" --expect-seconds <duration from step 2>
   ```
   - `OK` (exit 0): use the MIDI as the input in step 4.
   - `WARN` (exit 1): the length is off by more than 15%. Tell the user (it is often a fan cover that skips the intro or a section) and ask: use it anyway (usually still the better build), or use the recording.
   - `FAIL` (exit 2): tell the user why, and go back to the candidate list or use the recording.
   The track table shows which track becomes the melody. If the user knows it's the wrong one, pass `--lead-track N`.

### 4. Run the pipeline
Run it from the user's current working directory, so the files land there:
```bash
"<venv python>" "SKILL_DIR/scripts/main.py" --input "<url | audio | .mid>" [options]
```
- **Timing:** Demucs separation runs on the CPU, so a 3 to 4 minute song takes several minutes. MIDI input takes seconds. Use a 10-minute timeout, or run it in the background. Never start a second heavy run while one is going, and don't run test jobs in parallel: that is what freezes the machine.
- **Stem cache:** the stems of the last 3 audio inputs are kept in `~/.cache/mc-noteblock-schematic/stems`, so re-running the same song with other options skips the download and Demucs.
- **Model download:** the first audio run also downloads the Demucs model and the Beat This! checkpoint, about 80 MB each.
- **Output:** `<song_name>.litematic`, `<song_name>_preview.png`, and `<song_name>_preview.wav` (exactly what the build plays, with the real note block sounds when Minecraft Java is installed; the `Listen:` line says which sounds were used).
- **Errors:** a non-zero exit code means it failed. Report the `error:` line instead of claiming success.

### 5. Report the results
Show the user, from the script output:

| Item | Value |
|---|---|
| Source | the MIDI file (and which track is the melody) or the recording |
| Notes per part | lead, counter-melody, choir, chords, bass, kick / snare / hi-hat / other percussion: extracted / placed. Fewer placed than extracted drum hits means layered sounds on the same instant (e.g. snare + clap), which one note block plays as one hit. |
| Analysis | key and chord progression |
| Bounding box | X × Y × Z, and which deck each part is on |
| Start button | X, Y, Z from the schematic corner |
| Tempo | detected BPM, locked BPM, ticks per beat, speed change |
| Duration | seconds and redstone ticks (1 tick = 0.1 s) |
| Note blocks | total, by instrument |
| Files | the `.litematic`, `_preview.png` and `_preview.wav` paths |

- **Preview:** open `_preview.png` with Read so you can describe it. Ask the user to listen to `_preview.wav` before building: it has the build's exact notes and timing, with the real note block sounds when Minecraft Java is installed.
- **Warnings:** mention any dropped notes, warnings, or an "ambiguous" key.
- **Usage advice:** load the file with Litematica on flat ground with open space above. The start is the stone button on the lapis block at the top of the build, next to the sea lantern. Press it and walk along with the playing column: note blocks are only audible within about 48 blocks.

## Options
| Option | Effect |
|---|---|
| `--full` | Denser arrangement: up to 3 harmony voices and weaker chord hits too. The default is the clean version. Drums are complete either way. |
| `--lead-track N` | MIDI input: use track N (from the track table) as the melody. |
| `--raw` | Play every transcribed or MIDI note as is, with no arrangement. Busy; for comparison only. |
| `--polyphony N` | Distinct notes per tick, 1 to 24, default 12. Lower it if the result is busy. |
| `--ticks-per-beat N` | Force the beat length, 2 to 16 ticks (6 = 100 BPM, 5 = 120 BPM, 4 = 150 BPM). Use it when the detected tempo is wrong. |
| `--speed S` | Playback speed multiplier. With the tempo lock it nudges the target tempo before rounding. |
| `--transpose T` | Shift in semitones, for example `-12`. |
| `--no-separate` | Skip stem separation. Faster, but finds no drums. Only when the user asks for speed. |
| `--no-tempo-lock` | Round raw note times instead of locking beats to whole ticks. Only for songs with free timing. |
| `--no-emphasis` | One note block per note (by default the melody gets 3 identical blocks, bass and kick 2). |
| `--mc-assets PATH` | Minecraft Java `assets` folder for the preview's note block sounds, if it isn't found automatically. |
| `--threads N` | CPU threads for the models. Default is half the cores, always at below-normal priority. Lower it if the PC slows down. |

## How the pipeline works
For debugging only. Every module has a header docstring with the details.

| Stage | File | Does |
|---|---|---|
| 0 | `midi_tools.py` | `info`: video title, artist and length without downloading. `check`: validates a MIDI file and prints its track table. |
| 1 | `stem_separator.py` | Downloads or decodes the audio and splits it into vocals, other, bass and drums with Demucs `htdemucs`, with a stem cache. MIDI input skips this stage. |
| 2 | `tempo.py` | Beat grid from Beat This! (or librosa) or the MIDI tempo map, refined to one constant tempo when the song has one. Picks a whole number of ticks per beat, preferring one divisible by 4 when that changes the tempo by 5% or less. |
| 2 | `arranger.py` | Recordings. **Key**: chroma with Krumhansl profiles, used only when it's clear. **Chords**: beat-synced chroma, triad templates and a Viterbi smoother, played as 3-note guitar voicings on the accompaniment's strong attacks. **Lead**: CREPE on the vocals, or the synth top line where nobody sings. **Counter-melody**: that synth line while someone sings ("bit"). **Choir**: other simultaneous melody voices, kept below the lead. **Bass**: one note at a time, re-triggered on the bass stem's attacks. Drums from `extractor.py`. Notes are cut short instead of dropped, so off-beat 16ths survive. The `Style` (CLEAN or FULL) sets choir voices and the chord hit threshold; drums are always complete. |
| 2 | `midi_arranger.py` | MIDI files, same parts and style: the most melody-like track is the lead (mostly single notes, in the C4 to C6 range, many notes, playing through most of the song). Where the lead track rests for 2 s or more, the track playing highest there fills in the melody (a piano solo, or the counter-melody taking over). The next melody-like track is the counter-melody, unless it only doubles the lead; GM bass programs (or the lowest track) are the bass, and all other tracks become chords. Drums keep every hit: toms, tambourine and crashes get their own pitches on the bass drum, hi-hat and snare sounds. Notes are exact, so they are never snapped. MIDI files are read through `midi_io.py`, which fixes tempo events stored outside the first track. |
| 2 | `extractor.py` | Drum onset classifier, and the `--raw` and `--no-separate` paths. |
| 3 | `quantizer.py` | Grid positions to redstone ticks, routes parts to instruments, caps notes per part and tick, and adds the emphasis copies. |
| 4 | `schematic_builder.py` | One deck per part, stacked (drums, bass, chords, choir, counter-melody, lead; only the parts that have notes). All spines come from the same tick list, so they run in lockstep and every part sounds from the same column. The button on top feeds lower decks through a dust staircase with a refresh repeater per deck; each deck's lead-in is shortened by its feed delay. The exported file is reloaded and verified. |
| 5 | `preview_renderer.py` | A 2000×1300 dark PNG: one top-down blueprint per deck with the START marked, and a part-coloured piano roll with drum lanes. |
| 6 | `audio_renderer.py` | `_preview.wav` at the build's exact ticks and pitches, using the **real note block sounds from the user's own Minecraft Java installation** (found through `.minecraft/assets` and other launcher folders, read in memory only, never copied or bundled), pitched like the game (2^((note-12)/12)). Falls back to synthesized stand-ins if no installation is found. Every note block is equally loud, as in the game. |

## Common problems
| Symptom | Fix |
|---|---|
| `ffmpeg was not found` | Install ffmpeg, open a new terminal, and run again. |
| `Demucs separation failed` | Rerun the pip install. Separation can also run out of memory on very long tracks, so suggest `--no-separate` as a fallback. |
| The melody is wrong or missing (recording) | Offer the MIDI search (step 3) if it was skipped. A good MIDI fixes most melody problems. |
| The melody is wrong (MIDI) | Look at the track table and rerun with `--lead-track N` for the real melody track. |
| The build sounds too busy | It should already be the clean default. Suggest `--polyphony 8`. Drop `--full` or `--raw` if they were used. |
| The build sounds too thin | Suggest `--full`. |
| The key is "ambiguous" | Expected for songs that mix major and minor; notes are left unsnapped on purpose. |
| The song is too fast to follow | Suggest `--speed 0.8`, or a larger `--ticks-per-beat`. |
| The rhythm feels doubled or halved | The beat tracker picked double or half time. Suggest `--ticks-per-beat` with twice or half the reported value. |
| The notes sound too high or too low | Suggest `--transpose -12` or `--transpose 12`. |
| `pip install` fails on basic-pitch or torch | basic-pitch supports Python 3.8 to 3.11, so recreate the venv with a supported interpreter (for example `py -3.11 -m venv` on Windows). |

Files in this skill

  • .claude-plugin/plugin.json426 B
  • CHANGELOG.md1.5 KB
  • README.en.md2.2 KB
  • README.md2.2 KB
  • SKILL.md14.2 KB
  • evals/evals.json2 KB
  • evals/files/demo.mid1.7 KB
  • evals/triggers.json497 B
  • requirements.txt613 B
  • scripts/arranger.py24.3 KB
  • scripts/audio_renderer.py8.2 KB
  • scripts/extractor.py14.7 KB
  • scripts/main.py13.2 KB
  • scripts/midi_arranger.py14.9 KB
  • scripts/midi_io.py2.3 KB
  • scripts/midi_tools.py3.8 KB
  • scripts/preview_renderer.py10.6 KB
  • scripts/quantizer.py8.4 KB
  • scripts/resources.py2.5 KB
  • scripts/schematic_builder.py20.1 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 development →

Comments

Loading comments…

Newsletter

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