code wiki / (root) / nx_chord_grade_gate.nx

nx_chord_grade_gate.nx

buildroot/runtime/nx_chord_grade_gate.nx

6498 B181 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_chord_grade_gate.nx -- REFEREE for LG-4 chord-aware grading (nx_chord_grade). SONG (4 slots): A3 | A-major(A3,C#4,E4) | power-5th(A3,E4) | C-major(C4,E4,G4). Three performances are synthesized (sum-of-sine chords per slot) and graded: GOOD : every slot played correctly -> 1000, all HIT BAD : disjoint wrong notes every slot -> 0, all WRONG (neg-control) PARTIAL : A3 | only 2 of 3 | SILENT | C-maj -> 666, [HIT,PARTIAL,MISS,HIT] Evidence -> stdout + knowledge/status/chord_grade_gate.log. Exit 0 GREEN / 1 RED. Sovereign x86_64 throughout. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls_x86_64.nx nx_chord_grade.nx nx_polypitch.nx nx_note.nx nx_chord_grade_gate.nx

imports: nx_syscalls_x86_64.nxnx_chord_grade.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 setslot zero add_note add_sine_region nx_pp_sinfull nx_pp_cosfull nx_pp_cosq16 normalize nx_chord_grade nx_polypitch nx_pp_cosq16 ↻ _pp_goertzel _pp_i16 _cg_contains report gp ↻ gn

structs

none

consts

16const SLOT: i64 = 1536
17const NS: i64 = 6144
18const FS: i64 = 8000
19const AMP: i64 = 10000
20const TWO_PI: i64 = 411775

functions

22func gp(logfd: i64, s: *u8) -> i64
called by 2: reportmain
29func gn(logfd: i64, v: i64) -> i64
called by 1: report
44func add_sine_region(acc: *i64, start: i64, dur: i64, f: i64, amp: i64) -> i64
called by 1: add_note calls 1: nx_pp_sinfull
58func add_note(acc: *i64, tbl: *i64, slotstart: i64, midi: i64) -> i64
called by 1: main calls 1: add_sine_region
62func normalize(acc: *i64, buf: *u8, total: i64) -> i64
called by 1: main
79func zero(acc: *i64, total: i64) -> i64
called by 1: main
84func setslot(song: *i64, s: i64, start: i64, nt: i64, m0: i64, m1: i64, m2: i64) -> i64
called by 1: main
93func report(logfd: i64, label: *u8, score: i64, v: *i64) -> i64
called by 1: main calls 2: gpgn
103func main() -> i64