code wiki / (root) / nx_song_grade_gate.nx

nx_song_grade_gate.nx

buildroot/runtime/nx_song_grade_gate.nx

4852 B129 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_song_grade_gate.nx -- REFEREE for the learn-game grader (LG-2, nx_song_grade). SONG = 4 target notes [A2=45, A3=57, E2=40, E3=52] at 1024-sample slots. Three performances are synthesized (impulse-train tones in each slot) and graded: GOOD : correct note in every slot -> score 1000, all HIT BAD : a wrong note in every slot -> score low, all WRONG (neg-control) PARTIAL : correct, SILENT, correct, wrong -> score 500, verdicts HIT/MISS/HIT/WRONG The BAD case is the neg-control: a wrong performance MUST score low, or the grader can't tell right from wrong. Evidence -> stdout + knowledge/status/song_grade_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_song_grade.nx nx_note.nx nx_song_grade_gate.nx

imports: nx_syscalls_x86_64.nxnx_song_grade.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 setnote put_tone nx_song_grade nx_pitch_f0 _px_i16 nx_pitch_is_voiced nx_note_of report gp ↻ gn

structs

none

consts

17const SLOT: i64 = 1024
18const NSAMP: i64 = 4096

functions

20func gp(logfd: i64, s: *u8) -> i64
called by 2: reportmain
27func gn(logfd: i64, v: i64) -> i64
called by 1: report
41func setnote(sc: *i64, i: i64, midi: i64, start: i64, dur: i64) -> i64
called by 1: main
48func put_tone(player: *u8, start: i64, dur: i64, period: i64) -> i64
called by 1: main
57func report(logfd: i64, label: *u8, score: i64, verdicts: *i64, n: i64) -> i64
called by 1: main calls 2: gpgn
67func main() -> i64