MIDI to JSON Converter

The ultimate free tool for developers. Convert .mid files into structured JSON data. Essential for Unity rhythm games, Web Audio visualizations, and AI training.

Click to Upload or Drag MIDI File

Supports Format 0 & 1 (.mid, .midi)

Client-side processing • No server upload

Complete JSON Data Structure Documentation

This tool output strictly follows the specifications of @tonejs/midi. To assist developers in accurately parsing data within Unity, Godot, or Web front-ends, we provide this comprehensive parameter dictionary.

Root 1. Header (Metadata)

ParameterTypeDescription
ppqNumberPulses Per Quarter. The time resolution.
Formula: 1 Beat = ppq ticks
temposArrayList of tempo changes. Includes bpm, time (seconds), and ticks.
timeSignaturesArrayList of time signature changes (e.g., [4, 4]).

Array 2. Tracks

Each object in the tracks array represents an instrument track.

ParameterDescription
channelMIDI Channel (0-15). Channel 9 (index 9) is reserved for Percussion/Drums.
instrumentContains number (GM patch) and family (e.g., "piano").
notes[Core Data] An array of all note events in this track.

Object 3. Note Object (The most important part)

ParameterUnity Mapping Guide
timeStart Time (Seconds). Calculated absolute time based on BPM curves.
Unity: Compare with AudioSettings.dspTime.
ticksStart Position (Ticks). Absolute grid position, unaffected by BPM changes.
Unity: Use for grid-based sequencers.
midiMIDI Note Number (0-127). 60 = Middle C.
velocityVelocity (0.0 - 1.0). Represents volume or intensity.
durationDuration in seconds (NoteOff - NoteOn).

Unity Integration Code (C#)

// C# Example for Unity
using System;
[Serializable] public class NoteData { public float time; public int midi; public float duration; public float velocity; }
[Serializable] public class MidiTrack { public NoteData[] notes; }
[Serializable] public class MidiData { public MidiTrack[] tracks; }
public void LoadMidiJson(string jsonString) {
    MidiData data = JsonUtility.FromJson<MidiData>(jsonString);
    if(data.tracks.Length > 1) {
        foreach (var note in data.tracks[1].notes) { Debug.Log($"Spawn: {note.midi} at {note.time}s"); }
    }
}

Frequently Asked Questions (FAQ)

Q: Why is the tempos array empty?

Many DAWs do not export "Set Tempo" events for simple clips. In this case, the tool defaults to 120 BPM.

Q: Should I use `time` or `ticks`?

Use time (seconds) for audio sync games (Guitar Hero). Use ticks for grid-based logic games.

Q: How do I access Drums?

MIDI Channel 10 (index 9) is percussion. Check where instrument.percussion is true.

Q: Is my data uploaded to a server?

No. This tool runs entirely in your browser using JavaScript. Your files never leave your device.

Q: The JSON file is huge!

Text-based JSON is verbose. For production, parse this JSON in Editor and save as binary ScriptableObject.

Q: How to parse in Unity?

Use JsonUtility or Newtonsoft.Json. You must define wrapper classes that match the JSON structure.