ofxPDSP
SVFilter.h
1 
2 // SVFilter.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2018
5 
6 #ifndef PDSP_MODULE_SVFILTER_H_INCLUDED
7 #define PDSP_MODULE_SVFILTER_H_INCLUDED
8 
9 #include "../../DSP/pdspCore.h"
10 #include "../../DSP/filters/SVF2.h"
11 #include "../../DSP/utility/PitchToFreq.h"
12 
13 
14 namespace pdsp{
15 
20 class SVFilter : public Patchable {
21 
22 
23 
27 class Submodule : public Patchable{
28 public:
29  Submodule();
30 private:
31  SVF2 filter;
32  Switch fswitch;
33 };
39 public:
40  SVFilter(){ patch(); };
41  SVFilter(const SVFilter& other){ patch(); };
42  SVFilter& operator=(const SVFilter& other){ return *this; };
43  ~SVFilter();
44 
49 
54 
55 
60 
65 
66 
70  Patchable& in_reso();
71 
82  Patchable& in_mode();
83 
88  void channels( size_t size );
89 
94  Patchable& ch( size_t index );
95 
99  float meter_cutoff() const;
100 
101 
102  static const float LowPass;;
103  static const float BandPass;
104  static const float HighPass;
105  static const float Notch;
106 
110  [[deprecated("operator[] deprecated, use the ch( int index ) method instead")]]
111  Patchable& operator[]( size_t index );
112 
113  [[deprecated("in_0() deprecated for this module, use the ch( 0 ) method instead")]]
114  Patchable& in_0();
115 
116  [[deprecated("in_1() deprecated for this module, use the ch( 1 ) method instead")]]
117  Patchable& in_1();
118 
119  [[deprecated("out_0() deprecated for this module, use the ch( 0 ) method instead")]]
120  Patchable& out_0();
121 
122  [[deprecated("out_1() deprecated for this module, use the ch( 1 ) method instead")]]
123  Patchable& out_1();
124 
125  [[deprecated("in_L() deprecated for this module, use the ch( 0 ) method instead")]]
126  Patchable& in_L();
127 
128  [[deprecated("in_R() deprecated for this module, use the ch( 1 ) method instead")]]
129  Patchable& in_R();
130 
131  [[deprecated("out_L() deprecated for this module, use the ch( 0 ) method instead")]]
132  Patchable& out_L();
133 
134  [[deprecated("out_R() deprecated for this module, use the ch( 1 ) method instead")]]
135  Patchable& out_R();
141 private:
142  void patch ();
143 
144  PatchNode reso;
145  PatchNode mode;
147 
148  std::vector<Submodule*> submodules;
149 
150 };
151 
152 } // pdsp namespace end
153 
154 
155 #endif // PDSP_MODULE_SVFILTER_H_INCLUDED
Multi-mode virtual analog state variable filter. Multichannel.
Definition: SVFilter.h:20
A Unit with no dsp inside, it let you switch between different connected inputs and process and pass ...
Definition: Switch.h:20
2pole Virtual Analog State Variable Filter
Definition: SVF2.h:20
void channels(size_t size)
Allocate a number of channels for processing different inputs. This is automatically called if you qu...
Definition: SVFilter.cpp:39
Patchable & out_signal()
Sets "signal" as selected output and returns this module ready to be patched. This is the default out...
Definition: SVFilter.cpp:160
Patchable & in_signal()
Sets "signal" as selected input and returns this module ready to be patched. This is the default inpu...
Definition: SVFilter.cpp:156
float meter_cutoff() const
Returns the cutoff pitch value.
Definition: SVFilter.cpp:180
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
Patchable & in_mode()
Sets "mode" as selected input and returns this module ready to be patched. This control switches the ...
Definition: SVFilter.cpp:176
Patchable & ch(size_t index)
Uses the selected channel as input/output for the patching operation.
Definition: SVFilter.cpp:60
Patchable & in_reso()
Sets "reso" as selected input and returns this module ready to be patched. This is the filter resonan...
Definition: SVFilter.cpp:172
Converts pitch values to frequency values.
Definition: PitchToFreq.h:19
float p2f(float pitch)
take a pitch value as input an returns a frequency value. Standard reference tuning is 440hz...
Definition: ofxPDSPFunctions.cpp:60
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
A Unit with no dsp inside, it just pass it&#39;s input to the output. Patching float to this Unit is thre...
Definition: PatchNode.h:41
Patchable & in_pitch()
Sets "pitch" as selected input and returns this module ready to be patched. This is the filter cutoff...
Definition: SVFilter.cpp:164
Patchable & in_cutoff()
Sets "pitch" as selected input and returns this module ready to be patched. This is the filter cutoff...
Definition: SVFilter.cpp:168