Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the structure of a MIDI file?

Tags:

I want to manually have a function that creates a MIDI file according to users demands, for example.

User write 2 patches that contain 8 bars of 4 quarters of A4 (Concert A - 440hz) and C4 (each as a seperated channel) on 120 speed, at velocity 100, instrument piano (01) and patch 49 or whatever.

How should the MIDI file look like according to the above. My goal is to learn how to create a function that generates MIDI data, then write everything to a MIDI file.

So first I have to understand how to create this function or to understand 'MIDI-file language' so I can write it.

Thanks in advance.

like image 570
Shimmy Weitzhandler Avatar asked Jun 21 '10 18:06

Shimmy Weitzhandler


People also ask

How is basic MIDI message structured?

Structure of MIDI messages: MIDI message includes a status byte and up to two data bytes. The most significant bit of status byte is set to 1. The 4 low-order bits identify which channel it belongs to (four bits produce 16 possible channels).

What are the different MIDI file formats?

There are two variations of the Standard MIDI File format, called Type 0 and Type 1. Both variations contain the same data, but the arrangement of the data within the file is different. Type 0 is a single track of data; Type 1 is multi-track.

What is a MIDI sequence file?

The Standard MIDI File (SMF) is a file format that provides a standardized way for music sequences to be saved, transported, and opened in other systems. The standard was developed and is maintained by the MMA, and usually uses a .mid extension.


1 Answers

Other good links on the MIDI file format can be found here:

  • (.mid) Standard MIDI File Format
  • The MIDI Technical Fanatic's Brainwashing Center (really nice resource)
  • Essentials of the MIDI protocol
like image 50
Nik Reiman Avatar answered Sep 29 '22 11:09

Nik Reiman