fsh::stk
fantastic spatial holophonic synthesis toolkit
Loading...
Searching...
No Matches
MoogVCF.h
1/***************************************************************************************************
2 ██████ █████ █████ █████
3 ███░░███ ░░███ ░░███ ░░███
4 ░███ ░░░ █████ ░███████ ██ ██ █████ ███████ ░███ █████
5 ███████ ███░░ ░███░░███ ░░ ░░ ███░░ ░░░███░ ░███░░███
6 ░░░███░ ░░█████ ░███ ░███ ░░█████ ░███ ░██████░
7 ░███ ░░░░███ ░███ ░███ ░░░░███ ░███ ███ ░███░░███
8 █████ ██████ ████ █████ ██ ██ ██████ ░░█████ ████ █████
9 ░░░░░ ░░░░░░ ░░░░ ░░░░░ ░░ ░░ ░░░░░░ ░░░░░ ░░░░ ░░░░░
10
11 fantastic spatial holophonic synthesis tool kit
12
13 copyright (c) fabian hummel
14 www.github.com/fshstk
15 www.fshstk.com
16
17 this file is part of the fantastic spatial holophonic synthesis toolkit (fsh::stk)
18 fsh::stk is free software: it is provided under the terms of the gnu general public license v3.0
19 www.gnu.org/licenses/gpl-3.0
20***************************************************************************************************/
21
22#pragma once
23#include <array>
24
25namespace fsh::fx
26{
48{
49public:
51
52 struct Params
53 {
54 float cutoff = 1'000.0f;
55 float resonance = 0.1f;
56 };
57
59 void setParams(const Params&);
60
62 void setSampleRate(double);
63
65 float processSample(float);
66
68 void reset();
69
70private:
71 void calculateCoefficients();
72
73 Params _params;
74 double _sampleRate;
75 double _resCoeff;
76 double _p;
77 double _k;
78 std::array<double, 4> _stage = {};
79 std::array<double, 4> _delay = {};
80};
81} // namespace fsh::fx
Virtual analog Moog-style lowpass filter.
Definition MoogVCF.h:48
void reset()
Reset the filter state.
Definition MoogVCF.cpp:74
void setParams(const Params &)
Set the filter parameters.
Definition MoogVCF.cpp:29
void setSampleRate(double)
Set the sample rate in Hz.
Definition MoogVCF.cpp:35
float processSample(float)
Filter a single sample.
Definition MoogVCF.cpp:41
Parameters for the filter.
Definition MoogVCF.h:53
float cutoff
Filter cutoff frequency in Hz.
Definition MoogVCF.h:54
float resonance
Filter resonance.
Definition MoogVCF.h:55