{
  "slug": "midi-track-splitter",
  "name": "gizza-ai/midi-track-splitter",
  "version": "0.1.0",
  "title": "MIDI Track Splitter — split a .mid file into separate tracks — gizza.ai",
  "description": "Split a multi-track MIDI file into separate single-track .mid files, one per track or per channel. Tempo and time signature are copied into every part.",
  "tags": [
    "midi track splitter",
    "split midi file",
    "midi splitter",
    "separate midi tracks",
    "extract track from midi",
    "split midi by channel",
    "midi to single track files",
    "midi stem export"
  ],
  "category": "audio",
  "urls": {
    "page": "https://gizza.ai/tools/midi-track-splitter/",
    "markdown": "https://gizza.ai/tools/midi-track-splitter/index.md",
    "descriptor": "https://gizza.ai/tools/midi-track-splitter/tool.json",
    "deep_link_example": "https://gizza.ai/tools/midi-track-splitter/?input=4d546864000000060001000300604d54726b0000002000ff0309436f6e647563746f7200ff510307a12000ff58040402180800ff2f004d54726b0000002000ff03055069616e6f00c00000903c4060903c00009040466090400000ff2f004d54726b0000001800ff03044261737300c12100912464814091240000ff2f00&encoding=auto&split_by=track&include_conductor=true&output_format=format-0&skip_empty=true&select=leave%20empty%20for%20every%20part&filename_prefix=part&output=files"
  },
  "cli": "gizza tool midi-track-splitter \"4d546864000000060001000300604d54726b0000002000ff0309436f6e647563746f7200ff510307a12000ff58040402180800ff2f004d54726b0000002000ff03055069616e6f00c00000903c4060903c00009040466090400000ff2f004d54726b0000001800ff03044261737300c12100912464814091240000ff2f00\"",
  "tool": {
    "description": "Split one multi-track Standard MIDI File (.mid) into separate single-part MIDI files and return each as a downloadable `data:audio/midi;base64,…` URL alongside a table of what it contains. `input` is the file's bytes as base64 or hex. `split_by` picks the cut: 'track' (default) gives one file per track chunk — how a DAW-exported Format 1 file is organised — and 'channel' gives one file per MIDI channel, gathered across every track (a Format 0 file has a single track, so it is always cut by channel). Every note-on, note-off, velocity, controller, pitch bend and program change is carried through unchanged at its original tick, and the source division is preserved, so nothing is re-gridded. `include_conductor` (default true) copies the tempo, time signature, key signature and SMPTE offset into each part — without them an exported part plays at the MIDI default 120 BPM in 4/4 — and never duplicates an event the part already had. `output_format` writes each part as 'format-0' (one merged track, default) or 'format-1' (conductor track + part track). `skip_empty` (default true) drops parts with no notes, which is what removes the tempo-only conductor track. `select` exports a subset by 1-based track number or channel number, e.g. '1,3-5'. Filenames are built from each part's track name, or its General MIDI instrument, as `<filename_prefix>-<number>-<name>.mid`. Set `output` to 'list' to see the parts table without the file bytes. Limits: 4 MiB decoded input and at most 64 output files. Pure compute — nothing is fetched, uploaded or stored.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "encoding": {
          "default": "auto",
          "description": "How `input` is encoded: 'auto' (default) reads it as hex when it is all hex digits with an even length, otherwise base64; 'base64'; or 'hex'.",
          "enum": [
            "auto",
            "base64",
            "hex"
          ],
          "type": "string"
        },
        "filename_prefix": {
          "default": "part",
          "description": "First word of each suggested download name (default 'part'), which is built as `<prefix>-<number>-<part name>.mid`, e.g. 'part-02-bass.mid'. Anything that is not a letter or digit becomes a hyphen.",
          "type": "string"
        },
        "include_conductor": {
          "default": true,
          "description": "Copy the conductor data — tempo, time signature, key signature and SMPTE offset — into every output file (default true). Leave it on: those events normally live in track 0 only, so a part exported without them plays back at the MIDI default 120 BPM in 4/4. Events a part already carries are never duplicated.",
          "type": "boolean"
        },
        "input": {
          "description": "The Standard MIDI File (.mid/.midi) bytes as a base64 or hex string. The data must start with a standard `MThd` header chunk (Format 0/1/2) and be at most 4 MiB. Whitespace, and `:`/`-` separators in hex, are ignored.",
          "type": "string"
        },
        "output": {
          "default": "files",
          "description": "How much to return: 'files' (default) the table of parts plus each part's complete .mid bytes as a `data:audio/midi;base64,…` URL; 'list' only the table — part name, source track/channel, instrument, note count and length — which is the quick way to see what is inside a file before exporting it.",
          "enum": [
            "files",
            "list"
          ],
          "type": "string"
        },
        "output_format": {
          "default": "format-0",
          "description": "How each output file is written: 'format-0' (default) merges the conductor data and the part into ONE track, a genuinely single-track file; 'format-1' keeps the conductor data as its own first track with the part second. Both preserve the source division (ticks per quarter note or SMPTE timecode) exactly.",
          "enum": [
            "format-0",
            "format-1"
          ],
          "type": "string"
        },
        "select": {
          "default": "",
          "description": "Which parts to export, as 1-based numbers and ranges, e.g. '1,3-5'. Empty (default) exports every part. The numbers are TRACK numbers when `split_by` is 'track' (track 1 is the first chunk in the file) and MIDI CHANNEL numbers 1-16 when it is 'channel'.",
          "type": "string"
        },
        "skip_empty": {
          "default": true,
          "description": "Skip parts that contain no notes (default true) — that is what drops the conductor/tempo track itself, and any muted or placeholder track. Set false to export every track, empty ones included.",
          "type": "boolean"
        },
        "split_by": {
          "default": "track",
          "description": "What each output file holds: 'track' (default) one file per track chunk, the usual cut for a Format 1 file exported by a DAW; 'channel' one file per MIDI channel, gathering that channel's events from every track. A Format 0 file has only one track, so it is always split by channel.",
          "enum": [
            "track",
            "channel"
          ],
          "type": "string"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}