![]() |
:)
|
LFO class to perform modulation on RustyProcessor Parameters. More...
#include <RustyLFO.hpp>
Public Member Functions | |
| RustyLFO (double frequency, double minValue, double maxValue) | |
| Constructor for RustyLFO. | |
| double | getCurrentValue () override |
| Returns a modulator value for use on a RustyProcessor. | |
| void | updateState () override |
| Update modulator state and iterate forward a step. | |
| void | setParameter (std::string parameter, std::string value) override |
| Sets RustyModulator parameter to new value. | |
| std::string | getModulatorType () override |
| Function to get modulator type. | |
| std::string | getParams () override |
| Function to get modulator params. | |
Public Member Functions inherited from RustyModulator | |
| virtual double | getCurrentValue ()=0 |
| Returns a modulator value for use on a RustyProcessor. | |
| virtual void | updateState ()=0 |
| Update modulator state and iterate forward a step. | |
| virtual void | setParameter (std::string parameter, std::string value)=0 |
| Sets RustyModulator parameter to new value. | |
| void | addReference () |
| Tells RustyModulator that a RustyProcessor has been attached. | |
| void | removeReference () |
| Tells RustyModulator that a RustyProcessor has been removed. | |
| void | usedByProcessor () |
| Called after every modulator read. | |
| bool | isNumeric (const std::string &str) |
| Function to test if value contains numeric characters. | |
| virtual std::string | getModulatorType ()=0 |
| Function to get modulator type. | |
| virtual std::string | getParams ()=0 |
| Function to get modulator params. | |
Private Member Functions | |
| double | oscillate () |
| Calculates LFO position. | |
Private Attributes | |
| double | _value |
| Oscillator value after being bound to range. | |
| double | _phase |
| Phase position used to update LFO. | |
| double | _frequency |
| Frequency of Oscillator in ms. | |
| double | _minValue |
| Minimum value of LFO range. | |
| double | _maxValue |
| Maximum value of LFO range. | |
| double | _sampleRate |
| Sample rate to calculate LFO positions against. | |
Additional Inherited Members | |
Protected Attributes inherited from RustyModulator | |
| int | _refCount = 0 |
| Count of RustyProcessors that modulator is attached to. | |
| int | _useCount = 0 |
| Count of RustyProcessors usage at that moment in time. | |
LFO class to perform modulation on RustyProcessor Parameters.
Simple LFO class designed to allow user to manipulate parameters on processing units.
Inherited from RustyModulator
Definition at line 21 of file RustyLFO.hpp.
| RustyLFO::RustyLFO | ( | double | frequency, |
| double | minValue, | ||
| double | maxValue | ||
| ) |
Constructor for RustyLFO.
Takes initial parameters for RustyLFO and preps the object for processing.
| frequency | Float of LFO frequency |
| minValue | Float of LFO minimum range |
| maxValue | Float of LFO maximum range |
Definition at line 3 of file RustyLFO.cpp.
|
overridevirtual |
Returns a modulator value for use on a RustyProcessor.
This pure virtual function will get the state of the modulator at that moment in time. Ie. LFO position.
Implements RustyModulator.
Definition at line 9 of file RustyLFO.cpp.
|
overridevirtual |
Update modulator state and iterate forward a step.
This function iterates the modulator. This isn't called directly by any RustyProcessor but is instead called from within the RustyModulator when it has been informed that all attached processors have used the modulator.
Implements RustyModulator.
Definition at line 16 of file RustyLFO.cpp.
|
overridevirtual |
Sets RustyModulator parameter to new value.
This is pure virtual function that assigns a new value to a parameter of RustyModulator derived units. This function is used at runtime from CLI interaction.
| parameter | String of the parameter to affect. |
| modulator | Pointer to instance of RustyModulator. |
Implements RustyModulator.
Definition at line 22 of file RustyLFO.cpp.
|
overridevirtual |
Function to get modulator type.
Simple function allows CLI to test modulator types for user interaction.
Implements RustyModulator.
Definition at line 67 of file RustyLFO.cpp.
|
overridevirtual |
Function to get modulator params.
Simple function allows CLI to get available params for RustyModulator child.
Implements RustyModulator.
Definition at line 72 of file RustyLFO.cpp.
|
private |
Calculates LFO position.
Uses phase calculated across the sample rate to calculate LFO's sine wave position.
Definition at line 60 of file RustyLFO.cpp.
|
private |
Oscillator value after being bound to range.
Definition at line 45 of file RustyLFO.hpp.
|
private |
Phase position used to update LFO.
Definition at line 46 of file RustyLFO.hpp.
|
private |
Frequency of Oscillator in ms.
Definition at line 47 of file RustyLFO.hpp.
|
private |
Minimum value of LFO range.
Definition at line 48 of file RustyLFO.hpp.
|
private |
Maximum value of LFO range.
Definition at line 49 of file RustyLFO.hpp.
|
private |
Sample rate to calculate LFO positions against.
Definition at line 50 of file RustyLFO.hpp.