Skip to content
altstrument

Cardputer MIDI Piano

Firmware for M5Stack Cardputer (M5Stack)

MIDI file player for the Cardputer-Adv that plays .mid files from the SD card through a 24-voice synthesized piano, with seek, speed, a piano roll and an experimental USB host mode that plays to and records from the FM-1.

by Saxon267

ActiveSource: openMIT
Rendered mockup of the player screen with the title Clair de Lune, a progress bar at 1:12 of 3:47, a pedal indicator, a two-octave keyboard with three keys lit, transport buttons and a volume of 78
Saxon267, via github.com
Distribution
Prebuilt image you flash yourself
License notes
The LICENSE file is the MIT text, copyright 2026 Saxon267.
Source
github.com https://github.com/saxon267/Cardputer_MidiPlayer
Homepage
github.com https://github.com/saxon267/Cardputer_MidiPlayer

Description

The firmware reads Format 0 and 1 files from the SD card's midi folder and plays them on a built-in piano synthesizer with 24 voices and two overtones, sending 44.1 kHz audio straight to the I2S codec. Controls cover play and pause, seeking by one or five seconds, speed from 0.1 to 3 times, looping, volume, track browsing and a switchable animated piano roll, with sustain pedal handled. Version 0.8.2 adds four pages (player, piano roll, recorder, file manager) with Tab to switch, delete and rename of .mid files, and boot straight to the player. The firmware README says the normal build was checked on a real unit for start-up, playback and CPU load, which sits at about a fifth of one core at normal speed. Limits are about 7000 notes per file and synthesized sound only; a sampled piano in flash is planned. A separate experimental build drives an FM-1 Sloop over a USB-C cable as a USB MIDI host, mutes the local speaker while connected, follows the FM-1's MIDI clock tempo and has a recorder page that writes the FM-1's keyboard or sequencer notes (channels 1, 2, 3 or 10) to /midi/MyMIDI. The README marks the host build and the recorder as experimental and still needing hardware retests. The repository also holds a design write-up and interface mockups, mostly in Chinese.

Install notes

Flash dist/CardputerMidiPlayer-8MB.bin from address 0x0, or build with PlatformIO and run pio run -t upload from the firmware folder. The USB host build is separate, has no USB serial port, and the firmware README describes its flash and recovery order. Put .mid files in /midi on the SD card.

Version history

Cardputer MIDI Piano version history
VersionDateNotes
main @ aac20bd2026-11-08
Latest commit, well ahead of the v0.1.0 tag. The README names firmware 0.8.2, which adds the recorder, the four-page interface, file delete and rename, FM-1 clock tempo following and safer parsing of large files.
v0.1.02026-11-08
GitHub release whose only attached file is the USB host build for 8 MB flash; its notes, in Chinese, list MIDI file playback, FM-1 control over USB host, recording to .mid and file rename and delete. The tag points at an early commit.

Back to M5Stack Cardputer