Skip to main content

Module signal

Module signal 

Source
Expand description

Pure, deterministic PCM signal synthesis for the capture / visual-QA path (Plan 0013). These generate synthetic signals by math over a sample clock — they are not an audio source (no WASAPI, no file, no OS), so they live in the source-agnostic core and can be fed straight through the real Analyzer to exercise the actual DSP.

Every generator is a pure function of its arguments — no wall clock, seeded randomness only (NFR section 6). Output is interleaved f32 frames matching the given AudioFormat, the same shape a frontend pushes into the intake.

Functions§

bass_sine
A strong low-frequency sine (bass band). Thin wrapper over sine.
chord
A sum of sines at freqs for secs, scaled so the peak stays within ±0.9.
click_track
A metronome click track at bpm for secs: a short decaying broadband burst on each beat, silence between. Fed through the real analyzer it produces an onset (and a beat flag) on each click, ~60/bpm seconds apart.
dynamic_groove
An envelope-shaped, beat-gridded signal with dynamics at bpm for secs — the one generator here that rises and falls (Plan 0037, ADR-0039).
halftime_click_track
A sparse half-time feel at bpm: full clicks on beats 1 and 3, weak times that on beats 2 and 4 — the half-time trap (Plan 0095 Phase 1).
noise
Seeded white noise in [-amplitude, amplitude], deterministic per seed.
offbeat_click_track
A click track at bpm carrying an extra click on every off-beat, at offbeat times the on-beat amplitude — the double-time trap (Plan 0095 Phase 1).
sine
A pure sine at freq_hz and amplitude for secs, interleaved to format.channels.
treble_tone
A strong high-frequency sine (treble band). Thin wrapper over sine.