{"id":"8f3602ac-b1f4-4578-9661-e47c34f0260a","shortId":"zkKZkZ","kind":"skill","title":"midi-generation","tagline":"Generate MIDI files with GM instruments and music theory. Use when creating music, composing melodies, or generating MIDI files.","description":"# MIDI Generation Skill\n\nGenerate MIDI files with proper music theory. **Use the provided Python scripts in `skills/`. Do NOT write custom code.**\n\n## Important Rules\n\n1. **Use provided scripts** in `skills/` directory (Python)\n2. **Never write custom Python/JS** for MIDI generation\n3. **Install dependencies first**: `pip install midiutil`\n4. **Consult music theory resources** when needed (see below)\n\n## Quick Dissonance Rules\n\n**Always follow these to avoid harsh sounds:**\n\n1. **Never play notes 1 semitone apart** (C+C#, E+F, B+C)\n2. **Bass plays root or fifth** of the chord\n3. **Spread voices across octaves** (don't cluster)\n4. **Each track uses different MIDI channel** (automatic)\n\n---\n\n## Music Theory Resources (Read When Needed)\n\n**Only read the resource that matches your current task:**\n\n| When you need... | Read this file |\n|------------------|----------------|\n| Scales, chords, intervals, cadences | [resources/music-theory.md](resources/music-theory.md) |\n| Chord progressions by genre | [resources/chord-progressions.md](resources/chord-progressions.md) |\n| Avoiding dissonance, voice spacing | [resources/voice-leading.md](resources/voice-leading.md) |\n| **Classical/Baroque counterpoint** | [resources/counterpoint.md](resources/counterpoint.md) |\n| Modes (Dorian, Phrygian, etc.) | [resources/modes-scales.md](resources/modes-scales.md) |\n| Rhythm, time signatures, syncopation | [resources/rhythm-patterns.md](resources/rhythm-patterns.md) |\n| Instrument ranges, combinations | [resources/orchestration.md](resources/orchestration.md) |\n\n### When to Read Each Resource\n\n- **Pop/Rock song** → chord-progressions.md + voice-leading.md\n- **Classical piece** → counterpoint.md + orchestration.md\n- **Jazz composition** → modes-scales.md + chord-progressions.md\n- **Film score** → orchestration.md + modes-scales.md\n- **Any composition** → Always check voice-leading.md for dissonance\n\n---\n\n## Workflow\n\n1. **Install dependencies**: `pip install midiutil`\n2. **Identify genre/style** → Select appropriate resources\n3. **Read relevant theory** → Only the files you need\n4. **Choose instruments** → See [midi_types/gm_instruments.py](midi_types/gm_instruments.py)\n5. **Create composition JSON**\n6. **Use scripts** to generate MIDI\n\n## Python Scripts\n\n| Script | Purpose |\n|--------|---------|\n| `skills/generate_midi.py` | Generate MIDI (auto-assigns channels per track) |\n| `skills/normalize_composition.py` | Validate and normalize input |\n| `skills/refine_composition.py` | Adjust length, extend tracks |\n| `skills/convert_to_wav.py` | MIDI → WAV (requires FluidSynth) |\n\n## Usage Example\n\n```python\nimport sys\nsys.path.insert(0, '/path/to/midi-skill')\n\nfrom skills.generate_midi import generate_midi_from_dict\n\ncomposition = {\n    \"title\": \"My Song\",\n    \"bpm\": 120,\n    \"tracks\": [\n        {\n            \"instrument\": \"acoustic-grand-piano\",\n            \"notes\": [\n                {\"pitch\": \"C4\", \"duration\": \"4\"},\n                {\"pitch\": \"E4\", \"duration\": \"4\"},\n                {\"pitch\": \"G4\", \"duration\": \"4\"},\n                {\"pitch\": \"C5\", \"duration\": \"2\"}\n            ]\n        },\n        {\n            \"instrument\": \"acoustic-bass\",\n            \"notes\": [\n                {\"pitch\": \"C2\", \"duration\": \"2\"},\n                {\"pitch\": \"G2\", \"duration\": \"2\"}\n            ]\n        }\n    ]\n}\n\nmidi_path = generate_midi_from_dict(composition)\nprint(f\"Generated: {midi_path}\")\n```\n\n## Composition Format\n\n```json\n{\n  \"title\": \"My Song\",\n  \"bpm\": 120,\n  \"tracks\": [\n    {\n      \"instrument\": \"acoustic-grand-piano\",\n      \"notes\": [\n        { \"pitch\": \"C4\", \"duration\": \"4\" },\n        { \"pitch\": \"E4\", \"duration\": \"4\" }\n      ]\n    },\n    {\n      \"instrument\": \"acoustic-bass\",\n      \"notes\": [\n        { \"pitch\": \"C2\", \"duration\": \"2\" }\n      ]\n    }\n  ]\n}\n```\n\n## Duration Notation\n\n| Value | Note |\n|-------|------|\n| `1` | Whole note (4 beats) |\n| `2` | Half note (2 beats) |\n| `d2` | Dotted half (3 beats) |\n| `4` | Quarter note (1 beat) |\n| `d4` | Dotted quarter (1.5 beats) |\n| `8` | Eighth note (0.5 beats) |\n| `16` | Sixteenth note (0.25 beats) |\n\n## Instrument Aliases\n\n| Alias | GM Instrument |\n|-------|---------------|\n| `piano` | acoustic-grand-piano |\n| `guitar` | acoustic-guitar-nylon |\n| `bass` | acoustic-bass |\n| `strings` | string-ensemble-1 |\n| `brass` | brass-section |\n| `sax` | alto-sax |\n\nFull list: [midi_types/gm_instruments.py](midi_types/gm_instruments.py)\n\n## Notes\n\n- Max 15 melodic tracks (MIDI channels 0-8, 10-15; ch.9 = drums)\n- Output: `output/` directory\n- WAV requires: FluidSynth + A320U.sf2 in `soundfonts/`","tags":["midi","agent","skill","tubone24","agent-skills"],"capabilities":["skill","source-tubone24","skill-midi-agent-skill","topic-agent-skills","topic-midi"],"categories":["midi-agent-skill"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/tubone24/midi-agent-skill","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add tubone24/midi-agent-skill","source_repo":"https://github.com/tubone24/midi-agent-skill","install_from":"skills.sh"}},"qualityScore":"0.454","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 9 github stars · SKILL.md body (4,574 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-25T19:02:55.259Z","embedding":null,"createdAt":"2026-04-24T19:03:53.397Z","updatedAt":"2026-04-25T19:02:55.259Z","lastSeenAt":"2026-04-25T19:02:55.259Z","tsv":"'-15':472 '-8':470 '/path/to/midi-skill':290 '0':289,469 '0.25':422 '0.5':417 '1':47,89,93,216,389,407,447 '1.5':412 '10':471 '120':304,360 '15':464 '16':419 '2':55,102,222,327,336,340,384,394,397 '3':63,111,228,402 '4':70,119,237,315,319,323,371,375,392,404 '5':245 '6':249 '8':414 'a320u.sf2':481 'acoust':308,330,364,378,431,436,441 'acoustic-bass':329,377,440 'acoustic-grand-piano':307,363,430 'acoustic-guitar-nylon':435 'across':114 'adjust':274 'alia':426 'alias':425 'alto':454 'alto-sax':453 'alway':82,210 'apart':95 'appropri':226 'assign':264 'auto':263 'auto-assign':262 'automat':126 'avoid':86,160 'b':100 'bass':103,331,379,439,442 'beat':393,398,403,408,413,418,423 'bpm':303,359 'brass':448,450 'brass-sect':449 'c':96,97,101 'c2':334,382 'c4':313,369 'c5':325 'cadenc':151 'ch.9':473 'channel':125,265,468 'check':211 'choos':238 'chord':110,149,154 'chord-progressions.md':194,203 'classic':196 'classical/baroque':166 'cluster':118 'code':44 'combin':184 'compos':17 'composit':201,209,247,299,347,353 'consult':71 'counterpoint':167 'counterpoint.md':198 'creat':15,246 'current':140 'custom':43,58 'd2':399 'd4':409 'depend':65,218 'dict':298,346 'differ':123 'directori':53,477 'disson':80,161,214 'dorian':171 'dot':400,410 'drum':474 'durat':314,318,322,326,335,339,370,374,383,385 'e':98 'e4':317,373 'eighth':415 'ensembl':446 'etc':173 'exampl':284 'extend':276 'f':99,349 'fifth':107 'file':6,22,28,147,234 'film':204 'first':66 'fluidsynth':282,480 'follow':83 'format':354 'full':456 'g2':338 'g4':321 'generat':3,4,20,24,26,62,253,260,295,343,350 'genr':157 'genre/style':224 'gm':8,427 'grand':309,365,432 'guitar':434,437 'half':395,401 'harsh':87 'identifi':223 'import':45,286,294 'input':272 'instal':64,68,217,220 'instrument':9,182,239,306,328,362,376,424,428 'interv':150 'jazz':200 'json':248,355 'length':275 'list':457 'match':138 'max':463 'melod':465 'melodi':18 'midi':2,5,21,23,27,61,124,241,243,254,261,279,293,296,341,344,351,458,460,467 'midi-gener':1 'midiutil':69,221 'mode':170 'modes-scales.md':202,207 'music':11,16,31,72,127 'need':76,132,144,236 'never':56,90 'normal':271 'notat':386 'note':92,311,332,367,380,388,391,396,406,416,421,462 'nylon':438 'octav':115 'orchestration.md':199,206 'output':475,476 'path':342,352 'per':266 'phrygian':172 'piano':310,366,429,433 'piec':197 'pip':67,219 'pitch':312,316,320,324,333,337,368,372,381 'play':91,104 'pop/rock':192 'print':348 'progress':155 'proper':30 'provid':35,49 'purpos':258 'python':36,54,255,285 'python/js':59 'quarter':405,411 'quick':79 'rang':183 'read':130,134,145,189,229 'relev':230 'requir':281,479 'resourc':74,129,136,191,227 'resources/chord-progressions.md':158,159 'resources/counterpoint.md':168,169 'resources/modes-scales.md':174,175 'resources/music-theory.md':152,153 'resources/orchestration.md':185,186 'resources/rhythm-patterns.md':180,181 'resources/voice-leading.md':164,165 'rhythm':176 'root':105 'rule':46,81 'sax':452,455 'scale':148 'score':205 'script':37,50,251,256,257 'section':451 'see':77,240 'select':225 'semiton':94 'signatur':178 'sixteenth':420 'skill':25,39,52 'skill-midi-agent-skill' 'skills.generate':292 'skills/convert_to_wav.py':278 'skills/generate_midi.py':259 'skills/normalize_composition.py':268 'skills/refine_composition.py':273 'song':193,302,358 'sound':88 'soundfont':483 'source-tubone24' 'space':163 'spread':112 'string':443,445 'string-ensembl':444 'syncop':179 'sys':287 'sys.path.insert':288 'task':141 'theori':12,32,73,128,231 'time':177 'titl':300,356 'topic-agent-skills' 'topic-midi' 'track':121,267,277,305,361,466 'types/gm_instruments.py':242,244,459,461 'usag':283 'use':13,33,48,122,250 'valid':269 'valu':387 'voic':113,162 'voice-leading.md':195,212 'wav':280,478 'whole':390 'workflow':215 'write':42,57","prices":[{"id":"f6f5a2dc-b659-4900-a41e-ca364ff0b41b","listingId":"8f3602ac-b1f4-4578-9661-e47c34f0260a","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"tubone24","category":"midi-agent-skill","install_from":"skills.sh"},"createdAt":"2026-04-24T19:03:53.397Z"}],"sources":[{"listingId":"8f3602ac-b1f4-4578-9661-e47c34f0260a","source":"github","sourceId":"tubone24/midi-agent-skill","sourceUrl":"https://github.com/tubone24/midi-agent-skill","isPrimary":false,"firstSeenAt":"2026-04-24T19:03:53.397Z","lastSeenAt":"2026-04-25T19:02:55.259Z"}],"details":{"listingId":"8f3602ac-b1f4-4578-9661-e47c34f0260a","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"tubone24","slug":"midi-agent-skill","github":{"repo":"tubone24/midi-agent-skill","stars":9,"topics":["agent-skills","midi"],"license":"other","html_url":"https://github.com/tubone24/midi-agent-skill","pushed_at":"2026-03-01T08:55:36Z","description":"MIDI Agent Skill is Agent Skills that enables AI models to generate MIDI files from text-based music data. This tool allows for programmatic creation of musical compositions through a standardized interface.","skill_md_sha":"d5056bc2897e4fa78829dad47ef3b3328f946b52","skill_md_path":"SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/tubone24/midi-agent-skill"},"layout":"root","source":"github","category":"midi-agent-skill","frontmatter":{"name":"midi-generation","license":"MIT","description":"Generate MIDI files with GM instruments and music theory. Use when creating music, composing melodies, or generating MIDI files."},"skills_sh_url":"https://skills.sh/tubone24/midi-agent-skill"},"updatedAt":"2026-04-25T19:02:55.259Z"}}