30template <
typename SampleType>
38template <
typename SampleType>
45template <
typename SampleType>
50 pan =
jlimit (
static_cast<SampleType
> (-1.0),
static_cast<SampleType
> (1.0),
newPan);
55template <
typename SampleType>
61 sampleRate =
spec.sampleRate;
66template <
typename SampleType>
69 leftVolume .reset (sampleRate, 0.05);
70 rightVolume.reset (sampleRate, 0.05);
74template <
typename SampleType>
79 auto normalisedPan =
static_cast<SampleType
> (0.5) * (pan +
static_cast<SampleType
> (1.0));
113 case Rule::squareRoot3dB:
119 case Rule::squareRoot4p5dB:
A processor to perform panning operations on stereo buffers.
void prepare(const ProcessSpec &spec)
Initialises the processor.
void setPan(SampleType newPan)
Sets the current panning value, between -1 (full left) and 1 (full right).
void reset()
Resets the internal state variables of the processor.
void setRule(Rule newRule)
Sets the panning rule.
constexpr Type jmin(Type a, Type b)
Returns the smaller of two values.
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Constrains a value to keep it within a given range.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Commonly used mathematical constants.
This structure is passed into a DSP algorithm's prepare() method, and contains information about vari...