ofxPDSP
PhaserFilter.h
1 // PhaserFilter.h
2 // ofxPDSP
3 // Nicola Pisanti, MIT License, 2018
4 
5 #ifndef PDSP_MODULE_PHASERFILTER_H_INCLUDED
6 #define PDSP_MODULE_PHASERFILTER_H_INCLUDED
7 
8 #include "../../DSP/pdspCore.h"
9 #include "../../DSP/filters/APF4.h"
10 #include "../../DSP/utility/PitchToFreq.h"
11 
12 
13 namespace pdsp{
19 class PhaserFilter : public Patchable {
20 
21 public:
22  PhaserFilter();
23  PhaserFilter(const PhaserFilter& other);
24  PhaserFilter& operator=(const PhaserFilter& other);
25  ~PhaserFilter();
26 
31 
36 
41 
46 
47  /*
48  @brief Sets "spread" as selected input and returns this module ready to be patched. The value of the frequency of each pole is equal to the frequency of the pole before it plus spread multiplied by the base frequency. So at 0.0f all the pole have the same frequency, at 1.0f the poles form an harmonic series, etc etc
49  */
50  Patchable& in_spread();
51 
52 
57 
62  void channels( size_t size );
63 
68  Patchable& ch( size_t index );
69 
70 
74  float meter_pitch() const;
75 
79  [[deprecated("operator[] deprecated, use the ch( int index ) method instead")]]
80  Patchable& operator[]( size_t index );
85 private:
86 
87  void patch();
88 
89 
90  std::vector<APF4*> phasers;
91 
92  PitchToFreq p2f;
93  PatchNode fbcontrol;
94  PatchNode spreadcontrol;
95 
96 
97 };
98 
99 
100 }
101 
102 #endif //PDSP_MODULE_PHASERFILTER_H_INCLUDED
void channels(size_t size)
Allocate a number of channels for processing different inputs. This is automatically called if you qu...
Definition: PhaserFilter.cpp:24
Patchable & out_signal()
Sets "signal" as selected output and returns this module ready to be patched. This is the default out...
Definition: PhaserFilter.cpp:69
Patchable & in_feedback()
Sets "feedback" as selected input and returns this Unit ready to be patched. This is the phaser feedb...
Definition: PhaserFilter.cpp:61
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
float meter_pitch() const
returns the actual pitindex value.This method is thread-safe.
Definition: PhaserFilter.cpp:73
Patchable & in_cutoff()
Sets "pitch" as selected input and returns this module ready to be patched. This is the tuning of the...
Definition: PhaserFilter.cpp:57
Converts pitch values to frequency values.
Definition: PitchToFreq.h:19
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 & ch(size_t index)
Uses the selected channel as input/output for the patching operation.
Definition: PhaserFilter.cpp:42
A 4 pole Phaser. Multichannel.
Definition: PhaserFilter.h:19
Patchable & in_pitch()
Sets "pitch" as selected input and returns this module ready to be patched. This is the tuning of the...
Definition: PhaserFilter.cpp:53
Patchable & in_signal()
Sets "signal" as selected input and returns this module ready to be patched. This is the default inpu...
Definition: PhaserFilter.cpp:49