The pieces / weirdnet-dsp

weirdnet-dspnew

Small DSP building blocks: levels, fades, RBJ biquad filters and a streaming resampler, over slices with no I/O.

v0.3.0 GitHub crates.io docs.rs weirdnet-dsp = "0.3.0"

What it is

Pure functions and small state structs over f32 slices: no I/O, no audio types, no allocation in the per-block paths. Designing a filter is checked: a zero sample rate, a cutoff at or above the Nyquist frequency, a non-positive Q and non-finite values are errors, not silent garbage.

Key types and modules

  • level: dB and linear conversion, peak and RMS. fade: linear and equal-power fades in place on interleaved audio.
  • biquad: RBJ-cookbook low-pass, high-pass, band-pass and peaking filters designed from a cutoff, Q and gain, with the exact frequency response so a filter can be checked against its design; MultiBiquad filters interleaved audio with one state per channel.
  • resample: streaming sample-rate conversion on interleaved slices, whose output does not depend on how the input is cut; a windowed-sinc kernel, and set_trim to follow another device’s clock by up to 1 %.
  • stretch (feature stretch, off by default): time_stretch to an exact number of frames and pitch_shift, on the Signalsmith Stretch library (MIT); it builds C++ with bindgen, so it needs clang and libclang.

Usage

[dependencies]
weirdnet-dsp = "0.3.0"

Where it fits

  • Used by weirdnet-audio-plugin, weirdnet-streaming.
  • License: BSD-3-Clause.
Version 0.3.0 is on crates.io (docs.rs, repository).