Midi is a binary format file. The basic structure of this file is generally "file header data description". The file header generally includes the file type; and MIDI data is composed of several sub-data with the same format. , these sub-data record all the information of a track in a multi-track format.
#The operating environment of this tutorial: Dell G3 computer, Windows 7 system.
MIDI files are binary files. Such files generally have the following basic structure: File header Data description File header generally includes the file type, because Midi files only have . There are two types with the extension mid, Class 0 and Class 1, and there are more formats of bitmap files that everyone is familiar with, so there is such a thing as a file header.
Unlike waveform files, MIDI files do not sample music, but record each note of the music as a number, so the file is much smaller than waveform files, which can meet the needs of long-term music. . The MIDI standard specifies the mixing and pronunciation of various tones, and these numbers can be resynthesized into music through an output device.
The main limitation of MIDI music is that it lacks the ability to reproduce true natural sounds and therefore cannot be used in situations where speech is required. In addition, MIDI can only record a limited combination of musical instruments specified by the standard, and the playback quality is limited by the synthesis chip of the sound card. In recent years, popular foreign sound cards generally use the wavetable method for music synthesis, which greatly improves the quality of MIDI music.
MIDI files have several alternative formats, such as RMI and CIF. The CMF file (creative music format) is a music file used with the Sound Blaster card. RMI files are a sub-format of RIFF (resource interchange file format) files used by Windows, called RMID, which is the format that contains MIDI files.
Midi format composition:
MIDI data is composed of several sub-data with the same format. These sub-data are recorded in a multi-track format. All information for a track. To add an additional track, simply append the data after the previous track, but don't forget to change the nn nn (number of tracks) in the file header.
Look at the global audio track first. The global audio track includes additional information about the song (such as title and copyright), song speed and system code (Sysx). Whether it is a global audio track or an audio track containing notes, it all starts with "4D 54 72 6B", which is actually the ASCII character "MTrk", followed by a 4-byte integer, which marks the bytes of the track Number, this does not include the previous 4 bytes and the 4 bytes itself. We can understand this in the following examples.
The next step is to record the data. Each data has the same structure: time difference event. The so-called time difference refers to the amount of time from the previous event to this event, and its unit is tick (the minimum time unit of MIDI). Its composition is rather special and will be explained here in binary.
Recommended: "Programming Video"
The above is the detailed content of What file format is midi?. For more information, please follow other related articles on the PHP Chinese website!

The domestic AI dark horse DeepSeek has risen strongly, shocking the global AI industry! This Chinese artificial intelligence company, which has only been established for a year and a half, has won wide praise from global users for its free and open source mockups, DeepSeek-V3 and DeepSeek-R1. DeepSeek-R1 is now fully launched, with performance comparable to the official version of OpenAIo1! You can experience its powerful functions on the web page, APP and API interface. Download method: Supports iOS and Android systems, users can download it through the app store; the web version has also been officially opened! DeepSeek web version official entrance: ht

DeepSeek: How to deal with the popular AI that is congested with servers? As a hot AI in 2025, DeepSeek is free and open source and has a performance comparable to the official version of OpenAIo1, which shows its popularity. However, high concurrency also brings the problem of server busyness. This article will analyze the reasons and provide coping strategies. DeepSeek web version entrance: https://www.deepseek.com/DeepSeek server busy reason: High concurrent access: DeepSeek's free and powerful features attract a large number of users to use at the same time, resulting in excessive server load. Cyber Attack: It is reported that DeepSeek has an impact on the US financial industry.

At the beginning of 2025, domestic AI "deepseek" made a stunning debut! This free and open source AI model has a performance comparable to the official version of OpenAI's o1, and has been fully launched on the web side, APP and API, supporting multi-terminal use of iOS, Android and web versions. In-depth search of deepseek official website and usage guide: official website address: https://www.deepseek.com/Using steps for web version: Click the link above to enter deepseek official website. Click the "Start Conversation" button on the homepage. For the first use, you need to log in with your mobile phone verification code. After logging in, you can enter the dialogue interface. deepseek is powerful, can write code, read file, and create code

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Chinese version
Chinese version, very easy to use