36 {
XO(
"Square, no alias") },
37 {
XC(
"Triangle",
"waveform") }
50 chirpParameters { postSet };
53 toneParameters { postSet };
55 return chirpParameters;
57 return toneParameters;
105 float* buffer = outBlock[0];
106 double throwaway = 0;
111 double frequencyQuantum;
112 double BlendedFrequency;
113 double BlendedAmplitude;
114 double BlendedLogFrequency = 0.0;
120 BlendedAmplitude =
mAmplitude0 + amplitudeQuantum * doubleSample;
123 double pre2PI = 2.0 *
M_PI;
124 double pre4divPI = 4.0 /
M_PI;
135 BlendedLogFrequency =
mLogFrequency[0] + frequencyQuantum * doubleSample;
136 BlendedFrequency = pow(10.0, BlendedLogFrequency);
142 BlendedFrequency =
mFrequency0 + frequencyQuantum * doubleSample;
146 for (
decltype(blockLen) i = 0; i < blockLen; i++)
178 b = (1.0 + cos((pre2PI * BlendedFrequency) /
mSampleRate)) /
181 for (k = 3; (k < 200) && (k * BlendedFrequency <
mSampleRate / 2.0);
185 a = 1.0 + cos((pre2PI * k * BlendedFrequency) /
mSampleRate);
192 buffer[i] = (float)(BlendedAmplitude * f);
195 BlendedAmplitude += amplitudeQuantum;
198 BlendedLogFrequency += frequencyQuantum;
199 BlendedFrequency = pow(10.0, BlendedLogFrequency);
203 BlendedFrequency += frequencyQuantum;
an object holding per-project preferred sample rate
Generates EffectParameterMethods overrides from variadic template arguments.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
void SetLinearEffectFlag(bool linearEffectFlag)
Interface for manipulations of an Effect's settings.
virtual void Reset(Effect &effect) const =0
An Effect that can generate a sine, square or sawtooth wave. An extended mode of ToneGenBase supports...
size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
Called for destructive effect computation.
static const EnumValueSymbol kInterStrings[nInterpolations]
static constexpr EffectParameter StartAmp
static constexpr EffectParameter StartFreq
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
static constexpr EffectParameter Frequency
static constexpr EnumParameter Interp
static constexpr EffectParameter EndAmp
static constexpr EnumParameter Waveform
bool ProcessInitialize(EffectSettings &settings, double sampleRate, ChannelNames chanMap) override
const EffectParameterMethods & Parameters() const override
static constexpr EffectParameter Amplitude
EffectType GetType() const override
Type determines how it behaves.
ToneGenBase(bool isChirp)
static const EnumValueSymbol kWaveStrings[nWaveforms]
static constexpr EffectParameter EndFreq
constexpr auto sampleRate
Externalized state of a plug-in.