code wiki / (root) / nx_audio_synth.nx

nx_audio_synth.nx

buildroot/runtime/nx_audio_synth.nx

2081 B59 linesdepth 3pulls 3 transitivereach 21 importersview sourcekind librarytopic audio
docsdependenciesstructsconstsfunctions

about

nx_audio_synth.nx -- SOVEREIGN AUDIO ENGINE rung R3b: sine + ADSR envelope. osc_sine: a clickless tone via a sovereign PARABOLIC sine approximation (no trig lib) -- exact at 0/peak/trough, smooth between; a higher-precision table is a later refinement (honest: ~few% THD, not a pure sinusoid). adsr_apply: Attack/Decay/Sustain/Release amplitude shaping (Q8 gain) so notes fade in/out instead of clicking -- what makes synths musical. Reuses ae_clamp (R0). license_tier: ORIGINAL.

dependencies 2 imports · 8 importers

nx_syscalls.nx nx_audio_mix.nx nx_audio_synth.nx nx_audio_sfx.nx nx_audio_sfx_test.nx nx_audio_sfx_web.nx nx_audio_sfx_web_test.nx nx_audio_song_test.nx nx_audio_synth_test.nx nx_audio_web.nx nx_audio_web_test.nx

imports: nx_syscalls.nxnx_audio_mix.nx

imported by: nx_audio_sfx.nxnx_audio_sfx_test.nxnx_audio_sfx_web.nxnx_audio_sfx_web_test.nxnx_audio_song_test.nxnx_audio_synth_test.nxnx_audio_web.nxnx_audio_web_test.nx

structs

none

consts

13const SY_PHASE: i64 = 65536 // one cycle (Q16)

functions

16func osc_sine(out: *i64, n: i64, freq: i64, rate: i64, amp: i64) -> i64
37func adsr_apply(buf: *i64, n: i64, a: i64, d: i64, sl: i64, slen: i64, r: i64) -> i64