Adds a DC offset (voltage bias) to the audio samples. More...
#include <juce_Bias.h>
Public Member Functions | |
Bias () noexcept=default | |
FloatType | getBias () const noexcept |
Returns the DC bias. More... | |
double | getRampDurationSeconds () const noexcept |
void | prepare (const ProcessSpec &spec) noexcept |
Called before processing starts. More... | |
template<typename ProcessContext > | |
void | process (const ProcessContext &context) noexcept |
Processes the input and output buffers supplied in the processing context. More... | |
template<typename SampleType > | |
SampleType | processSample (SampleType inputSample) noexcept |
Returns the result of processing a single sample. More... | |
void | reset () noexcept |
void | setBias (FloatType newBias) noexcept |
Sets the DC bias. More... | |
void | setRampDurationSeconds (double newDurationSeconds) noexcept |
Sets the length of the ramp used for smoothing gain changes. More... | |
Private Member Functions | |
void | updateRamp () noexcept |
Private Attributes | |
SmoothedValue< FloatType > | bias |
double | rampDurationSeconds = 0 |
double | sampleRate = 0 |
Adds a DC offset (voltage bias) to the audio samples.
This is a useful preprocessor for asymmetric waveshaping when a waveshaper is bookended by a bias on input and a DC-offset removing high pass filter on output.
This is an extremely simple bias implementation that simply adds a value to a signal. More complicated bias behaviours exist in real circuits - for your homework ;).
@tags{DSP}
|
defaultnoexcept |
|
inlinenoexcept |
Returns the DC bias.
References juce::dsp::Bias< FloatType >::bias, and juce::SmoothedValueBase< SmoothedValueType >::getTargetValue().
|
inlinenoexcept |
|
inlinenoexcept |
Called before processing starts.
References juce::dsp::Bias< FloatType >::sampleRate, and juce::dsp::Bias< FloatType >::updateRamp().
|
inlinenoexcept |
Processes the input and output buffers supplied in the processing context.
References juce::dsp::Bias< FloatType >::bias, juce::gl::dst, juce::SmoothedValue< FloatType, SmoothingType >::getNextValue(), jassert, JUCE_BEGIN_IGNORE_WARNINGS_MSVC, JUCE_END_IGNORE_WARNINGS_MSVC, juce::gl::len, juce::SmoothedValue< FloatType, SmoothingType >::skip(), and juce::gl::src.
|
inlinenoexcept |
Returns the result of processing a single sample.
References juce::dsp::Bias< FloatType >::bias, and juce::SmoothedValue< FloatType, SmoothingType >::getNextValue().
|
inlinenoexcept |
|
inlinenoexcept |
Sets the DC bias.
newBias | DC offset in range [-1, 1] |
References juce::dsp::Bias< FloatType >::bias, jassert, and juce::SmoothedValue< FloatType, SmoothingType >::setTargetValue().
|
inlinenoexcept |
Sets the length of the ramp used for smoothing gain changes.
References juce::dsp::Bias< FloatType >::rampDurationSeconds, and juce::dsp::Bias< FloatType >::updateRamp().
|
inlineprivatenoexcept |
References juce::dsp::Bias< FloatType >::bias, juce::dsp::Bias< FloatType >::rampDurationSeconds, juce::SmoothedValue< FloatType, SmoothingType >::reset(), and juce::dsp::Bias< FloatType >::sampleRate.
Referenced by juce::dsp::Bias< FloatType >::prepare(), and juce::dsp::Bias< FloatType >::setRampDurationSeconds().
|
private |
|
private |
|
private |