valdanylchuk/breezy_sound

1.1.0

Latest
uploaded 1 hour ago
breezy_sound: 8-voice synth mixer, PICO-8 sfx/music tracker, and PCM stream API used in BreezyBox, a mini shell for esp32

Readme

# breezy_sound

The BreezyBox sound engine: an 8-voice PICO-8-flavored synth mixer, a
4-channel PICO-8 sfx/music tracker for game ports, and a single raw PCM
stream, mixed by a background task at 44.1 kHz s16 and fed to the board's
audio output. `snd_core.h` and `snd_p8.h` are the APIs that loadable ELF
apps (soundkeys, moddy, game ports, ...) link against by symbol name, so
they stay identical across boards.

Three front ends, one fixed-point oscillator core (`snd_osc.h`, waveform
shapes and amplitudes measured against PICO-8 via zepto8):

- `snd_note_on/off` — live voices with attack/release envelopes (music
  keyboards, synth apps)
- `snd_p8_load/sfx/music/stop` — fire-and-forget PICO-8 cart sound: load
  the sfx/pattern data once, then call `sfx()`/`music()` like the cart does;
  sequencing runs inside the mixer task
- `snd_stream_*` — raw PCM for apps that render their own audio (modplay)

The engine is hardware-agnostic. Each firmware project supplies one
`snd_port.c` implementing the small contract in `snd_port.h`:

- `snd_port_desc` — output format (mono/stereo) and the per-speaker limiter ceiling
- `snd_port_init()` — set up the codec/I2S path, leave it stopped
- `snd_port_start()` / `snd_port_stop()` — power the output up/down
- `snd_port_write()` — blocking write of one rendered chunk (this
  back-pressure paces the mixer)

See the reference ports in the BreezyBox repo:
`examples/p4-tanmatsu/main/snd_port.c` (ES8156 codec via badge-bsp, stereo)
and `examples/s3-waveshare/main/snd_port.c` (MAX98357A mono amp, bare I2S).

Remember to export the `snd_*` symbols to ELF apps in your firmware's
customer symbol table (see the examples' `elf_extras.c`).

## License

MIT

Links

Maintainer

  • Valentyn Danylchuk <val@danylchuk.com>
To add this component to your project, run:

idf.py add-dependency "valdanylchuk/breezy_sound^1.1.0"

download archive

Stats

  • Archive size
    Archive size ~ 19.65 KB
  • Downloaded in total
    Downloaded in total 1 time
  • Weekly Downloads Weekly Downloads (All Versions)
  • Downloaded this version
    This version: 0 times

Badge

valdanylchuk/breezy_sound version: 1.1.0
|