Expand description
Spectral-first audio truth layer — mmap sidecar headers + zero-heap hot views.
Cold path: STFT/CQT sheets under {storage}/spectral/audio/{hash}.bin.
Hot path: fixed SPECTRAL_PREVIEW_BINS stack preview derived from Tensor10D.
Structs§
- Audio
Spectral Sheet View - Zero-heap generative sheet view for U3 worklet / parametric DSP.
- Audio
Spectral Sidecar Header - Cold mmap header for STFT/CQT sidecars (frames follow as
f32raster). - Spectral
V2Sub Header - Fixed 12-byte sub-header introducing the appended v2 planes. Sits immediately
after plane-0 (
header + frame_count × bin_countf32); followed by the mel plane (frame_count × n_melf32) then the MFCC plane (frame_count × n_mfccf32). All f32, row-major by frame.
Constants§
- SIDECAR_
KIND_ CQT - SIDECAR_
KIND_ STFT - Sidecar transform kind stored in
AudioSpectralSidecarHeader._pad. - SPECTRAL_
PREVIEW_ BINS - SPECTRAL_
SIDECAR_ MAGIC - SPECTRAL_
V2_ SUBHEADER_ MAGIC - Magic for the v2 sub-header that precedes the mel/MFCC planes (“Q4M2”).
Functions§
- bake_
spectral_ v2_ from_ samples - Bake a Q4AU-v2 sidecar from REAL audio
samples. - copy_
sidecar_ frame_ to_ preview_ bins - Copy one sidecar frame into a fixed preview bin array (hot U3 path, zero-heap).
- parse_
sidecar_ header - Parse sidecar header from a byte slice (cold ingest / mmap pin).
- parse_
v2_ subheader - Parse the v2 sub-header from a v2 sidecar (validates magic and counts).
- preview_
bins_ from_ tensor - Map 10D tensor channels to 64-bin spectral preview (stack only, no heap).
- sidecar_
frame_ view - Frame column from mmap sidecar at
frame_index(cold playback). - sidecar_
mel_ frame_ view - Mel band vector for
frame_indexfrom a v2 sidecar (n_melf32), orNoneif the file is not a valid v2 sidecar or the index/planes are out of range. - sidecar_
mfcc_ frame_ view - MFCC coefficient vector for
frame_indexfrom a v2 sidecar (n_mfccf32), orNoneif the file is not a valid v2 sidecar or the index/planes are out of range. - v2_
sidecar_ size - Total byte size of a Q4AU-v2 sidecar with the given geometry.