code wiki / _hdl_build / nx_audio_bowl.nx

nx_audio_bowl.nx

buildroot/runtime/_hdl_build/nx_audio_bowl.nx

8553 B153 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tooltopic audio
docsdependenciesstructsconstsfunctions

about

nx_audio_bowl.nx -- CAP MODAL-OBJECT-SYNTH + BINAURAL-HRTF (operator 2026-06-23: "generate copper cups like from tibet, exact binaural ... s-class audio ecosystem"). SOVEREIGN all the way up: physically-grounded MODAL synthesis of a Tibetan singing/copper bowl (a set of inharmonic resonant modes = exponentially-damped sinusoids, each generated by a 2nd-order RESONATOR recurrence y[n]=a1*y[n-1]-a2*y[n-2] -> NO per-sample sin/exp, only a per-mode cos), then BINAURAL spatialization (ITD interaural time-delay + ILD level-difference = the two dominant 3D cues) for a source placed to the right, rendered to a real 16-bit stereo .wav via our OWN sovereign WAV writer (nx_audio_wav). No float, no 3rd-party. Also a self-hypnosis/relaxation asset. Honest gate: T1 MODAL -- the bowl signal rings then DECAYS (non-silent + decreasing envelope = real modal ring, not noise/constant); T2 BINAURAL -- L/R differ with the right ear louder (ILD) and time-delayed (ITD) = a positioned 3D source; T3 WAV -- a correct-size RIFF .wav is written. HONEST: ITD+ILD binaural (full HRTF spectral filtering = follow-on); 5 modes (measured bowls have more). license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_audio_wav.nx nx_itoa_lib.nx nx_audio_bowl.nx

imports: nx_audio_wav.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main bp cos_fp bqm bqm ↻ b_abs 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 nxi_out nxi_fd sys_mmap ccz_cat_num sys_write ↻ sys_munmap sys_openat_append bl_ws bl_wn nxi_fd ↻

structs

none

consts

15const K_MAGIC_1404: i64 = 1404
16const K_MAGIC_2333: i64 = 2333
17const K_MAGIC_3471: i64 = 3471
18const K_MAGIC_12000: i64 = 12000
19const K_MAGIC_7000: i64 = 7000
20const K_MAGIC_4500: i64 = 4500
21const K_MAGIC_2600: i64 = 2600
22const K_MAGIC_1500: i64 = 1500
23const K_MAGIC_65533: i64 = 65533
24const K_MAGIC_65531: i64 = 65531
25const K_MAGIC_65527: i64 = 65527
26const K_MAGIC_65521: i64 = 65521
27const K_MAGIC_65514: i64 = 65514
28const K_MAGIC_411774: i64 = 411774
29const K_MAGIC_16000: i64 = 16000
30const K_MAGIC_42000: i64 = 42000
31const K_MAGIC_65536: i64 = 65536
33const BLOG: *u8 = "knowledge/status/ng_audio_bowl.log"
34const OUTP: *u8 = "web_assets/ng_singing_bowl_binaural.wav"
35const Q16: i64 = 65536
36const SR: i64 = 22050
37const NS: i64 = 44100 // 2.0 s
38const NMODE: i64 = 5
39const ITD: i64 = 11 // interaural time delay (samples) for a right-placed source (~0.5ms)

functions

41func 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
46func bpn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
47func b_abs(v: i64) -> i64 { if v<0 { return 0-v } return v }
called by 1: main
48func bqm(a: i64, b: i64) -> i64 { return (a*b)>>16 }
called by 2: cos_fpmain
49func bl_ws(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main
54func bl_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 1: main calls 1: nxi_fd
57func cos_fp(x: i64) -> i64
called by 1: main calls 1: bqm
63func main() -> i64