NANANA
Published © GPL3+

Go-On Pico: 8-Bit Style Synthesis Module

Go-On Pico (五音ピコ) is a retro-inspired synthesis module designed for generating chiptune-like sounds with M5Stack Core.

IntermediateFull instructions provided3 hours130
Go-On Pico: 8-Bit Style Synthesis Module

Things used in this project

Story

Read more

Schematics

Block diagram and pins

Block diagram and pins of Go-On Pico

Code

Go-On Pico Controller

C/C++
Sample code to control Go-On Pico.
#include <M5Unified.h>

void sendSerialMessage(uint8_t command, uint8_t channel, uint8_t tone, uint8_t velocity) {
    char message[20];
    sprintf(message, "%02d,%02d,%03d,%03d\n", command, channel, tone, velocity);
    Serial2.print(message);
    Serial.print(message);
}

void setup() {
    auto cfg = M5.config();
    M5.begin(cfg);
    Serial.begin(115200);
    Serial2.begin(115200, SERIAL_8N1, 13, 14);

    M5.Display.setTextSize(2);
    M5.Display.setCursor(0, 40);
    M5.Display.println("BtnA: C4");
    M5.Display.println("BtnB: D4");
    M5.Display.println("BtnC: E4");
}

void loop() {
    M5.update();

    // BtnA → C4
    if (M5.BtnA.wasPressed()) {
        sendSerialMessage(1, 0, 60, 67); // note_on C4
        Serial.println("BtnA was pressed");
    }
    if (M5.BtnA.wasReleased()) {
        sendSerialMessage(0, 0, 60, 0);   // note_off C4
        Serial.println("BtnA was released");
    }

    // BtnB → D4
    if (M5.BtnB.wasPressed()) {
        sendSerialMessage(1, 0, 62, 67); // note_on D4
        Serial.println("BtnB was pressed");
    }
    if (M5.BtnB.wasReleased()) {
        sendSerialMessage(0, 0, 62, 0);   // note_off D4
        Serial.println("BtnB was released");
    }

    // BtnC → E4
    if (M5.BtnC.wasPressed()) {
        sendSerialMessage(1, 0, 64, 67); // note_on E4
        Serial.println("BtnC was pressed");
    }
    if (M5.BtnC.wasReleased()) {
        sendSerialMessage(0, 0, 64, 0);   // note_off E4
        Serial.println("BtnB was released");
    }
}

Go-On Pico core

Go-On Pico core for XIAO RP2040.

Credits

NANANA
1 project • 1 follower
MAKE is fun! Obsessed with all things KAWAII! Follow me on X(@nananauno)

Comments