Skip to content

SemanticCompute v1.13.0

Choose a tag to compare

@entertrainment entertrainment released this 31 Aug 23:20
· 1 commit to main since this release

SemanticCompute v1.13.0 — the percussion-discrimination lane

A minor, by the rule: two additive families (catalogue 149 → 151). This is the release for anyone whose
onset detector or drum classifier keeps confusing instruments that live a few semitones apart below 100 Hz —
the requesting consumer had two independent models fail the same held-out kick/conga discrimination before
the defect was traced to linear-frequency smearing, not to either model.

Added

Constant-Q / Variable-Q spectrogram — per-bin Q-matched window lengths on a log-frequency axis: fine
frequency resolution at the bottom where neighbouring instruments separate, fine time resolution at the top
where they don't need it. The principled fix for the fixed-window STFT's single time-frequency tradeoff.

  • The marquee test is the failure in miniature: simultaneous 55 Hz and 65.4 Hz tones — three semitones,
    kick-versus-conga territory — resolve into distinct local maxima with a valley between.
  • γ = 0 reproduces constant-Q bit-exactly (Variable-Q is the same kernel; test-pinned).
  • The maxWindow clamp is honest: clamped bins are reported and run at reduced Q, rather than the plan
    silently pretending to the nominal bins-per-octave resolution.
  • The binding-gap check is recorded in the family header: BatchedDTFT (unframed, one length),
    Goertzel/Chromagram (framed, one shared length) and STFT all near-miss this shape; the new thing is
    the per-bin window length bound to the log-frequency grid with all bins sharing a temporal centre.
  • GPU parity measured, not defaulted: 3.0e-7 absolute / 2.9e-5 relative on the fixture, against a stated
    5e-5 / 5e-4 contract bar (~17× relative headroom for transcendental drift over the longest windows).

Complex-domain onset functions (pd / wpd / nwpd / cd / rcd) — the five classical phase-aware ODFs over a
complex STFT, for the magnitude-flux blind spot: a second hit entering DURING another's ring hides its energy
under the old partial, but not its phase.

  • princarg-wrapped with round-half-to-even on both backends: a steady tone crossing ±π never fires
    (test-pinned — an unwrapped detector fires on every wrap).
  • Rectification pinned: an offset (energy dropping out) that plain complex deviation honestly counts, the
    rectified variant must ignore.
  • Frames 0 and 1 are 0 by definition — two frames of history are required, and fabricating them would
    manufacture an onset at the file start.
  • GPU parity measured across all five variants: 4.8e-7 relative against a stated 1e-4 / 1e-3 bar.

A trap found by the family's own tests, stated rather than patched: the atan2 phase of an exactly-zero
bin is sign-bit garbage (0, π or −π on signed zeros alone), and pd — the one unweighted variant — reads it
at full scale
. That is pd's documented weakness in the onset literature, reproduced faithfully: a test pins
pd going noisy on a zero bin while wpd stays clean on the same spectrum, and the usage guide steers
silent-bin spectra to the weighted variants.

Composes with what already ships

The requesting pipeline's remaining stages need no new families: MFCC = Mel spectrogramDCT-II,
deltas via Batched FIR, per-band normalisation via Robust per-column standardise (median/MAD — the right
choice when a loud kick is the outlier), cepstral deconvolution via FFT → log-magnitude → InverseFFT.

Verification surface: 1,137 tests in 245 suites; the kernel-compile sweep covers 352 programs across 211
lowerings, 0 failed. Four lowering targets, three executed in-core (Metal, portable C, WGSL) plus the
externally verified CUDA runner.