Last active
September 13, 2025 16:29
-
-
Save vicwomg/42922fc3ef5f460831b8ab0f83fb1aa3 to your computer and use it in GitHub Desktop.
Sonicake Pocket Master - midi toggle buttons for ESP32-S3 boards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Arduino.h> | |
| #include <Control_Surface.h> | |
| #include <MIDI_Interfaces/BluetoothMIDI_Interface.hpp> | |
| // MIDI mappings for the Sonicake Pocket Master | |
| // ---- MIDI interfaces ---- | |
| // Note: I found that enabling USBMIDI and BluetoothMIDI_Interface did not work at the same time on ESP32S3 | |
| // USB seems to get disabled when Bluetooth is enabled. Experiment with these settings at your risk. | |
| // USBMIDI_Interface usbmidi; | |
| BluetoothMIDI_Interface midi_ble; | |
| // Change the first number to the desired GPIO pin, and leave the rest alone. | |
| // Ex: "CCButtonLatched fx1 {12, {44, CHANNEL_1}}" sets fx1 toggle to GPIO12 | |
| // ---- Effects ---- | |
| // CCButtonLatched noise_reduction. {0, {43, CHANNEL_1}}; // noise reduction (pre) | |
| CCButtonLatched fx1 {12, {44, CHANNEL_1}}; // fx 1 (pre) | |
| CCButtonLatched drive_fx {8, {45, CHANNEL_1}}; // drive (pre) | |
| // CCButtonLatched amp_fx {0, {46, CHANNEL_1}}; // amp | |
| // CCButtonLatched ir_fx {0, {47, CHANNEL_1}}; // IR | |
| // CCButtonLatched eq_fx {0, {48, CHANNEL_1}}; // EQ | |
| CCButtonLatched fx2 {6, {49, CHANNEL_1}}; // FX2 | |
| CCButtonLatched delay_fx {4, {50, CHANNEL_1}}; // delay | |
| CCButtonLatched reverb {5, {51, CHANNEL_1}}; // reverb | |
| // CCButtonLatched tuner {0, {58, CHANNEL_1}}; // tuner | |
| // ---- Looper ---- | |
| // CCButtonLatched looper {0, {59, CHANNEL_1}}; // looper on/off | |
| // CCButtonLatched looper_record {0, {60, CHANNEL_1}}; // looper start record | |
| // CCButtonLatched looper_play_stop {0, {62, CHANNEL_1}}; // looper play/stop toggle | |
| // CCButtonLatched looper_delete {0, {64, CHANNEL_1}}; // looper delete loop | |
| // CCButtonLatched looper_placement {0, {67, CHANNEL_1}}; // looper toggle post/pre | |
| // ---- Drums ---- | |
| // CCButtonLatched drums {0, {92, CHANNEL_1}}; // drum on/off | |
| // CCButtonLatched drums_play_stop {0, {93, CHANNEL_1}}; // drum play/stop toggle | |
| // ---- Bank/Presets ---- | |
| // CCButtonLatched bank_down {0, {22, CHANNEL_1}}; // decrease preset number by 10 | |
| // CCButtonLatched bank_up {0, {23, CHANNEL_1}}; // increase preset number by 10 | |
| // CCButtonLatched preset_down {0, {24, CHANNEL_1}}; // decrease preset number by 1 | |
| // CCButtonLatched preset_up {0, {25, CHANNEL_1}}; // increase preset number by 1 | |
| // --- Potentiometer mappings. Scale from 0-127 --- | |
| // One outer leg → 3.3V, Other outer leg → GND, Middle wiper → GPIO4 (for example). Swap the outer leg wiring to reverse the control | |
| // Potentiometers must be wired to an ADC pin. On the ESP32S3 those are GPIO1 - GPIO10, and GPIO11 - GPIO20 | |
| // CCPotentiometer preset {0, {1, CHANNEL_1}}; | |
| CCPotentiometer master_vol {10, {6, CHANNEL_1}}; | |
| // CCPotentiometer preset_vol {0, {7, CHANNEL_1}}; | |
| // CCPotentiometer looper_rec_vol {0, {65, CHANNEL_1}}; | |
| // CCPotentiometer looper_play_vol {0, {66, CHANNEL_1}}; | |
| // CCPotentiometer drum_rhythm {0, {94, CHANNEL_1}}; // sets the rhythm style (0-9) | |
| // CCPotentiometer drum_vol {0, {95, CHANNEL_1}}; | |
| void setup() { | |
| Control_Surface.begin(); | |
| } | |
| void loop() { | |
| Control_Surface.loop(); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MIDI toggle switches for Sonicake Pocket Master using ESP32-S3
sonicake.mp4
Hardware:
Setup for flashing
Tools > USB Modeto "USB OTG (TinyUSB)"Code changes / wiring
The Pocket Master seems to forget this device on every boot, unfortunately. LMK if you know a way around that.