Skip to main content
Glama

import_midi

Convert MIDI files into playable Strudel patterns. Supports drum and pitched tracks with chord merging and sample lane separation.

Instructions

Convert a .mid file into a playable Strudel pattern (Phase 1: literal transcription, #201). Use source="base64" with data= for inline bytes, or source="path" with data= to read from the patterns/midi/ directory (path traversal blocked). Drum tracks (MIDI channel 10) emit one s() lane per sample so simultaneous kicks/hats do not collide. Pitched tracks emit note("...").s("piano") with simultaneous notes merged into [a,b,c] chord tokens. Phase 2+ (structural compression, voice separation, LLM idiomatic pass) tracked in separate issues. Example: import_midi({ source: "path", data: "drumloop.mid", steps_per_cycle: 16 }). For the reverse direction (Strudel → MIDI) use the analyze tool with task="export_midi".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesHow to interpret `data` — raw base64 bytes or a filename under patterns/midi/
dataYesFor source=base64: base64-encoded .mid bytes (≤1MB decoded). For source=path: basename of a .mid file under ./patterns/midi/ (path-traversal blocked).
steps_per_cycleNoGrid resolution per bar (integer 1-64). Default 16.
barsNoCap on bars to emit. Default: full file.
drum_mapNoOptional override / extension to the default GM percussion map. Keys are MIDI note numbers (as strings, since JSON object keys), values are Strudel sample names. Example: { "60": "cp", "61": "rim" }. Unmapped drums fall back to rests and are surfaced in the result summary.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description thoroughly discloses behavioral traits: file source constraints, drum track handling (s() lanes for non-collision), pitched track output (note().s('piano') and chord merging), and reference to future phases. This compensates for the lack of annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficient, front-loading the main purpose, then detailing source options, behavior, and an example. Every sentence adds value, though it could be slightly more structured with bullet points.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the parameter count, lack of output schema, and no annotations, the description is quite complete. It covers input formats, behavior for drum and pitched tracks, and future phases. It does not fully specify the output structure of the pattern, but the example implies a pattern object.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

While the schema covers 100% of parameters and descriptions, the description adds meaningful context beyond the schema: explains the default for steps_per_cycle, the drum_map override behavior, and that unmapped drums result in rests surfaced in the summary.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool converts a .mid file into a playable Strudel pattern, with specific mention of Phase 1 literal transcription. It distinguishes from the sibling tool export_midi by explicitly noting the reverse direction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use source='base64' vs source='path', mentions path traversal blocking, and provides an example. It also indicates the reverse direction via analyze tool. However, it does not explicitly state when not to use this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/williamzujkowski/live-coding-music-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server