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.
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).
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.
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.
Other good links on the MIDI file format can be found here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With