You've read how MIDI is transmitted, but what exactly are MIDI messages? This section will go through the most commonly used messages and show how to send them with either CircuitPython or Arduino.

NoteOn

This message begins playing a note. A MIDI NoteOn message sends the MIDI note number and the velocity of the note.

MIDI note numbers range from 0 to 127, where 21 is A0. Inspired Acoustics has a great table here showing the MIDI note numbers with their corresponding English note name, piano key number and pitch frequency.

CircuitPython

midi.send(NoteOn(note, velocity))

Arduino

MIDI.sendNoteOn(note, velocity, midi channel);

NoteOff

This stops a note from playing. If a NoteOff message is not sent after a NoteOn message, the note will continue playing forever. A MIDI NoteOff message sends the note number and the velocity of the note.

CircuitPython

midi.send(NoteOff(note, velocity))

Arduino

MIDI.sendNoteOff(note, velocity, midi channel);

ControlChange Messages

ControlChange (CC) messages are utility messages that can have a range of functionality. CC messages are usually what is sent when you turn a knob or move a slider on a MIDI controller. Some examples of common messages are modulation and sustain. Each CC message has an assigned number. The MIDI Association has a resource listing CC messages here.

A MIDI CC message contains the CC number and the value that you want to send to that control change. The value range will differ depending on the CC message, but usually have a range of 0 - 127.

CircuitPython

midi.send(ControlChange(CC, value))

Arduino

MIDI.sendControlChange(CC, value, midi channel);

PitchBend

PitchBend is a special MIDI message, with a range of 0 to 16383. Since pitch can be bent up or down, the midpoint (no pitch bend) is 8192.

CircuitPython

x = PitchBend(value)
midi.send(x)

Arduino

MIDI.sendPitchBend(value, midi channel);

Reading MIDI In

You can receive MIDI data and have your microcontroller read the incoming MIDI message.

CircuitPython

midi.receive()

Arduino

MIDI.read();

This guide was first published on Mar 02, 2022. It was last updated on 2022-03-02 13:24:41 -0500.

This page (MIDI Messages) was last updated on May 28, 2022.

Text editor powered by tinymce.