ofxPDSP
Panner.h
1 
2 // Panner.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 #ifndef PDSP_MODULE_PANNER_H_INCLUDED
7 #define PDSP_MODULE_PANNER_H_INCLUDED
8 
9 #include "../../DSP/pdspCore.h"
10 
11 
12 namespace pdsp{
13 
18 class Panner : public Patchable {
19 
23  class PannerFormula : public Formula{
24 
25  float formula(const float &x) noexcept override;
26  void formulaAudioRate(float* &output, const float* &input, const int &bufferSize) noexcept override;
27 
28  };
29 
30  class SinFormula : public Formula{
31 
32  float formula(const float &x) noexcept override;
33  void formulaAudioRate(float* &output, const float* &input, const int &bufferSize) noexcept override;
34 
35  };
36 
37  class CosFormula : public Formula{
38 
39  float formula(const float &x) noexcept override;
40  void formulaAudioRate(float* &output, const float* &input, const int &bufferSize) noexcept override;
41 
42  };
46 public:
47  Panner();
48  Panner(const Panner& other);
49  Panner& operator=(const Panner& other);
50 
51 
55  float meter_pan_input();
56 
61 
65  Patchable& in_pan();
66 
70  Patchable& out_L();
71 
75  Patchable& out_R();
76 
77 
78 
82  [[deprecated("out_0() deprecated, use out_L() instead")]]
83  Patchable& out_0();
84 
85  [[deprecated("out_1() deprecated, use out_R() instead")]]
86  Patchable& out_1();
90 private:
91  void patch();
92 
93  PatchNode input;
94 
95  PannerFormula panning_step1;
96 
97  CosFormula panning_step2L;
98  SinFormula panning_step2R;
99 
100  Amp amp1;
101  Amp amp2;
102 
103 
104 };
105 
106 
107 
108 } // end namespace
109 
110 #endif // PDSP_MODULE_PANNER_H_INCLUDED
float meter_pan_input()
meter the pan value. This method is thread-safe.
Definition: Panner.cpp:60
Patchable & out_R()
Sets "R" as selected output and returns this module ready to be patched. This is the right output cha...
Definition: Panner.cpp:76
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
Patchable & in_signal()
Sets "signal" as selected input and returns this module ready to be patched. This is the default inpu...
Definition: Panner.cpp:64
Multiply in("signal") for in("mod").
Definition: Amp.h:23
Patchable & in_pan()
Sets "pan" as selected input and returns this module ready to be patched. This input is clamped to [-...
Definition: Panner.cpp:68
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
A Unit with no dsp inside, it just pass it's input to the output. Patching float to this Unit is thre...
Definition: PatchNode.h:41
Pans a signal between L/R outputs.
Definition: Panner.h:18
Patchable & out_L()
Sets "L" as selected output and returns this module ready to be patched. This is the default output...
Definition: Panner.cpp:72
An abstract unit with one input and one output and no other controls, for simple processing.
Definition: Formula.h:20