31#include "../ShuttleGui.h"
32#include "../widgets/valnum.h"
60#define phaserlfoshape 4.0
63#define lfoskipsamples 20
93 Parameters().Reset(*
this);
94 SetLinearEffectFlag(
true);
110 return XO(
"Combines phase-shifted signals with the original signal");
152 const float *
const *inBlock,
float *
const *outBlock,
size_t blockLen)
184 const float *
const *inbuf,
float *
const *outbuf,
size_t numSamples)
199 S.StartMultiColumn(3, wxEXPAND);
204 .Validator<IntegerValidator<int>>(
206 .AddTextBox(
XXO(
"&Stages:"), L
"", 15);
210 .Style(wxSL_HORIZONTAL)
211 .MinSize( { 100, -1 } )
216 .Validator<IntegerValidator<int>>(
218 .AddTextBox(
XXO(
"&Dry/Wet:"), L
"", 15);
222 .Style(wxSL_HORIZONTAL)
223 .MinSize( { 100, -1 } )
227 .Validator<FloatingPointValidator<double>>(
229 .AddTextBox(
XXO(
"LFO Freq&uency (Hz):"), L
"", 15);
232 .Name(
XO(
"LFO frequency in hertz"))
233 .Style(wxSL_HORIZONTAL)
234 .MinSize( { 100, -1 } )
238 .Validator<FloatingPointValidator<double>>(
240 .AddTextBox(
XXO(
"LFO Sta&rt Phase (deg.):"), L
"", 15);
243 .Name(
XO(
"LFO start phase in degrees"))
244 .Style(wxSL_HORIZONTAL)
245 .MinSize( { 100, -1 } )
250 .Validator<IntegerValidator<int>>(
252 .AddTextBox(
XXO(
"Dept&h:"), L
"", 15);
255 .Name(
XO(
"Depth in percent"))
256 .Style(wxSL_HORIZONTAL)
257 .MinSize( { 100, -1 } )
261 .Validator<IntegerValidator<int>>(
263 .AddTextBox(
XXO(
"Feedbac&k (%):"), L
"", 15);
266 .Name(
XO(
"Feedback in percent"))
267 .Style(wxSL_HORIZONTAL)
268 .MinSize( { 100, -1 } )
273 .Validator<FloatingPointValidator<double>>(
275 .AddTextBox(
XXO(
"&Output gain (dB):"), L
"", 12);
278 .Name(
XO(
"Output gain (dB)"))
279 .Style(wxSL_HORIZONTAL)
280 .MinSize( { 100, -1 } )
305 mStagesT->GetValidator()->TransferToWindow();
317 for (
int j = 0; j <
mStages; j++)
333 const float *
const *inBlock,
float *
const *outBlock,
size_t blockLen)
335 const float *ibuf = inBlock[0];
336 float *obuf = outBlock[0];
348 for (
decltype(blockLen) i = 0; i < blockLen; i++)
360 + data.
phase)) / 2.0;
370 for (
int j = 0; j <
mStages; j++)
372 double tmp = data.
old[j];
373 data.
old[j] = data.
gain * tmp + m;
374 m = tmp - data.
gain * data.
old[j];
387 mStagesT->GetValidator()->TransferToWindow();
394 mDryWetT->GetValidator()->TransferToWindow();
402 mFreqT->GetValidator()->TransferToWindow();
408 int val = ((evt.GetInt() + 5) / 10) * 10;
412 mPhaseT->GetValidator()->TransferToWindow();
419 mDepthT->GetValidator()->TransferToWindow();
425 int val = evt.GetInt();
426 val = ((val + (val > 0 ? 5 : -5)) / 10) * 10;
430 mFeedbackT->GetValidator()->TransferToWindow();
437 mOutGainT->GetValidator()->TransferToWindow();
enum ChannelName * ChannelNames
static Settings & settings()
Generates EffectParameterMethods overrides from variadic template arguments.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
bool EnableApply(bool enable=true)
Performs effect computation.
Interface for manipulations of an Effect's settings.
An Effect that changes frequencies in a time varying manner.
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
void OnPhaseText(wxCommandEvent &evt)
bool ProcessInitialize(EffectSettings &settings, double sampleRate, sampleCount totalLen, ChannelNames chanMap) override
static constexpr EffectParameter Feedback
void OnStagesSlider(wxCommandEvent &evt)
size_t RealtimeProcess(size_t group, EffectSettings &settings, const float *const *inbuf, float *const *outbuf, size_t numSamples) override
static constexpr EffectParameter DryWet
void OnFeedbackSlider(wxCommandEvent &evt)
void OnStagesText(wxCommandEvent &evt)
static constexpr EffectParameter Stages
static constexpr EffectParameter Phase
bool TransferDataFromWindow(EffectSettings &settings) override
Update the given settings from controls.
bool SupportsRealtime() const override
Whether the effect supports realtime previewing (while audio is playing).
void OnPhaseSlider(wxCommandEvent &evt)
void OnDryWetSlider(wxCommandEvent &evt)
void InstanceInit(EffectPhaserState &data, float sampleRate)
void OnDryWetText(wxCommandEvent &evt)
size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
Called for destructive effect computation.
void OnDepthSlider(wxCommandEvent &evt)
static const ComponentInterfaceSymbol Symbol
static constexpr EffectParameter Depth
std::unique_ptr< EffectUIValidator > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
Add controls to effect panel; always succeeds.
size_t InstanceProcess(EffectSettings &settings, EffectPhaserState &data, const float *const *inBlock, float *const *outBlock, size_t blockLen)
void OnFreqText(wxCommandEvent &evt)
bool RealtimeFinalize(EffectSettings &settings) noexcept override
bool RealtimeAddProcessor(EffectSettings &settings, unsigned numChannels, float sampleRate) override
void OnGainSlider(wxCommandEvent &evt)
static constexpr EffectParameter Freq
const EffectParameterMethods & Parameters() const override
void OnFeedbackText(wxCommandEvent &evt)
TranslatableString GetDescription() const override
ComponentInterfaceSymbol GetSymbol() const override
void OnFreqSlider(wxCommandEvent &evt)
std::vector< EffectPhaserState > mSlaves
EffectType GetType() const override
Type determines how it behaves.
static constexpr EffectParameter OutGain
unsigned GetAudioInCount() const override
How many input buffers to allocate at once.
bool TransferDataToWindow(const EffectSettings &settings) override
Update controls for the settings.
bool RealtimeInitialize(EffectSettings &settings, double sampleRate) override
void OnDepthText(wxCommandEvent &evt)
void OnGainText(wxCommandEvent &evt)
EffectPhaserState mMaster
ManualPageID ManualPage() const override
Name of a page in the Audacity alpha manual, default is empty.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
size_t SetBlockSize(size_t maxBlockSize) override
Holds a msgid for the translation catalog; may also bind format arguments.
Positions or offsets within audio files need a wide type.
BuiltinEffectsModule::Registration< EffectPhaser > reg
const Type scale
Scaling factor, for slider control.
const Type def
Default value.
const Type min
Minimum value.
const Type max
Maximum value.
Externalized state of a plug-in.