Skip to main content

Module vec

Module vec 

Source
Expand description

Vector operations for batch audio processing.

Each op has two code paths: an inline Rust fallback (always available) and a host-accelerated import (used when sesh_vec_version() > 0). The SDK selects the path at runtime. Plugin authors call the same functions regardless of platform.

Structs§

BiquadState
Internal state for a biquad filter (two-sample history).
EnvelopeState
Internal state for an envelope follower.

Enums§

EnvelopeMode
Envelope follower detection mode.
FilterType
Biquad filter type.
Waveform
Oscillator waveform shape.

Functions§

vec_abs
Absolute value: dst[i] = |src[i]|.
vec_add
Element-wise addition: dst[i] = a[i] + b[i].
vec_add_scalar
Add scalar to every element: dst[i] += value.
vec_biquad
Biquad filter with per-sample modulation of cutoff, Q, and gain.
vec_clamp
Clamp: dst[i] = clamp(src[i], min, max).
vec_copy
Copy src into dst.
vec_delay_read
Per-sample modulated delay read with linear interpolation.
vec_div
Element-wise division: dst[i] = a[i] / b[i].
vec_envelope
Envelope follower. Tracks amplitude of src with attack/release smoothing.
vec_fill
Fill dst with a constant value.
vec_hard_clip
Hard clipping: clamp src to ±threshold[i].
vec_mul
Element-wise multiplication: dst[i] = a[i] * b[i].
vec_mul_add
Multiply and accumulate: dst[i] += src[i] * gain.
vec_mul_scalar
Multiply every element by scalar: dst[i] *= value.
vec_neg
Negate: dst[i] = -src[i]. Phase inversion.
vec_osc
Fill dst with oscillator output. Advances *phase. freq is in Hz.
vec_pow
Element-wise power: dst[i] = src[i].powf(exp[i]).
vec_recip
Reciprocal: dst[i] = 1.0 / src[i].
vec_ring_read
Read dst.len() contiguous samples from circular buffer at pos - offset, wrapping.
vec_ring_write
Write src into circular buffer buf starting at *pos, wrapping at buf.len(). Advances *pos by src.len().
vec_sqrt
Square root: dst[i] = sqrt(src[i]).
vec_tanh
Soft saturation: dst[i] = tanh(src[i] * drive[i]).