code wiki / _hdl_build / nx_gamemusic_gate.nx
nx_gamemusic_gate.nx
buildroot/runtime/_hdl_build/nx_gamemusic_gate.nx
about
nx_gamemusic_gate.nx -- CERTIFICATION of nx_gamemusic, completing `audio-sfx-music`.
The SFX half is already proven by nx_game_audio_gate (3/3, real WAV). This gate proves the MUSIC half so
the capability can honestly be called HAVE rather than inferred from SFX alone.
T1 EXACT equal-temperament octaves: A4=440 -> A5=880 -> A3=220, no drift
T2 DETERMINISTIC render: same song rendered twice -> byte-identical samples
T3 DATA-DRIVEN: a different song array produces different audio (melody is data, not code)
T4 SATURATING MIX: layering loud tracks clamps instead of wrapping (no integer-overflow crackle)
T5 PER-NOTE ENVELOPE: a note attacks then decays (it does not click on at full amplitude)
T6 ★ANTI-VACUITY: output is non-silent AND pitch is real -- a high note has strictly more
zero-crossings than a low note. Silence or a constant would satisfy T2/T4 vacuously.
T7 REAL ARTIFACT: a playable WAV is written to disk via the existing nx_audio_wav writer
T8 composes with nx_gamesave: the song DATA round-trips through save/load
license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_gamemusic.nxnx_audio_wav.nxnx_gamesave.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
| none |
functions
| 19 | func mw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 20 | func mn(v: i64) -> i64 |
| 29 | func zerocross(b: *i64, n: i64) -> i64 called by 1: main |
| 39 | func clearbuf(b: *i64, n: i64) -> i64 { var i: i64=0; while i<n { b[i]=0; i=i+1 } return 0 } called by 1: main |
| 41 | func main() -> i64 |