




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





Qiushi Jiang ECE 492 Group 7 Winter 2015
Purpose of This Tutorial: MIDI short for Musical Instrument Digital Interface is the most widely used standard for storing and communicating digital music data. If you are working on any music related projects, it very likely you will be running into MIDI. This tutorial will show you the basic specification of MIDI standard and guide you through a simple implementation of a MIDI output jack.
MIDI Standard Crash Course: Overview: MIDI is the digital representation of traditional music notation. It records the essential information about each music note such as duration, pitch and velocity.
Data Format: A single MIDI message contains three bytes: status byte, pitch byte and velocity byte. Additionally there are two separator bits wrapping around each byte, 0 at the front and 1 at the back.
0 [status byte] 1 0 [pitch byte] 1 0 [velocity byte] 1
[Status byte]: The left 4 bits of the status byte defines the note type, and the lower 4 bit defines which MIDI channel is used. Two most important types are: “note on” (1001) and “note off” (1001). There are total 16 channels you can select, from “channel 1” (0000) to “channel 16” (1111). For example: “10010000” means note on signal on channel 1.
[Pitch byte]: Pitch byte defines the pitch of the note. Figure 1 shows the mapping between the pitch byte and piano keyboard. For example: C4 is represented as 60 (00111100) inside the pitch byte.
Figure 1: MIDI Pitch Byte Mapping
[velocity byte]: velocity byte defines how hard the note is played. With 8 bits the velocity can range from 0 to 127.
Transmitting MIDI signal ● MIDI operates on 31250 Hz clock. ● MIDI signal uses 5V as digital 1 and 0V as digital 0. ● When sending MIDI signal, the bytes’ least significant bit are sent first.
For example: When transmitting “note on /channel 1/ C4/ 64 velocity” ( 10010000 1 0 00111100 1 0 10000000 1) the actual signal sent to the MIDI jack will be (0 00001001 1 0 00111100 1 0 00000001 1).
Other Implementation Details
//For example sending a C major Chord *midiOutPointer = getMidiData(0x90,0x3c,0x40); // wait 1 before sending the next note OSTimeDlyHMSM(0, 0, 0, 1);. *midiOutPointer = getMidiData(0x90,0x40,0x40); // wait 1 before sending the next note OSTimeDlyHMSM(0, 0, 0, 1); *midiOutPointer = getMidiData(0x90,0x43,0x40);
Reference:
MIDI 1.0 Detailed Specification http://oktopus.hu/uploaded/Tudastar/MIDI%201.0%20Detailed%20Specification.pdf Accessed on: April 7, 2015.
Figure 1: MIDI Pitch Byte Mapping retrived from http://newt.phys.unsw.edu.au/jw/notes.html Accessed on: April 7, 2015.
Figure 2. MIDI Out Pins retrived from http://tryndelka.narod.ru/ Accessed on: April 7,
Figure 3. Op amp comparator circuit retrieved from http://ocw.mit.edu/courses/electrical engineering and computer science/ Accessed on: April 7, 2015.