{"success":true,"data":{"ext":"midi","name":"Musical Instrument Digital Interface","description":"Musical Instrument Digital Interface (MIDI) is a technical standard for representing musical performance data, originally developed by representatives of the music industry and maintained through the MIDI Association. It is used in music production, electronic instruments, sequencers, notation software, and playback systems to store events such as notes, tempo, and control changes rather than recorded audio. MIDI files are generally safe and compact, though playback depends on device or software sound sources; the format is long-standing and widely supported.","mime":["audio/midi"],"risk_level":"Safe","signatures":[{"hex":"4D 54 68 64","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"},{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"},{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["mid","rmi","aac","ac3","aif","aifc"],"usage":{"python":"def is_midi(file_path: str) -> bool:\n    \"\"\"Check if file is a valid MIDI by magic bytes.\"\"\"\n    signature = bytes([0x4D, 0x54, 0x68, 0x64])\n    with open(file_path, \"rb\") as f:\n        return f.read(4) == signature","node":"function isMIDI(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x4D, 0x54, 0x68, 0x64]);\n  return buffer.subarray(0, 4).equals(signature);\n}","go":"func IsMIDI(data []byte) bool {\n    signature := []byte{0x4D, 0x54, 0x68, 0x64}\n    if len(data) < 4 {\n        return false\n    }\n    return bytes.Equal(data[:4], signature)\n}"},"category":"Audio"}}