A handheld chaos machine that turns your M5Stack Fire into a pocket-sized noise lab, because silence is overrated and your neighbors had it too easy anyway.
- 46 sound modes: White/Pink/Brown/Blue/Violet noises, classic waveforms, Shepard tones (up/down), FM/AM tricks, plucked strings, modal drums, granular, supersaw, PWM, ring-mod, chorus-ish, formants, sync, super-square, plus a grab bag of FX like bitcrush, phaser-ish comb, stutter/glitch, Doppler, gated reverb, aliasing buzz, etc. See
src/types.cppandinclude/types.h. - Realtime oscilloscope: Visualizes the actual DAC waveform in the rectangle region on-screen.
- Shuffle mode: Auto-hops tracks on a timer so you can pretend it’s generative art and not button mashing.
- No-pop DAC handling: Starts/stops the speaker more politely than your average Bluetooth speaker.
- Short handheld clips of the app running on M5Stack Fire.
Note: GitHub does not render inline videos in README. The demo files are in static/. Use these links to watch them:
- Board: M5Stack Fire (
board = m5stack-fire) - Audio: On-board speaker via DAC1
GPIO25(AUDIO_DAC_PIN = 25) - Display: Built-in TFT, landscape rotation
Key constants are in include/config.h:
SAMPLE_RATE_HZ = 11025AUDIO_DAC_PIN = 25TRACK_COUNT = 46- Visual area:
NOISE_W = 280,NOISE_H = 160, positioned at(NOISE_X, NOISE_Y) - Frame timing:
FRAME_INTERVAL_MS = 67 - Shuffle:
SHUFFLE_INTERVAL_MS = 12000
- Uses Arduino framework and
M5Stacklibrary. - Config: See
platformio.ini([env:m5stack-fire],platform = espressif32,framework = arduino,lib_deps = m5stack/M5Stack@^0.4.3,monitor_speed = 115200).
Steps:
- Install VS Code + PlatformIO.
- Connect the M5Stack Fire via USB. Select the correct serial port if needed.
- Open this folder (
m5stack-f25) in VS Code. - Build: PlatformIO: Build.
- Upload: PlatformIO: Upload.
- (Optional) Open Serial Monitor at 115200 baud to see logs.
- On boot, the app shows track info and a waveform area.
- Buttons (printed on screen as a reminder):
- A: short press → previous track. Hold → volume down (repeats).
- B: short press → play/pause. Long press (~2s) → toggle Shuffle.
- C: short press → next track. Hold → volume up (repeats).
- Current track name, shuffle state, and volume percent show in the header.
- Audio task:
src/audio_synthesis.cppruns on core 1 and writes 8-bit samples to DAC atSAMPLE_RATE_HZ. - Waveform:
src/visual_rendering.cppreads a ring buffer (VIS_RING_SIZE = 1024) to draw the real output as an oscilloscope. - Track mapping:
src/types.cpp:getCurrentNoiseType()indexes intoinclude/types.h:NoiseType(totalTRACK_COUNT). Display names:getNoiseTypeName(). - Gain normalization:
getGainForType()balances perceived loudness per mode; master gain is adjustable via A/C holds.
- Add a new enum to
include/types.h:NoiseType. - Map it to a track index and name in
src/types.cpp(getCurrentNoiseType,getNoiseTypeName,getGainForType). - Implement synthesis in
src/audio_synthesis.cppor extendsrc/audio_extras.cpp. If using extras, wire in viaisExtraType()andnextAudioSampleExtra(). - The UI will automatically show your new mode when its track is selected.
src/:main.cpp(UI/input),audio_synthesis.cpp(audio),visual_rendering.cpp(oscilloscope),types.cpp(track map),audio_extras.cpp(additional generators).include/: Headers (config.h,types.h, etc.).platformio.ini: Build target and dependencies.
- No sound: Ensure it’s a Fire (with speaker amp) and the device isn’t muted at OS level. Try volume holds (A to decrease, C to increase). Confirm DAC is
GPIO25. - Upload issues: Select the correct COM port in PlatformIO. Press and hold the reset/boot combo on the M5 if necessary.
- Crackles at start/stop: The code soft-lands the DAC, but tiny pops can happen. Let it settle a second after play/pause.
- LCD glitches: Keep default rotation and let the app paint the oscilloscope. Frame pacing is ~15 FPS (
FRAME_INTERVAL_MS = 67).
- Some modes get bright and/or piercing (e.g., near-Nyquist tones). Don’t crank it into headphones. Protect your hearing.
- Infrasound and thump modes are for fun, not medical therapy.
MIT License. See LICENSE for full text.