:)
Loading...
Searching...
No Matches
RustyOverdrive Class Reference

Overdrive distortion unit. More...

#include <RustyOverdrive.hpp>

Inheritance diagram for RustyOverdrive:
RustyProcessor

Public Member Functions

 RustyOverdrive (float drive)
 Constructor for RustyOverdrive.
 
void process (float *sample) override
 Performs DSP on an audio sample.
 
void setModulatorForParameter (std::string parameter, RustyModulator *modulator) override
 Binds a RustyModulator to a RustyProcessor instance parameter.
 
void setParameter (std::string parameter, std::string value) override
 Sets RustyProcessor parameter to new value.
 
std::string getProcessorType () override
 Function to get processor type.
 
std::string getParams () override
 Function to get processor params.
 
- Public Member Functions inherited from RustyProcessor
virtual void process (float *sample)=0
 Performs DSP on an audio sample.
 
virtual void setModulatorForParameter (std::string parameter, RustyModulator *modulator)=0
 Binds a RustyModulator to a RustyProcessor instance parameter.
 
virtual void setParameter (std::string parameter, std::string value)=0
 Sets RustyProcessor parameter to new value.
 
bool isNumeric (const std::string &str)
 Function to test if value contains numeric characters.
 
virtual std::string getProcessorType ()=0
 Function to get processor type.
 
virtual std::string getParams ()=0
 Function to get processor params.
 

Private Member Functions

float distortSample (float *inputSample)
 Sample distortion calculation.
 

Private Attributes

float _drive
 Gain value.
 

Additional Inherited Members

- Public Attributes inherited from RustyProcessor
std::map< std::string, RustyModulator * > _modulators
 Map of processors affecting derived RustyProcessor.
 

Detailed Description

Overdrive distortion unit.

Arc-Tan soft-clip style overdrive distortion unit.

Inherited from RustyProcessor.

Definition at line 17 of file RustyOverdrive.hpp.

Constructor & Destructor Documentation

◆ RustyOverdrive()

RustyOverdrive::RustyOverdrive ( float  drive)

Constructor for RustyOverdrive.


Takes initial parameters for RustyOverdrive and preps the unit for sample processing.

Parameters
driveFloat of drive multiplier to distort signal by.

Definition at line 3 of file RustyOverdrive.cpp.

Member Function Documentation

◆ process()

void RustyOverdrive::process ( float *  sample)
overridevirtual

Performs DSP on an audio sample.


This pure virtual function performs DSP algorithms on a sample by sample basis. A pointer to a 32bitFloat audio sample is passed as an argument and this will be the value used as the input to the DSP function f(x).

Parameters
samplePointer to a 32bitFloat audio sample value.

Implements RustyProcessor.

Definition at line 5 of file RustyOverdrive.cpp.

◆ setModulatorForParameter()

void RustyOverdrive::setModulatorForParameter ( std::string  parameter,
RustyModulator *  modulator 
)
overridevirtual

Binds a RustyModulator to a RustyProcessor instance parameter.


This is pure virtual function assigns modulator manipulation to parameters within the DSP unit. Each RustyProcessor derived DSP unit will check the parameter name against suitable parameters, if there is a match the modulator will affect the parameter.

Parameters
parameterString of the parameter to affect.
modulatorPointer to instance of RustyModulator.
See also
setParameter()

Implements RustyProcessor.

Definition at line 20 of file RustyOverdrive.cpp.

◆ setParameter()

void RustyOverdrive::setParameter ( std::string  parameter,
std::string  value 
)
overridevirtual

Sets RustyProcessor parameter to new value.


This is pure virtual function that assigns a new value to a parameter of RustyProcessor derived DSP units. This function is used at runtime from CLI interaction.

Parameters
parameterString of the parameter to affect.
modulatorPointer to instance of RustyModulator.
See also
setModulatorForParameter()

Implements RustyProcessor.

Definition at line 31 of file RustyOverdrive.cpp.

◆ getProcessorType()

std::string RustyOverdrive::getProcessorType ( )
overridevirtual

Function to get processor type.


Simple function allows CLI to test Processor types for user interaction.

Returns
Returns string of RustyProcessor child type.

Implements RustyProcessor.

Definition at line 66 of file RustyOverdrive.cpp.

◆ getParams()

std::string RustyOverdrive::getParams ( )
overridevirtual

Function to get processor params.


Simple function allows CLI to get available params for RustyProcessor child.

Returns
Returns string of parameters available for RustyProcessor child.

Implements RustyProcessor.

Definition at line 71 of file RustyOverdrive.cpp.

◆ distortSample()

float RustyOverdrive::distortSample ( float *  inputSample)
private

Sample distortion calculation.


Distorts sample using arc-tan algorithm.

Parameters
inputSampleFloat* of input sample.

Definition at line 60 of file RustyOverdrive.cpp.

Member Data Documentation

◆ _drive

float RustyOverdrive::_drive
private

Gain value.

Definition at line 48 of file RustyOverdrive.hpp.


The documentation for this class was generated from the following files: