ofxPDSP
VAFilter.h
1 
2 // VAFilter.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016-2018
5 
6 #ifndef PDSP_MODULE_VAFILTER_H_INCLUDED
7 #define PDSP_MODULE_VAFILTER_H_INCLUDED
8 
9 #include "../../DSP/pdspCore.h"
10 #include "../../DSP/filters/MultiLadder4.h"
11 #include "../../DSP/utility/PitchToFreq.h"
12 
13 
14 namespace pdsp{
15 
20 class VAFilter : public Patchable {
21 
22 
23 
27 class Submodule : public Patchable{
28 public:
29  Submodule();
30 private:
31  MultiLadder4 filter;
32  Switch fswitch;
33 };
39 public:
40  VAFilter(){ patch(); };
41  VAFilter(const VAFilter& other){ patch(); };
42  VAFilter& operator=(const VAFilter& other){ return *this; };
43  ~VAFilter();
44 
45 
50 
55 
56 
61 
66 
67 
71  Patchable& in_reso();
72 
86  Patchable& in_mode();
87 
92  void channels( size_t size );
93 
98  Patchable& ch( size_t index );
99 
100 
104  float meter_cutoff() const;
105 
106 
107  static const float LowPass24;;
108  static const float LowPass12;
109  static const float HighPass24;
110  static const float HighPass12;
111  static const float BandPass24;
112  static const float BandPass12;
113 
117  [[deprecated("operator[] deprecated, use the ch( int index ) method instead")]]
118  Patchable& operator[]( size_t index );
119 
120  [[deprecated("in_0() deprecated for this module, use the ch( 0 ) method instead")]]
121  Patchable& in_0();
122 
123  [[deprecated("in_1() deprecated for this module, use the ch( 1 ) method instead")]]
124  Patchable& in_1();
125 
126  [[deprecated("out_0() deprecated for this module, use the ch( 0 ) method instead")]]
127  Patchable& out_0();
128 
129  [[deprecated("out_1() deprecated for this module, use the ch( 1 ) method instead")]]
130  Patchable& out_1();
131 
132  [[deprecated("in_L() deprecated for this module, use the ch( 0 ) method instead")]]
133  Patchable& in_L();
134 
135  [[deprecated("in_R() deprecated for this module, use the ch( 1 ) method instead")]]
136  Patchable& in_R();
137 
138  [[deprecated("out_L() deprecated for this module, use the ch( 0 ) method instead")]]
139  Patchable& out_L();
140 
141  [[deprecated("out_R() deprecated for this module, use the ch( 1 ) method instead")]]
142  Patchable& out_R();
147 private:
148  void patch ();
149 
150  PatchNode reso;
151  PatchNode mode;
153 
154  std::vector<Submodule*> submodules;
155 
156 };
157 
158 } // pdsp namespace end
159 
160 
161 #endif // PDSP_MODULE_VAFILTER_H_INCLUDED
Multi-mode virtual analog ladder filter. Multichannel.
Definition: VAFilter.h:20
A Unit with no dsp inside, it let you switch between different connected inputs and process and pass ...
Definition: Switch.h:20
Patchable & in_pitch()
Sets "pitch" as selected input and returns this module ready to be patched. This is the filter cutoff...
Definition: VAFilter.cpp:167
Patchable & in_cutoff()
Sets "pitch" as selected input and returns this module ready to be patched. This is the filter cutoff...
Definition: VAFilter.cpp:171
float meter_cutoff() const
Returns the cutoff pitch value.
Definition: VAFilter.cpp:183
4 pole Multimode Ladder Virtual Analog Filter
Definition: MultiLadder4.h:18
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
Converts pitch values to frequency values.
Definition: PitchToFreq.h:19
Patchable & in_signal()
Sets "signal" as selected input and returns this module ready to be patched. This is the default inpu...
Definition: VAFilter.cpp:159
Patchable & ch(size_t index)
Uses the selected channel as input/output for the patching operation.
Definition: VAFilter.cpp:64
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
Patchable & out_signal()
Sets "signal" as selected output and returns this module ready to be patched. This is the default out...
Definition: VAFilter.cpp:163
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
void channels(size_t size)
Allocate a number of channels for processing different inputs. This is automatically called if you qu...
Definition: VAFilter.cpp:43
Patchable & in_reso()
Sets "reso" as selected input and returns this module ready to be patched. This is the filter resonan...
Definition: VAFilter.cpp:175
Patchable & in_mode()
Sets "mode" as selected input and returns this module ready to be patched. This control switches the ...
Definition: VAFilter.cpp:179