code wiki / _hdl_build / nx_audio_bark.nx
nx_audio_bark.nx
buildroot/runtime/_hdl_build/nx_audio_bark.nx
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
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
structs
| none |
consts
| 10 | const K_MAGIC_411774: i64 = 411774 |
| 11 | const K_MAGIC_62915: i64 = 62915 |
| 12 | const K_MAGIC_1700: i64 = 1700 |
| 13 | const K_MAGIC_2600: i64 = 2600 |
| 14 | const K_MAGIC_60000: i64 = 60000 |
| 15 | const K_MAGIC_7777: i64 = 7777 |
| 16 | const K_MAGIC_1100: i64 = 1100 |
| 18 | const SR: i64 = 48000 |
| 19 | const NS: i64 = 48000 // 1.0 s |
| 20 | const AMP: i64 = 12000 |
functions
| 22 | func 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 |
| 23 | func bpn(v: i64) -> i64 called by 1: main |
| 31 | func b_abs(v: i64) -> i64 { if v<0 { return 0-v } return v } called by 1: peak |
| 34 | func add_formant(acc: *i64, src: *i64, n: i64, F: i64, r: i64) -> i64 |
| 49 | func clr(a: *i64, n: i64) -> i64 { var i: i64=0; while i<n { a[i]=0; i=i+1 } return 0 } |
| 50 | func 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 } |
| 51 | func normalize(a: *i64, n: i64) -> i64 |
| 56 | func env(a: *i64, n: i64) -> i64 |
| 68 | func build_woof(acc: *i64, src: *i64, wn: i64) -> i64 |
| 83 | func save_wav(L: *i64, R: *i64, path: *u8) -> i64 |
| 89 | func main() -> i64 |