Agent skill · creative production · aiskillstore

code-to-music

Tools, patterns, and utilities for creating music with code. Output as a .mp3 file with realistic instrument sounds. Write custom compositions to bring creativity to life through music. This skill should be used whenever the user asks for music to be created. Never use this skill for replicating songs, beats, riffs, or other sensitive works. The skill is not suitable for vocal/lyrical music, audio mixing/mastering (reverb, EQ, compression), real-time MIDI playback, or professional studio recording quality.

Why this skill is useful

Provides a framework for algorithmic music composition with specific soundfont and MIDI handling instructions that the AI wouldn't generate on its own.

What it needs

Requires python installed locally. About 11k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

This skill provides tools and patterns for music composition, not pre-baked solutions. The intelligence and music21 library should be used to compose dynamically based on user requests. Core Principle: Write custom code that composes music algorithmically rather than calling functions with hardcoded melodies. Installation & Setup Quick Installation Run the automated installer for complete setup: install.sh. This installs all system dependencies, Python packages, and verifies the installation. Note: The install script may display "error: externally-managed-environment" messages at the end. These are expected and can be safely ignored - the dependencies are already installed. If such messages appear, the installation was successful. Available SoundFonts Traditional Pipeline (Orchestral/Acoustic): /usr/share/sounds/sf2/FluidR3GM.sf2 (141MB, General MIDI soundfont - use for high-quality orchestral/acoustic samples) /usr/share/sounds/sf2/default.sf2 (symlink to best available) ⚠️ DO NOT use TimGM6mb.sf2 - inferior quality, guitars sound electronic/piano-like Electronic Pipeline: Uses the same FluidR3GM.sf2 soundfont as traditional music The difference is which GM programs you choose (synth programs 38-39, 80-95 instead of orchestral) Key Concepts Always create downloadable MP3 files (not HTML players) music21.instrument classes can be used for convenience: instrument.Violin(), instrument.Violoncello(), instrument.Piano(), instrument.Trumpet(), etc. CRITICAL: ALWAYS use mido to set MIDI program numbers after export - music21's instrument classes do NOT reliably export programchange messages. See the mido workflow below. Generate notes programmatically - avoid hardcoded sequences Choosing Your Music Generation Pipeline This skill supports TWO rendering pipelines optimized for different musical styles. Read the user's request carefully and choose the correct pipeline by reading the correct next file. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/code-to-music

View the source on GitHub

Browse the @skills marketplace