code wiki / _hdl_build / nx_audio_bark.nx

nx_audio_bark.nx

buildroot/runtime/_hdl_build/nx_audio_bark.nx

5980 B143 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tooltopic audio
docsdependenciesstructsconstsfunctions

about

nx_audio_bark.nx -- dog BARK + GROWL via SOURCE-FILTER synthesis, COMPOSED from the canonical engine (operator 2026-06-24: dedup must ABSORB capabilities + keep the most s-class). The formant source-filter (pitched glottal pulse train -> driven formant-resonator bandpasses) is the NEW capability this organ keeps. DEDUP: cosine now comes from nx_audio_osc.osc_cos_s (one cosine), and the growl rasp uses nx_audio_sfx.sfx_noise (xorshift -- the engine's good noise, replacing this organ's old inferior LCG). 48kHz, peak-normalized no-clip, lossless PCM. First-iteration timbre -- tune by ear. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_audio_osc.nx nx_audio_sfx.nx nx_audio_wav.nx nx_audio_bark.nx

imports: nx_audio_osc.nxnx_audio_sfx.nxnx_audio_wav.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main bp clr build_woof clr ↻ add_formant osc_cos_s osc_qm env normalize peak b_abs save_wav wav_render_stereo wav_put_str wav_put_u32 wav_put_u16 wav_put_i16 wav_save sys_openat_wr sys_write sys_close bpn peak ↻ sfx_noise sys_mmap sfx_rng add_formant ↻ env ↻

structs

none

consts

10const K_MAGIC_411774: i64 = 411774
11const K_MAGIC_62915: i64 = 62915
12const K_MAGIC_1700: i64 = 1700
13const K_MAGIC_2600: i64 = 2600
14const K_MAGIC_60000: i64 = 60000
15const K_MAGIC_7777: i64 = 7777
16const K_MAGIC_1100: i64 = 1100
18const SR: i64 = 48000
19const NS: i64 = 48000 // 1.0 s
20const AMP: i64 = 12000

functions

22func bp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
23func bpn(v: i64) -> i64
called by 1: main
31func b_abs(v: i64) -> i64 { if v<0 { return 0-v } return v }
called by 1: peak
34func add_formant(acc: *i64, src: *i64, n: i64, F: i64, r: i64) -> i64
called by 2: build_woofmain calls 1: osc_cos_s
49func clr(a: *i64, n: i64) -> i64 { var i: i64=0; while i<n { a[i]=0; i=i+1 } return 0 }
called by 2: build_woofmain
50func peak(a: *i64, n: i64) -> i64 { var m: i64=0; var i: i64=0; while i<n { let v: i64=b_abs(a[i]); if v>m{m=v} i=i+1 } return m }
called by 2: normalizemain calls 1: b_abs
51func normalize(a: *i64, n: i64) -> i64
called by 1: main calls 1: peak
56func env(a: *i64, n: i64) -> i64
called by 2: build_woofmain
68func build_woof(acc: *i64, src: *i64, wn: i64) -> i64
called by 1: main calls 3: clradd_formantenv
83func save_wav(L: *i64, R: *i64, path: *u8) -> i64
called by 1: main calls 2: wav_render_stereowav_save
89func main() -> i64