.MIDI Musical Instrument Digital Interface
.midi

Musical Instrument Digital Interface

MIDI files store musical instructions — notes, timing, velocity, and instrument selections — not audio waveforms. Musicians compose and arrange with MIDI in DAWs, while developers parse the binary MThd/MTrk structure to build music software and interactive applications.

بنية الصيغة
Header format info
Meta tags · codec
Samples audio data
Instrument DataNot AudioMMA StandardType 0/1/216 Channels1983
بواسطة FileDex
غير قابل للتحويل

MIDI contains sequencer instructions, not audio samples. Converting MIDI to audio requires a synthesizer and soundfont library not available in browser WASM.

تبحث عن تحويل؟ جرّب صيغة ذات صلة:

أسئلة شائعة

Can FileDex convert MIDI to audio?

No. MIDI contains musical instructions, not audio data. Converting MIDI to MP3 or WAV requires a synthesizer with instrument samples (SoundFont). Use FluidSynth or a DAW like GarageBand to render MIDI to audio with your preferred instrument sounds.

Why does my MIDI file sound different on different devices?

MIDI files specify instrument numbers (Program Change), not actual sounds. Each device or software synthesizer uses its own instrument samples. A piano patch on a Roland synthesizer sounds different from the same patch number on a Yamaha or a software SoundFont.

What is the difference between MIDI Type 0, 1, and 2?

Type 0 stores all channels in a single track — simplest format, most compatible. Type 1 stores each instrument in a separate track with synchronized playback — standard for multi-track editing. Type 2 stores independent patterns (rarely used, mainly for drum machines).

How do I view the contents of a MIDI file?

MuseScore opens MIDI as notation. For raw event data, use midicsv to convert to CSV, or the Python mido library to iterate events programmatically. DAWs like FL Studio and Ableton show MIDI as piano-roll note blocks.

What is General MIDI?

General MIDI (GM) is a standardized mapping of 128 instrument patches (Program 0 = Acoustic Grand Piano, Program 73 = Flute, etc.) and a percussion key map on channel 10. GM ensures a MIDI file sounds approximately correct on any GM-compatible synthesizer.

ما يميز .MIDI

What is a MIDI file?

MIDI (Musical Instrument Digital Interface) files contain musical instructions — notes, timing, instrument selections, and dynamics — rather than actual audio waveforms. A MIDI file is like sheet music for computers, telling synthesizers which notes to play, when, and how.

اكتشف التفاصيل التقنية

How to open MIDI files

  • Windows Media Player (Windows) — Built-in playback
  • GarageBand (macOS, iOS) — Free, Apple's music tool
  • VLC Media Player (Windows, macOS, Linux) — Free
  • MuseScore (Windows, macOS, Linux) — Free, visual notation
  • FL Studio (Windows, macOS) — DAW with MIDI editing

Technical specifications

Property Value
Type Instruction data (not audio)
Channels 16 standard channels
Resolution Up to 960 PPQN
File Types Type 0 (single track), Type 1 (multi-track)
Events Note, Control Change, Program Change
General MIDI 128 standard instruments

Programs that open MIDI files

  • MuseScore — Free music notation
  • FL Studio — Digital audio workstation
  • Ableton Live — Music production
  • Logic Pro — macOS music production
  • LMMS — Free open-source DAW

Common use cases

  • Music composition: Writing and arranging music
  • Karaoke: Background music tracks
  • Game music: Adaptive game soundtracks
  • Music education: Visualizing musical structure

المرجع التقني

نوع MIME
audio/midi
Magic Bytes
4D 54 68 64 MThd (MIDI Track Header) signature.
المطوّر
MIDI Manufacturers Association
سنة التقديم
1983
معيار مفتوح
نعم — عرض المواصفات
000000004D546864 MThd

MThd (MIDI Track Header) signature.

البنية الثنائية

A Standard MIDI File begins with a 14-byte header chunk: 4-byte chunk ID MThd (4D 54 68 64), 4-byte big-endian chunk length (always 00 00 00 06), 2-byte format type (0, 1, or 2), 2-byte number of tracks, and 2-byte timing division (ticks per quarter note or SMPTE frames). Following the header, one or more track chunks appear, each starting with MTrk (4D 54 72 6B), a 4-byte big-endian length, and a sequence of MIDI events. Each event is prefixed by a variable-length delta-time (1-4 bytes using 7-bit encoding with continuation bit). Events include Note On/Off (0x9n/0x8n), Control Change (0xBn), Program Change (0xCn), Pitch Bend (0xEn), Meta events (0xFF followed by type and length), and SysEx events (0xF0/0xF7). Running status allows omitting the status byte when consecutive events share the same type.

OffsetLengthFieldExampleDescription
0x00 4 bytes Chunk ID 4D 54 68 64 (MThd) MIDI header chunk identifier. All SMF files start with these bytes.
0x04 4 bytes Header Length 00 00 00 06 Big-endian length of header data (always 6 bytes for standard SMF).
0x08 2 bytes Format Type 00 01 0 = single multi-channel track, 1 = multiple simultaneous tracks, 2 = multiple independent tracks.
0x0A 2 bytes Number of Tracks 00 0A (10 tracks) Count of MTrk chunks in the file. Type 0 files always have 1 track.
0x0C 2 bytes Timing Division 01 E0 (480 PPQN) If bit 15 = 0: ticks per quarter note (PPQN). If bit 15 = 1: SMPTE frames (negative frame rate in upper byte, ticks per frame in lower byte).
0x0E 4 bytes Track Chunk ID 4D 54 72 6B (MTrk) Start of first track data chunk. Contains delta-time prefixed MIDI events.
1983MIDI 1.0 specification published by the MIDI Manufacturers Association (MMA) and Japan MIDI Standards Committee (JMSC)1988Standard MIDI File (SMF) format finalized — establishes the MThd/MTrk binary file structure1991General MIDI (GM) Level 1 specification published, standardizing 128 instrument patches across all GM devices1996General MIDI Level 2 adds 256 instruments, reverb/chorus effects, and more controllers1999MIDI becomes the standard for karaoke files (KAR format) and mobile phone ringtones worldwide2020MIDI 2.0 specification released, adding 32-bit resolution, per-note controllers, and bidirectional protocol
Render MIDI to WAV using FluidSynth أخرى
fluidsynth -ni -g 1.0 /usr/share/soundfonts/FluidR3_GM.sf2 input.mid -F output.wav

-ni runs non-interactive (no shell). -g 1.0 sets gain to 1.0. The SoundFont file provides the instrument samples. -F outputs to WAV file. Audio quality depends on the SoundFont used.

Inspect MIDI file structure with Python أخرى
python3 -c "import mido; mid = mido.MidiFile('input.mid'); print(f'Type: {mid.type}, Tracks: {len(mid.tracks)}, Ticks/beat: {mid.ticks_per_beat}'); [print(f'  Track {i}: {len(t)} events') for i, t in enumerate(mid.tracks)]"

Uses the mido Python library to parse the SMF header and count events per track. Shows format type (0/1/2), track count, and timing resolution (PPQN).

Dump MIDI events as human-readable text أخرى
midicsv input.mid output.csv

Converts MIDI binary to CSV format with one line per event: track, tick, event type, channel, and parameters. Useful for debugging, diffing, and programmatic analysis of MIDI data.

MIDI MP3 render variable MIDI contains no audio — it must be rendered through a synthesizer with a SoundFont or virtual instrument to produce audible audio. FluidSynth or TiMidity++ render MIDI to audio using sampled instrument libraries.
MIDI WAV render variable Rendering MIDI to WAV produces an uncompressed audio file using the chosen SoundFont. Audio quality depends entirely on the SoundFont quality, not the MIDI data itself.
منخفض

نقاط الضعف

  • Malformed variable-length delta-time values without termination can cause parsers to read beyond track boundaries into arbitrary file data
  • Extremely large SysEx messages (0xF0) with crafted length fields can trigger heap allocation overflow in MIDI libraries that allocate based on declared size

الحماية: FileDex presents MIDI as a reference-only format. No MIDI processing or synthesis is performed in the browser. The format page provides documentation and links to external tools.

MuseScore أداة
Free music notation editor with MIDI import/export and visual score rendering
FluidSynth أداة
Open-source SoundFont synthesizer for rendering MIDI to audio
mido مكتبة
Python library for parsing, creating, and manipulating MIDI files and messages
TiMidity++ أداة
Open-source MIDI-to-audio renderer using GUS-compatible patch sets
MIDI Association مواصفات
Official MIDI 1.0 and 2.0 specification maintainer (formerly MMA)