ofxPDSP
Amp.h
1 
2 // Amp.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 
7 #ifndef PDSP_CORE_AMP_H_INCLUDED
8 #define PDSP_CORE_AMP_H_INCLUDED
9 
10 
11 #include "BasicNodes.h"
12 
13 
14 namespace pdsp{
15 
16 
23 class Amp : public Unit{
24 
25 public:
26 
27  Amp();
28 
29  ~Amp();
30  Amp(const Amp& other);
31  Amp& operator=(const Amp& other);
32 
37  Patchable& set(float value);
38 
43 
47  Patchable& in_mod();
48 
53 
57  float meter_mod() const;
58 
62  float meter_output() const;
63 
67  void enableBoundaries(float low, float high);
68 
72  void disableBoundaries();
73 
74 
75 private:
76 
77  void prepareUnit ( int expectedBufferSize, double sampleRate ) override;
78 
79  void releaseResources () override;
80 
81  void process (int bufferSize) noexcept override;
82 
83  OutputNode output;
84  InputNode input_mod;
85  InputNode input_signal;
86 
87  std::atomic<float> meter;
88  std::atomic<float> meterOut;
89 
90 };
91 
92 }//END NAMESPACE
93 
94 
95 
96 
97 #endif // AMP_H_INCLUDED
float meter_output() const
returns the value of the output buffer, updated at control rate. This method is thread safe...
Definition: Amp.cpp:46
Patchable & in_mod()
Sets "mod" as selected input and returns this Unit ready to be patched. Value from in("signal") is mu...
Definition: Amp.cpp:50
Patchable & in_signal()
Sets "signal" as selected input and returns this Unit ready to be patched. This is the default input...
Definition: Amp.cpp:54
void enableBoundaries(float low, float high)
enable some value boundaries for the "mod" input. By default there are no boundaries.
Definition: Amp.cpp:63
Abstract class for implementing Units.
Definition: BasicNodes.h:223
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
Multiply in("signal") for in("mod").
Definition: Amp.h:23
Input of a Unit, process all the connected Outputs and sum them. Has an internal variable state...
Definition: BasicNodes.h:536
Patchable & out_signal()
Sets "signal" as selected output and returns this Unit ready to be patched. This is the default outpu...
Definition: Amp.cpp:58
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
float meter_mod() const
returns the value of the input buffer behind in("mod"), updated at control rate. This method is threa...
Definition: Amp.cpp:42
void disableBoundaries()
disable the "mod" input boundaries, if they were set.
Definition: Amp.cpp:68
Output of a Unit, contains a buffer of rendered floats and has a variable state flag.
Definition: BasicNodes.h:354