10#ifndef DSY_SMOOTHRANDOM_H
11#define DSY_SMOOTHRANDOM_H
39 void Init(
float sample_rate)
41 sample_rate_ = sample_rate;
57 interval_ = rand() * kRandFrac * 2.0f - 1.0f - from_;
59 float t = phase_ * phase_ * (3.0f - 2.0f * phase_);
60 return from_ + interval_ * t;
68 freq = freq / sample_rate_;
69 frequency_ =
fclamp(freq, 0.f, 1.f);
80 static constexpr float kRandFrac = 1.f / (float)RAND_MAX;
Smooth random generator for internal modulation. .
Definition smooth_random.h:31
float Process()
Definition smooth_random.h:50
void SetFreq(float freq)
Definition smooth_random.h:66
void Init(float sample_rate)
Definition smooth_random.h:39
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition adenv.h:16
float fclamp(float in, float min, float max)
Definition dsp.h:64