MIDI Part 1
Interfacing with the world of music hardware
This lecture introduces the MIDI protocol for interfacing with other music hardware.
Table of contents
- What you’ll learn in this lecture
- What you’ll make in this lecture
- Code examples
- Recommended parts
- Further reading
Lecture 15: MIDI Part 1
What you’ll learn in this lecture
- Introduction to the MIDI protocol
- Handling Note On and Note Off messages
- Keeping track of multiple notes
What you’ll make in this lecture
- Monophonic MIDI synth with ADSR envelope
Code examples
midi-sinetone: Simple monophonic MIDI synth generating sine waves.
midi-multinote: Extends the midi-sinetone
project to keep track of multiple keypresses, so that it always plays the most recently pressed key and handles key releases gracefully.
midi-adsr: Project using ADSR envelopes for amplitude and filter cutoff frequency, controlled by MIDI. See Lecture 14 for details on ADSR.
Recommended parts
Running the examples in this course assumes that you have a Bela Starter Kit or Bela Mini Starter Kit.
This lecture requires a source of MIDI input, either a keyboard attached to the USB port of Bela or virtual keyboard software which can send MIDI messages to Bela from the host computer. The following software MIDI generators will work:
Further reading
- Summary of MIDI messages from midi.org
- MIDI controller numbers from midi.org
- General MIDI sound sets (i.e. Program Change message meaning) from midi.org
- MIDI Polyphonic Expression (MPE) specification from midi.org
- Hexadecimal tutorial from SparkFun