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.


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.


midi.send(NoteOn(note, velocity))


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


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.


midi.send(NoteOff(note, velocity))


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.


midi.send(ControlChange(CC, value))


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


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.


x = PitchBend(value)


MIDI.sendPitchBend(value, midi channel);

Reading MIDI In

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




This guide was first published on Mar 02, 2022. It was last updated on Jun 21, 2024.

This page (MIDI Messages) was last updated on Mar 08, 2024.

Text editor powered by tinymce.