code wiki / _hdl_build / nx_audio_bowl.nx
nx_audio_bowl.nx
buildroot/runtime/_hdl_build/nx_audio_bowl.nx
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
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
structs
| none |
consts
| 15 | const K_MAGIC_1404: i64 = 1404 |
| 16 | const K_MAGIC_2333: i64 = 2333 |
| 17 | const K_MAGIC_3471: i64 = 3471 |
| 18 | const K_MAGIC_12000: i64 = 12000 |
| 19 | const K_MAGIC_7000: i64 = 7000 |
| 20 | const K_MAGIC_4500: i64 = 4500 |
| 21 | const K_MAGIC_2600: i64 = 2600 |
| 22 | const K_MAGIC_1500: i64 = 1500 |
| 23 | const K_MAGIC_65533: i64 = 65533 |
| 24 | const K_MAGIC_65531: i64 = 65531 |
| 25 | const K_MAGIC_65527: i64 = 65527 |
| 26 | const K_MAGIC_65521: i64 = 65521 |
| 27 | const K_MAGIC_65514: i64 = 65514 |
| 28 | const K_MAGIC_411774: i64 = 411774 |
| 29 | const K_MAGIC_16000: i64 = 16000 |
| 30 | const K_MAGIC_42000: i64 = 42000 |
| 31 | const K_MAGIC_65536: i64 = 65536 |
| 33 | const BLOG: *u8 = "knowledge/status/ng_audio_bowl.log" |
| 34 | const OUTP: *u8 = "web_assets/ng_singing_bowl_binaural.wav" |
| 35 | const Q16: i64 = 65536 |
| 36 | const SR: i64 = 22050 |
| 37 | const NS: i64 = 44100 // 2.0 s |
| 38 | const NMODE: i64 = 5 |
| 39 | const ITD: i64 = 11 // interaural time delay (samples) for a right-placed source (~0.5ms) |
functions
| 41 | 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 |
| 46 | func bpn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 47 | func b_abs(v: i64) -> i64 { if v<0 { return 0-v } return v } called by 1: main |
| 48 | func bqm(a: i64, b: i64) -> i64 { return (a*b)>>16 } |
| 49 | func 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 |
| 54 | func bl_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 57 | func cos_fp(x: i64) -> i64 |
| 63 | func main() -> i64 |