nx_polypitch_gate.nx
buildroot/runtime/nx_polypitch_gate.nx
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
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
structs
| none |
consts
| 15 | const N: i64 = 1024 |
| 16 | const FS: i64 = 8000 |
| 17 | const MLO: i64 = 50 |
| 18 | const MHI: i64 = 72 |
| 19 | const AMP: i64 = 10000 |
| 20 | const TWO_PI: i64 = 411775 |
functions
| 22 | func gp(logfd: i64, s: *u8) -> i64 |
| 29 | func gn(logfd: i64, v: i64) -> i64 called by 1: pdet |
| 44 | func add_sine(acc: *i64, f: i64, amp: i64) -> i64 |
| 57 | func make_chord(acc: *i64, buf: *u8, f1: i64, f2: i64, f3: i64) -> i64 |
| 79 | func pdet(logfd: i64, label: *u8, det: *i64, cnt: i64) -> i64 |
| 88 | func main() -> i64 |