nx_pitch_grade_gate.nx
buildroot/runtime/nx_pitch_grade_gate.nx
about
nx_pitch_grade_gate.nx -- REFEREE for the singing-tutor grader (nx_pitch_grade).
Generates pure impulse-train test "notes" at exact frequencies (fs/period) and
grades them against a target note (125 Hz):
ON : sung at 125 Hz (period 64) -> |cents| <= 25, verdict ON
SHARP : sung at 129 Hz (period 62) -> cents > 25, verdict SHARP
FLAT : sung at 121 Hz (period 66) -> cents < -25, verdict FLAT
MELODY: three on-pitch notes 100/125/160 Hz all grade ON (a sung phrase)
NEG-CONTROL: white noise -> NO_PITCH (never a false on-pitch grade)
Every value PRINTED. Evidence -> stdout + knowledge/status/pitch_grade_gate.log.
Exit 0 GREEN / 1 RED. Sovereign x86_64 throughout.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls_x86_64.nxnx_pitch_grade.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
| 17 | const FS: i64 = 8000 |
| 18 | const MINLAG: i64 = 25 |
| 19 | const MAXLAG: i64 = 114 |
| 20 | const WIN: i64 = 480 |
| 21 | const NS: i64 = 1024 |
functions
| 23 | func gp(logfd: i64, s: *u8) -> i64 |
| 30 | func gn(logfd: i64, v: i64) -> i64 |
| 46 | func gen_tone(out_pcm: *u8, nsamp: i64, period: i64) -> i64 called by 1: main |
| 58 | func gen_noise(out_pcm: *u8, nsamp: i64) -> i64 called by 1: main |
| 74 | func grade1(logfd: i64, label: *u8, pcm: *u8, target: i64, out: *i64) -> i64 |
| 85 | func main() -> i64 |