midi-synth
Skill21 starsChanged 7 months agoMITView on GitHub
Synthesize and render MIDI/MusicXML files to audio (WAV/MP3) and generate Strudel live-coding patterns for creative music manipulation. Uses analysis data (tempo, key, chords, dynamics) from audio-to-midi for intelligent ghost-note removal and accurate reproduction. Two workflows: (1) Convert MIDI/MusicXML to Strudel/TidalCycles code with note durations for interactive tweaking in the browser at strudel.cc, (2) Render MIDI/MusicXML to WAV/MP3 with FluidSynth or built-in synthesis, with controls for tempo, transposition, instrument override, and ghost-note cleaning. Trigger when the user wants to: play a MIDI file, render MIDI to audio, synthesize MIDI, convert MIDI to Strudel code, create live-coding patterns from MIDI, change instruments, transpose or tempo-shift, clean ghost notes, or any MIDI playback/synthesis task.
In this repository22 other files it gives its agents.
- 2d-pixel-assetSkill
- anthropic-skilljar-extractorSkill
- audio-to-midiSkill
- auto-researchSkill
- gemini-image-genSkill
- gemini-web-media-analysisSkill
- google-ai-studio-ttsSkill
- hermes-tweetSkill
- link-downloadSkill
- llama-cppSkill
- meta-muse-video-analysisSkill
- opencodeSkill
- seedanceSkill
- tech-product-landingSkill
- unreal-best-practicesSkill
- unreal-blueprint-codegenSkill
- unreal-gasSkill
- unreal-pcg-pythonSkill
- unreal-thirdpartySkill
- video-downloadSkill
- video-fetch-and-summarizeSkill
- video-summarizerSkill
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 35
Both: run both on the same input
- Distinctive: line 110
Key filter: if analysis provides a key, removes out-of-key notes that also have low velocity (<60)
≈ “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.
Files
MIDI Synth
Synthesize MIDI/MusicXML to audio and generate Strudel live-coding patterns. Uses analysis data for ghost-note cleaning, correct tempo, and key-aware filtering.
Scripts
scripts/to_strudel.py-- MIDI/MusicXML to Strudel patterns with duration-aware notationscripts/render.py-- MIDI/MusicXML to WAV/MP3 with cleaning and modifications
Both scripts auto-detect *_analysis.json files from audio-to-midi for tempo, key, and dynamics.
Workflow
- Identify input: MIDI (.mid) or MusicXML (.musicxml)
- Auto-detect or specify the analysis JSON from audio-to-midi
- Choose workflow:
- Creative:
to_strudel.pygenerates Strudel code for strudel.cc - Rendering:
render.pyproduces WAV/MP3 - Both: run both on the same input
- Creative:
- Ghost notes are automatically cleaned using velocity, duration, and key filters
Strudel Code Generation
# Basic (auto-detects analysis JSON next to input)
py -3.12 scripts/to_strudel.py "song.mid"
# From MusicXML
py -3.12 scripts/to_strudel.py "song.musicxml"
# Explicit analysis file
py -3.12 scripts/to_strudel.py "song.mid" --analysis "song_analysis.json"
# Stricter ghost-note filtering
py -3.12 scripts/to_strudel.py "song.mid" --min-velocity 60 --min-duration 0.1
# Open in browser
py -3.12 scripts/to_strudel.py "song.mid" --open| Flag | Default | Effect |
--analysis | auto-detect | Path to analysis JSON for tempo/key |
--bars | 4 | Pattern length in bars |
--resolution | 16 | Grid: 4/8/16/32 |
--min-velocity | 40 | Remove notes below this velocity (0-127) |
--min-duration | 0.05 | Remove notes shorter than this (seconds) |
--no-key-filter | off | Disable key-based ghost note filtering |
--tempo | from analysis | Override tempo BPM |
--open | off | Open in strudel.cc in browser |
Note durations are encoded with @N notation (e.g., c3@4 = held for 4 steps).
Audio Rendering
# Basic (auto-detects analysis, cleans ghost notes)
py -3.12 scripts/render.py "song.mid" --mp3
# From MusicXML
py -3.12 scripts/render.py "song.musicxml" --mp3
# With SoundFont
py -3.12 scripts/render.py "song.mid" --soundfont "GeneralUser_GS.sf2" --mp3
# Aggressive cleaning
py -3.12 scripts/render.py "song.mid" --min-velocity 60 --min-duration 0.1
# Skip cleaning entirely
py -3.12 scripts/render.py "song.mid" --no-clean
# Modifications
py -3.12 scripts/render.py "song.mid" --tempo 2.0 --transpose 3 --instrument 0| Flag | Default | Effect |
--analysis | auto-detect | Analysis JSON for tempo/key-based cleaning |
--min-velocity | 40 | Ghost note velocity threshold |
--min-duration | 0.05 | Ghost note duration threshold (seconds) |
--no-clean | off | Skip ghost note removal |
--no-key-filter | off | Disable key-based filtering |
--soundfont | auto-detect | .sf2 SoundFont path |
--tempo | 1.0 | Tempo scale factor |
--transpose | 0 | Semitones up/down |
--instrument | original | Override GM program (0-127) |
--mp3 | off | Also produce MP3 |
Ghost Note Cleaning
Three filter layers (applied in order):
- Velocity filter: removes notes below
--min-velocity(default: 40) - Duration filter: removes notes shorter than
--min-duration(default: 50ms) - Key filter: if analysis provides a key, removes out-of-key notes that also have low velocity (<60)
The key filter only removes notes that are BOTH out-of-key AND below medium velocity, preserving intentional chromatic passages.
Dependencies
Auto-installed: pretty_midi, numpy, soundfile.
For MusicXML input: music21 (installed by audio-to-midi skill).
Optional: pyfluidsynth + .sf2 SoundFont for high-quality rendering.
Runtime: Python 3.12 (py -3.12).
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.

