code wiki / (root) / nx_polypitch_gate.nx

nx_polypitch_gate.nx

buildroot/runtime/nx_polypitch_gate.nx

4634 B134 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_polypitch_gate.nx -- REFEREE for LG-3 polyphony (nx_polypitch). Synthesizes chords as sums of pure sine tones and checks the detected NOTE SET: single A3 (220) -> {57} (neg-control: 1 note, not a chord) A major (220,277,330) -> {57,61,64} (A3, C#4, E4) power chord (220,330) -> {57,64} (A3, E4) C major (261,330,392) -> {60,64,67} (C4, E4, G4) -- different chord, different set Evidence -> stdout + knowledge/status/polypitch_gate.log. Exit 0 GREEN / 1 RED. Sovereign x86_64 throughout. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls_x86_64.nx nx_polypitch.nx nx_note.nx nx_polypitch_gate.nx

imports: nx_syscalls_x86_64.nxnx_polypitch.nxnx_note.nx

imported by: nobody (leaf or entry point)

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

main sys_openat_append gp nx_note_table make_chord add_sine nx_pp_sinfull nx_pp_cosfull nx_pp_cosq16 nx_polypitch nx_pp_cosq16 ↻ _pp_goertzel _pp_i16 pdet gp ↻ gn

structs

none

consts

15const N: i64 = 1024
16const FS: i64 = 8000
17const MLO: i64 = 50
18const MHI: i64 = 72
19const AMP: i64 = 10000
20const TWO_PI: i64 = 411775

functions

22func gp(logfd: i64, s: *u8) -> i64
called by 2: pdetmain
29func gn(logfd: i64, v: i64) -> i64
called by 1: pdet
44func add_sine(acc: *i64, f: i64, amp: i64) -> i64
called by 1: make_chord calls 1: nx_pp_sinfull
57func make_chord(acc: *i64, buf: *u8, f1: i64, f2: i64, f3: i64) -> i64
called by 1: main calls 1: add_sine
79func pdet(logfd: i64, label: *u8, det: *i64, cnt: i64) -> i64
called by 1: main calls 2: gpgn
88func main() -> i64