Multi-voice software synth (chip-tune SFX + simple music).
Drives a 4-voice synthesiser at 44.1 kHz mono into the same I2S audio output the rest of ez.audio uses. The shape is NES-derived: two pulse voices (variable duty), one triangle voice for sub-bass bodies, and one noise voice for percussion / explosions. Each voice has independent ADSR, an optional linear pitch sweep, and an optional vibrato. Voice indices (1-based from Lua): 1 = pulse A 2 = pulse B 3 = triangle 4 = noise
| Parameter | Description |
|---|---|
| voice | integer 1..4 |
| hz | number frequency in Hz (or LFSR tap rate for the noise voice) |
| vol | integer 0..255 |
| opts | table (optional) — see description |
ez.synth.note_on(1, 880, 200, { duty = 0.25, attack_ms = 0,
decay_ms = 80, sustain = 0 })
| Parameter | Description |
|---|---|
| sustain | 0..255 — fraction of peak; 0 = AD-only one-shot |