r/MoonModules • u/ewowi • 20d ago
MoonLight's harmonic audio engine is here — spectrum, drum kit, strings and keyboard effects that answer the music. Musicians: please poke holes in it
MoonLight now analyzes music harmonically, not just by loudness, and four effects show it. Same pipeline on every board (ESP32, Teensy, Pi, desktop): the input (mic, line-in, or audio sync over the network) runs at 24 kHz through a 31-band third-octave filter bank (IEC 61260-1 style). On top of the bands: a learned noise floor and gate (a quiet room stays dark), per-band onset detection, and from the semitone notes a 12-pitch-class chroma, the detected key, and harmony changes. Beat tracking (tempo, beat phase, downbeat from chord changes) is the next step and in progress.
What the effects show:
- AudioSpectrum — bars in one of three modes: the 16 WLED-style bars, the third-octave bands, or the 79 semitone notes as bars (the piano's keys, so a melody reads as a little piano roll); over them a row of the 12 pitch classes lighting as they sound, plus the strongest three and the key (e.g. "C E G", "Am +12") in the corners. It's the test instrument: raw levels, gate and peak line included.
- DrumKit — kick, snare and hi-hat from the bass/mid/treble onsets, four toms from the 80–400 Hz third-octave bands, each hit glowing and fading, the kit dim between hits.
- Strings — guitar/bass/violin/cello in a wooden enclosure: every sounding note lights the string at the fret it's played, frets numbered, open-string names at the bridge, per-instrument emblem. Struck notes flash and fade.
- Keyboard — a two-half piano: struck keys take their palette color across the shown octaves, and the bottom half shows one circle per sounding octave on every key, with note letters and the pitch classes/key readout.
What we'd love tested, especially from people with a musical background: does the key detection read your songs right? Does the kick land on any song (try drum & bass, techno with a 909, unquantized swing)? Do the chord changes in the spectrum row step where you hear them (try "Let It Be" — C/G/Am/F every two beats; Satie's Gymnopédie — two chords trading; Pachelbel's Canon)? Do the bars pump or stay steady between loud and quiet passages?
What could be better (honest list): beat/bar tracking lands next (tempo + phase + downbeat, with tap tempo as the escape route), Strings wants more instruments and tunings, and a palette that turns per bar is on the plan. If something reads wrong — wrong key, missed kick, bars that jump — that's exactly the feedback we need.
Docs and install: https://moonmodules.org/MoonLight/ · source and issues: https://github.com/MoonModules/MoonLight · Discord: https://discord.gg/TC8NSUSCdV (there's a #moonlight-test channel with a "what to play" list)