Audacity  3.2.0
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
EffectWahwah Class Referencefinal

An Effect that adds a 'spectral glide'. More...

#include <Wahwah.h>

Inheritance diagram for EffectWahwah:
[legend]
Collaboration diagram for EffectWahwah:
[legend]

Public Member Functions

 EffectWahwah ()
 
virtual ~EffectWahwah ()
 
ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
ManualPageID ManualPage () override
 Name of a page in the Audacity alpha manual, default is empty. More...
 
EffectType GetType () override
 Type determines how it behaves. More...
 
bool SupportsRealtime () override
 Whether the effect supports realtime previewing (while audio is playing). More...
 
bool GetAutomationParameters (CommandParameters &parms) override
 Save current settings into parms. More...
 
bool SetAutomationParameters (CommandParameters &parms) override
 Change settings to those stored in parms. More...
 
unsigned GetAudioInCount () override
 
unsigned GetAudioOutCount () override
 
bool ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 Called for destructive, non-realtime effect computation. More...
 
size_t ProcessBlock (float **inBlock, float **outBlock, size_t blockLen) override
 Called for destructive, non-realtime effect computation. More...
 
bool RealtimeInitialize () override
 
bool RealtimeAddProcessor (unsigned numChannels, float sampleRate) override
 
bool RealtimeFinalize () override
 
size_t RealtimeProcess (int group, float **inbuf, float **outbuf, size_t numSamples) override
 
bool DefineParams (ShuttleParams &S) override
 
void PopulateOrExchange (ShuttleGui &S) override
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
EffectFamilySymbol GetFamily () override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () override
 Whether the effect sorts "above the line" in the menus. More...
 
bool IsLegacy () override
 
bool SupportsAutomation () override
 Whether the effect can be used without the UI, in a macro. More...
 
bool LoadUserPreset (const RegistryPath &name) override
 Change settings to a user-named preset. More...
 
bool SaveUserPreset (const RegistryPath &name) override
 Save current settings as a user-named preset. More...
 
RegistryPaths GetFactoryPresets () override
 Report names of factory presets. More...
 
bool LoadFactoryPreset (int id) override
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
 
bool LoadFactoryDefaults () override
 Change settings back to "factory default". More...
 
bool SetHost (EffectHostInterface *host) override
 
int GetMidiInCount () override
 
int GetMidiOutCount () override
 
sampleCount GetLatency () override
 Called for destructive, non-realtime effect computation. More...
 
size_t GetTailSize () override
 
void SetSampleRate (double rate) override
 
size_t SetBlockSize (size_t maxBlockSize) override
 
size_t GetBlockSize () const override
 
bool ProcessFinalize () override
 Called for destructive, non-realtime effect computation. More...
 
bool RealtimeSuspend () override
 
bool RealtimeResume () noexcept override
 
bool RealtimeProcessStart () override
 
bool RealtimeProcessEnd () noexcept override
 
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false) override
 
bool PopulateUI (ShuttleGui &S) final
 Adds controls to a panel that is given as the parent window of S More...
 
bool IsGraphicalUI () override
 
bool ValidateUI () override
 
bool HideUI () override
 
bool CloseUI () override
 
bool CanExportPresets () override
 
void ExportPresets () override
 
void ImportPresets () override
 
bool HasOptions () override
 
void ShowOptions () override
 
EffectDefinitionInterfaceGetDefinition () override
 
double GetDuration () override
 
NumericFormatSymbol GetDurationFormat () override
 
virtual NumericFormatSymbol GetSelectionFormat ()
 
void SetDuration (double duration) override
 
RegistryPath GetUserPresetsGroup (const RegistryPath &name) override
 
RegistryPath GetCurrentSettingsGroup () override
 
RegistryPath GetFactoryDefaultsGroup () override
 
virtual wxString GetSavedStateGroup ()
 
int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
 
unsigned TestUIFlags (unsigned mask)
 
void SetPresetParameters (const wxArrayString *Names, const wxArrayString *Values)
 
virtual bool Startup (EffectUIClientInterface *client)
 
virtual bool GetAutomationParametersAsString (wxString &parms)
 
virtual bool SetAutomationParametersFromString (const wxString &parms)
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
bool DoEffect (double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={})
 
bool Delegate (Effect &delegate, wxWindow &parent, const EffectDialogFactory &factory)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
virtual bool Startup ()
 
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
- Public Member Functions inherited from EffectProcessor
virtual ~EffectProcessor ()
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetClassification ()
 Determines which menu it appears in; default same as GetType(). More...
 
virtual bool EnablesDebug ()
 Whether the effect dialog should have a Debug button; default, always false. More...
 
virtual FilePath HelpPage ()
 Fully qualified local help file name, default is empty. More...
 
virtual bool IsHiddenFromMenus ()
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 
- Public Member Functions inherited from EffectUIHostInterface
virtual ~EffectUIHostInterface ()
 
- Public Member Functions inherited from EffectHostInterface
virtual ~EffectHostInterface ()
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Wahwah") }
 
- Static Public Attributes inherited from Effect
static const wxString kUserPresetIdent = wxT("User Preset:")
 
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
 
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
 
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")
 

Private Member Functions

void InstanceInit (EffectWahwahState &data, float sampleRate)
 
size_t InstanceProcess (EffectWahwahState &data, float **inBlock, float **outBlock, size_t blockLen)
 
void OnFreqSlider (wxCommandEvent &evt)
 
void OnPhaseSlider (wxCommandEvent &evt)
 
void OnDepthSlider (wxCommandEvent &evt)
 
void OnResonanceSlider (wxCommandEvent &evt)
 
void OnFreqOffSlider (wxCommandEvent &evt)
 
void OnGainSlider (wxCommandEvent &evt)
 
void OnFreqText (wxCommandEvent &evt)
 
void OnPhaseText (wxCommandEvent &evt)
 
void OnDepthText (wxCommandEvent &evt)
 
void OnResonanceText (wxCommandEvent &evt)
 
void OnFreqOffText (wxCommandEvent &evt)
 
void OnGainText (wxCommandEvent &evt)
 

Private Attributes

EffectWahwahState mMaster
 
std::vector< EffectWahwahStatemSlaves
 
double mFreq
 
double mPhase
 
int mDepth
 
double mRes
 
int mFreqOfs
 
double mOutGain
 
wxTextCtrl * mFreqT
 
wxTextCtrl * mPhaseT
 
wxTextCtrl * mDepthT
 
wxTextCtrl * mResT
 
wxTextCtrl * mFreqOfsT
 
wxTextCtrl * mOutGainT
 
wxSlider * mFreqS
 
wxSlider * mPhaseS
 
wxSlider * mDepthS
 
wxSlider * mResS
 
wxSlider * mFreqOfsS
 
wxSlider * mOutGainS
 

Additional Inherited Members

- Public Types inherited from Effect
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Static Public Member Functions inherited from Effect
static void IncEffectCounter ()
 
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 
- Protected Member Functions inherited from Effect
bool EnableApply (bool enable=true)
 
bool EnablePreview (bool enable=true)
 
virtual bool Init ()
 
virtual bool CheckWhetherSkipEffect ()
 
virtual bool Process ()
 
virtual bool ProcessPass ()
 
virtual bool InitPass1 ()
 
virtual bool InitPass2 ()
 
virtual void End ()
 
virtual double CalcPreviewInputLength (double previewLength)
 
virtual void Preview (bool dryOnly)
 
bool TotalProgress (double frac, const TranslatableString &={})
 
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={})
 
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={})
 
int GetNumWaveTracks ()
 
int GetNumWaveGroups ()
 
void GetBounds (const WaveTrack &track, const WaveTrack *pRight, sampleCount *start, sampleCount *len)
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing ()
 
void IncludeNotSelectedPreviewTracks (bool includeNotSelected)
 
void CopyInputTracks (bool allSyncLockSelected=false)
 
std::shared_ptr< AddedAnalysisTrackAddAnalysisTrack (const wxString &name=wxString())
 
ModifiedAnalysisTrack ModifyAnalysisTrack (const LabelTrack *pOrigTrack, const wxString &name=wxString())
 
void ReplaceProcessedTracks (const bool bGoodResult)
 
TrackAddToOutputTracks (const std::shared_ptr< Track > &t)
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 
- Protected Attributes inherited from Effect
BasicUI::ProgressDialogmProgress = nullptr
 
double mProjectRate
 
double mSampleRate
 
WaveTrackFactorymFactory
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0
 
double mT1
 
wxArrayString mPresetNames
 
wxArrayString mPresetValues
 
int mPass
 
wxWeakRef< wxDialog > mHostUIDialog
 This smart pointer tracks the lifetime of the dialog. More...
 
wxWeakRef< wxDialog > mUIDialog
 This weak pointer may be the same as the above, or null. More...
 
wxWindow * mUIParent
 
unsigned mUIFlags { 0 }
 
sampleCount mSampleCnt
 
- Static Protected Attributes inherited from Effect
static int nEffectsDone =0
 

Detailed Description

An Effect that adds a 'spectral glide'.

Definition at line 39 of file Wahwah.h.

Constructor & Destructor Documentation

◆ EffectWahwah()

EffectWahwah::EffectWahwah ( )

Definition at line 81 of file Wahwah.cpp.

82 {
83  mFreq = DEF_Freq;
84  mPhase = DEF_Phase;
85  mDepth = DEF_Depth;
86  mRes = DEF_Res;
87  mFreqOfs = DEF_FreqOfs;
88  mOutGain = DEF_OutGain;
89 
90  SetLinearEffectFlag(true);
91 }

◆ ~EffectWahwah()

EffectWahwah::~EffectWahwah ( )
virtual

Definition at line 93 of file Wahwah.cpp.

94 {
95 }

Member Function Documentation

◆ DefineParams()

bool EffectWahwah::DefineParams ( ShuttleParams S)
override

Definition at line 191 of file Wahwah.cpp.

191  {
192  S.SHUTTLE_PARAM( mFreq, Freq );
193  S.SHUTTLE_PARAM( mPhase, Phase );
194  S.SHUTTLE_PARAM( mDepth, Depth );
195  S.SHUTTLE_PARAM( mRes, Res );
196  S.SHUTTLE_PARAM( mFreqOfs, FreqOfs );
197  S.SHUTTLE_PARAM( mOutGain, OutGain );
198  return true;
199 }

References mDepth, mFreq, mFreqOfs, mOutGain, mPhase, mRes, and S.

◆ GetAudioInCount()

unsigned EffectWahwah::GetAudioInCount ( )
overridevirtual

Reimplemented from Effect.

Definition at line 128 of file Wahwah.cpp.

129 {
130  return 1;
131 }

◆ GetAudioOutCount()

unsigned EffectWahwah::GetAudioOutCount ( )
overridevirtual

Reimplemented from Effect.

Definition at line 133 of file Wahwah.cpp.

134 {
135  return 1;
136 }

◆ GetAutomationParameters()

bool EffectWahwah::GetAutomationParameters ( CommandParameters parms)
overridevirtual

Save current settings into parms.

Reimplemented from Effect.

Definition at line 201 of file Wahwah.cpp.

202 {
203  parms.Write(KEY_Freq, mFreq);
204  parms.Write(KEY_Phase, mPhase);
205  parms.Write(KEY_Depth, mDepth);
206  parms.Write(KEY_Res, mRes);
207  parms.Write(KEY_FreqOfs, mFreqOfs);
208  parms.Write(KEY_OutGain, mOutGain);
209 
210  return true;
211 }

References mDepth, mFreq, mFreqOfs, mOutGain, mPhase, and mRes.

◆ GetDescription()

TranslatableString EffectWahwah::GetDescription ( )
overridevirtual

Reimplemented from Effect.

Definition at line 104 of file Wahwah.cpp.

105 {
106  return XO("Rapid tone quality variations, like that guitar sound so popular in the 1970's");
107 }

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectWahwah::GetSymbol ( )
overridevirtual

Reimplemented from Effect.

Definition at line 99 of file Wahwah.cpp.

100 {
101  return Symbol;
102 }

References Symbol.

◆ GetType()

EffectType EffectWahwah::GetType ( )
overridevirtual

Type determines how it behaves.

Reimplemented from Effect.

Definition at line 116 of file Wahwah.cpp.

117 {
118  return EffectTypeProcess;
119 }

References EffectTypeProcess.

◆ InstanceInit()

void EffectWahwah::InstanceInit ( EffectWahwahState data,
float  sampleRate 
)
private

Definition at line 342 of file Wahwah.cpp.

343 {
344  data.samplerate = sampleRate;
345  data.lfoskip = mFreq * 2 * M_PI / sampleRate;
346  data.skipcount = 0;
347  data.xn1 = 0;
348  data.xn2 = 0;
349  data.yn1 = 0;
350  data.yn2 = 0;
351  data.b0 = 0;
352  data.b1 = 0;
353  data.b2 = 0;
354  data.a0 = 0;
355  data.a1 = 0;
356  data.a2 = 0;
357 
358  data.depth = mDepth / 100.0;
359  data.freqofs = mFreqOfs / 100.0;
360  data.phase = mPhase * M_PI / 180.0;
361  data.outgain = DB_TO_LINEAR(mOutGain);
362 }

References EffectWahwahState::a0, EffectWahwahState::a1, EffectWahwahState::a2, EffectWahwahState::b0, EffectWahwahState::b1, EffectWahwahState::b2, DB_TO_LINEAR(), EffectWahwahState::depth, EffectWahwahState::freqofs, EffectWahwahState::lfoskip, M_PI, mDepth, mFreq, mFreqOfs, mOutGain, mPhase, EffectWahwahState::outgain, EffectWahwahState::phase, EffectWahwahState::samplerate, EffectWahwahState::skipcount, EffectWahwahState::xn1, EffectWahwahState::xn2, EffectWahwahState::yn1, and EffectWahwahState::yn2.

Referenced by ProcessInitialize(), and RealtimeAddProcessor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InstanceProcess()

size_t EffectWahwah::InstanceProcess ( EffectWahwahState data,
float **  inBlock,
float **  outBlock,
size_t  blockLen 
)
private

Definition at line 364 of file Wahwah.cpp.

365 {
366  float *ibuf = inBlock[0];
367  float *obuf = outBlock[0];
368  double frequency, omega, sn, cs, alpha;
369  double in, out;
370 
371  data.lfoskip = mFreq * 2 * M_PI / data.samplerate;
372  data.depth = mDepth / 100.0;
373  data.freqofs = mFreqOfs / 100.0;
374 
375  data.phase = mPhase * M_PI / 180.0;
376  data.outgain = DB_TO_LINEAR(mOutGain);
377 
378  for (decltype(blockLen) i = 0; i < blockLen; i++)
379  {
380  in = (double) ibuf[i];
381 
382  if ((data.skipcount++) % lfoskipsamples == 0)
383  {
384  frequency = (1 + cos(data.skipcount * data.lfoskip + data.phase)) / 2;
385  frequency = frequency * data.depth * (1 - data.freqofs) + data.freqofs;
386  frequency = exp((frequency - 1) * 6);
387  omega = M_PI * frequency;
388  sn = sin(omega);
389  cs = cos(omega);
390  alpha = sn / (2 * mRes);
391  data.b0 = (1 - cs) / 2;
392  data.b1 = 1 - cs;
393  data.b2 = (1 - cs) / 2;
394  data.a0 = 1 + alpha;
395  data.a1 = -2 * cs;
396  data.a2 = 1 - alpha;
397  };
398  out = (data.b0 * in + data.b1 * data.xn1 + data.b2 * data.xn2 - data.a1 * data.yn1 - data.a2 * data.yn2) / data.a0;
399  data.xn2 = data.xn1;
400  data.xn1 = in;
401  data.yn2 = data.yn1;
402  data.yn1 = out;
403  out *= data.outgain;
404 
405  obuf[i] = (float) out;
406  }
407 
408  return blockLen;
409 }

References EffectWahwahState::a0, EffectWahwahState::a1, EffectWahwahState::a2, EffectWahwahState::b0, EffectWahwahState::b1, EffectWahwahState::b2, DB_TO_LINEAR(), EffectWahwahState::depth, EffectWahwahState::freqofs, EffectWahwahState::lfoskip, lfoskipsamples, M_PI, mDepth, mFreq, mFreqOfs, mOutGain, mPhase, mRes, EffectWahwahState::outgain, EffectWahwahState::phase, EffectWahwahState::samplerate, EffectWahwahState::skipcount, EffectWahwahState::xn1, EffectWahwahState::xn2, EffectWahwahState::yn1, and EffectWahwahState::yn2.

Referenced by ProcessBlock(), and RealtimeProcess().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ManualPage()

ManualPageID EffectWahwah::ManualPage ( )
overridevirtual

Name of a page in the Audacity alpha manual, default is empty.

Reimplemented from EffectDefinitionInterface.

Definition at line 109 of file Wahwah.cpp.

110 {
111  return L"Wahwah";
112 }

◆ OnDepthSlider()

void EffectWahwah::OnDepthSlider ( wxCommandEvent &  evt)
private

Definition at line 428 of file Wahwah.cpp.

429 {
430  mDepth = evt.GetInt() / SCL_Depth;
431  mDepthT->GetValidator()->TransferToWindow();
432  EnableApply(mUIParent->Validate());
433 }

References Effect::EnableApply(), mDepth, mDepthT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnDepthText()

void EffectWahwah::OnDepthText ( wxCommandEvent &  evt)
private

Definition at line 476 of file Wahwah.cpp.

477 {
478  if (!EnableApply(mUIParent->TransferDataFromWindow()))
479  {
480  return;
481  }
482 
483  mDepthS->SetValue((int) (mDepth * SCL_Depth));
484 }

References Effect::EnableApply(), mDepth, mDepthS, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnFreqOffSlider()

void EffectWahwah::OnFreqOffSlider ( wxCommandEvent &  evt)
private

Definition at line 442 of file Wahwah.cpp.

443 {
444  mFreqOfs = evt.GetInt() / SCL_FreqOfs;
445  mFreqOfsT->GetValidator()->TransferToWindow();
446  EnableApply(mUIParent->Validate());
447 }

References Effect::EnableApply(), mFreqOfs, mFreqOfsT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnFreqOffText()

void EffectWahwah::OnFreqOffText ( wxCommandEvent &  evt)
private

Definition at line 496 of file Wahwah.cpp.

497 {
498  if (!EnableApply(mUIParent->TransferDataFromWindow()))
499  {
500  return;
501  }
502 
503  mFreqOfsS->SetValue((int) (mFreqOfs * SCL_FreqOfs));
504 }

References Effect::EnableApply(), mFreqOfs, mFreqOfsS, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnFreqSlider()

void EffectWahwah::OnFreqSlider ( wxCommandEvent &  evt)
private

Definition at line 411 of file Wahwah.cpp.

412 {
413  mFreq = (double) evt.GetInt() / SCL_Freq;
414  mFreqT->GetValidator()->TransferToWindow();
415  EnableApply(mUIParent->Validate());
416 }

References Effect::EnableApply(), mFreq, mFreqT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnFreqText()

void EffectWahwah::OnFreqText ( wxCommandEvent &  evt)
private

Definition at line 456 of file Wahwah.cpp.

457 {
458  if (!EnableApply(mUIParent->TransferDataFromWindow()))
459  {
460  return;
461  }
462 
463  mFreqS->SetValue((int) (mFreq * SCL_Freq));
464 }

References Effect::EnableApply(), mFreq, mFreqS, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnGainSlider()

void EffectWahwah::OnGainSlider ( wxCommandEvent &  evt)
private

Definition at line 449 of file Wahwah.cpp.

450 {
451  mOutGain = evt.GetInt() / SCL_OutGain;
452  mOutGainT->GetValidator()->TransferToWindow();
453  EnableApply(mUIParent->Validate());
454 }

References Effect::EnableApply(), mOutGain, mOutGainT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnGainText()

void EffectWahwah::OnGainText ( wxCommandEvent &  evt)
private

Definition at line 506 of file Wahwah.cpp.

507 {
508  if (!EnableApply(mUIParent->TransferDataFromWindow()))
509  {
510  return;
511  }
512 
513  mOutGainS->SetValue((int) (mOutGain * SCL_OutGain));
514 }

References Effect::EnableApply(), mOutGain, mOutGainS, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnPhaseSlider()

void EffectWahwah::OnPhaseSlider ( wxCommandEvent &  evt)
private

Definition at line 418 of file Wahwah.cpp.

419 {
420  int val = ((evt.GetInt() + 5) / 10) * 10; // round to nearest multiple of 10
421  val = val > MAX_Phase * SCL_Phase ? MAX_Phase * SCL_Phase : val;
422  mPhaseS->SetValue(val);
423  mPhase = (double) val / SCL_Phase;
424  mPhaseT->GetValidator()->TransferToWindow();
425  EnableApply(mUIParent->Validate());
426 }

References Effect::EnableApply(), mPhase, mPhaseS, mPhaseT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnPhaseText()

void EffectWahwah::OnPhaseText ( wxCommandEvent &  evt)
private

Definition at line 466 of file Wahwah.cpp.

467 {
468  if (!EnableApply(mUIParent->TransferDataFromWindow()))
469  {
470  return;
471  }
472 
473  mPhaseS->SetValue((int) (mPhase * SCL_Phase));
474 }

References Effect::EnableApply(), mPhase, mPhaseS, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnResonanceSlider()

void EffectWahwah::OnResonanceSlider ( wxCommandEvent &  evt)
private

Definition at line 435 of file Wahwah.cpp.

436 {
437  mRes = (double) evt.GetInt() / SCL_Res;
438  mResT->GetValidator()->TransferToWindow();
439  EnableApply(mUIParent->Validate());
440 }

References Effect::EnableApply(), mRes, mResT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnResonanceText()

void EffectWahwah::OnResonanceText ( wxCommandEvent &  evt)
private

Definition at line 486 of file Wahwah.cpp.

487 {
488  if (!EnableApply(mUIParent->TransferDataFromWindow()))
489  {
490  return;
491  }
492 
493  mResS->SetValue((int) (mRes * SCL_Res));
494 }

References Effect::EnableApply(), mRes, mResS, and Effect::mUIParent.

Here is the call graph for this function:

◆ PopulateOrExchange()

void EffectWahwah::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from Effect.

Definition at line 234 of file Wahwah.cpp.

235 {
236  S.SetBorder(5);
237  S.AddSpace(0, 5);
238 
239  S.StartMultiColumn(3, wxEXPAND);
240  {
241  S.SetStretchyCol(2);
242 
243  mFreqT = S.Id(ID_Freq)
244  .Validator<FloatingPointValidator<double>>(
245  5, &mFreq, NumValidatorStyle::ONE_TRAILING_ZERO, MIN_Freq, MAX_Freq)
246  .AddTextBox(XXO("LFO Freq&uency (Hz):"), wxT(""), 12);
247 
248  mFreqS = S.Id(ID_Freq)
249  .Name(XO("LFO frequency in hertz"))
250  .Style(wxSL_HORIZONTAL)
251  .MinSize( { 100, -1 } )
252  .AddSlider( {}, DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, MIN_Freq * SCL_Freq);
253 
254  mPhaseT = S.Id(ID_Phase)
255  .Validator<FloatingPointValidator<double>>(
256  1, &mPhase, NumValidatorStyle::DEFAULT, MIN_Phase, MAX_Phase)
257  .AddTextBox(XXO("LFO Sta&rt Phase (deg.):"), wxT(""), 12);
258 
259  mPhaseS = S.Id(ID_Phase)
260  .Name(XO("LFO start phase in degrees"))
261  .Style(wxSL_HORIZONTAL)
262  .MinSize( { 100, -1 } )
263  .AddSlider( {}, DEF_Phase * SCL_Phase, MAX_Phase * SCL_Phase, MIN_Phase * SCL_Phase);
264  mPhaseS->SetLineSize(10);
265 
266  mDepthT = S.Id(ID_Depth)
267  .Validator<IntegerValidator<int>>(
268  &mDepth, NumValidatorStyle::DEFAULT, MIN_Depth, MAX_Depth)
269  .AddTextBox(XXO("Dept&h (%):"), wxT(""), 12);
270 
271  mDepthS = S.Id(ID_Depth)
272  .Name(XO("Depth in percent"))
273  .Style(wxSL_HORIZONTAL)
274  .MinSize( { 100, -1 } )
275  .AddSlider( {}, DEF_Depth * SCL_Depth, MAX_Depth * SCL_Depth, MIN_Depth * SCL_Depth);
276 
277  mResT = S.Id(ID_Res)
278  .Validator<FloatingPointValidator<double>>(
279  1, &mRes, NumValidatorStyle::DEFAULT, MIN_Res, MAX_Res)
280  .AddTextBox(XXO("Reso&nance:"), wxT(""), 12);
281 
282  mResS = S.Id(ID_Res)
283  .Name(XO("Resonance"))
284  .Style(wxSL_HORIZONTAL)
285  .MinSize( { 100, -1 } )
286  .AddSlider( {}, DEF_Res * SCL_Res, MAX_Res * SCL_Res, MIN_Res * SCL_Res);
287 
288  mFreqOfsT = S.Id(ID_FreqOfs)
289  .Validator<IntegerValidator<int>>(
290  &mFreqOfs, NumValidatorStyle::DEFAULT, MIN_FreqOfs, MAX_FreqOfs)
291  .AddTextBox(XXO("Wah Frequency Offse&t (%):"), wxT(""), 12);
292 
293  mFreqOfsS = S.Id(ID_FreqOfs)
294  .Name(XO("Wah frequency offset in percent"))
295  .Style(wxSL_HORIZONTAL)
296  .MinSize( { 100, -1 } )
297  .AddSlider( {}, DEF_FreqOfs * SCL_FreqOfs, MAX_FreqOfs * SCL_FreqOfs, MIN_FreqOfs * SCL_FreqOfs);
298 
299  mOutGainT = S.Id(ID_OutGain)
300  .Validator<FloatingPointValidator<double>>(
301  1, &mOutGain, NumValidatorStyle::DEFAULT, MIN_OutGain, MAX_OutGain)
302  .AddTextBox(XXO("&Output gain (dB):"), wxT(""), 12);
303 
304  mOutGainS = S.Id(ID_OutGain)
305  .Name(XO("Output gain (dB)"))
306  .Style(wxSL_HORIZONTAL)
307  .MinSize( { 100, -1 } )
308  .AddSlider( {}, DEF_OutGain * SCL_OutGain, MAX_OutGain * SCL_OutGain, MIN_OutGain * SCL_OutGain);
309  }
310  S.EndMultiColumn();
311 }

References ID_Depth, ID_Freq, ID_FreqOfs, ID_OutGain, ID_Phase, ID_Res, mDepth, mDepthS, mDepthT, mFreq, mFreqOfs, mFreqOfsS, mFreqOfsT, mFreqS, mFreqT, mOutGain, mOutGainS, mOutGainT, mPhase, mPhaseS, mPhaseT, mRes, mResS, mResT, S, XO, and XXO.

◆ ProcessBlock()

size_t EffectWahwah::ProcessBlock ( float **  inBlock,
float **  outBlock,
size_t  blockLen 
)
overridevirtual

Called for destructive, non-realtime effect computation.

Reimplemented from Effect.

Definition at line 150 of file Wahwah.cpp.

151 {
152  return InstanceProcess(mMaster, inBlock, outBlock, blockLen);
153 }

References InstanceProcess(), and mMaster.

Here is the call graph for this function:

◆ ProcessInitialize()

bool EffectWahwah::ProcessInitialize ( sampleCount  totalLen,
ChannelNames  chanMap = NULL 
)
overridevirtual

Called for destructive, non-realtime effect computation.

Reimplemented from Effect.

Definition at line 138 of file Wahwah.cpp.

139 {
141 
142  if (chanMap[0] == ChannelNameFrontRight)
143  {
144  mMaster.phase += M_PI;
145  }
146 
147  return true;
148 }

References ChannelNameFrontRight, InstanceInit(), M_PI, mMaster, Effect::mSampleRate, and EffectWahwahState::phase.

Here is the call graph for this function:

◆ RealtimeAddProcessor()

bool EffectWahwah::RealtimeAddProcessor ( unsigned  numChannels,
float  sampleRate 
)
overridevirtual

Reimplemented from Effect.

Definition at line 164 of file Wahwah.cpp.

165 {
166  EffectWahwahState slave;
167 
168  InstanceInit(slave, sampleRate);
169 
170  mSlaves.push_back(slave);
171 
172  return true;
173 }

References InstanceInit(), and mSlaves.

Here is the call graph for this function:

◆ RealtimeFinalize()

bool EffectWahwah::RealtimeFinalize ( )
overridevirtual

Reimplemented from Effect.

Definition at line 175 of file Wahwah.cpp.

176 {
177  mSlaves.clear();
178 
179  return true;
180 }

References mSlaves.

◆ RealtimeInitialize()

bool EffectWahwah::RealtimeInitialize ( )
overridevirtual

Reimplemented from Effect.

Definition at line 155 of file Wahwah.cpp.

156 {
157  SetBlockSize(512);
158 
159  mSlaves.clear();
160 
161  return true;
162 }

References mSlaves, and Effect::SetBlockSize().

Here is the call graph for this function:

◆ RealtimeProcess()

size_t EffectWahwah::RealtimeProcess ( int  group,
float **  inbuf,
float **  outbuf,
size_t  numSamples 
)
overridevirtual

Reimplemented from Effect.

Definition at line 182 of file Wahwah.cpp.

186 {
187 
188  return InstanceProcess(mSlaves[group], inbuf, outbuf, numSamples);
189 }

References InstanceProcess(), and mSlaves.

Here is the call graph for this function:

◆ SetAutomationParameters()

bool EffectWahwah::SetAutomationParameters ( CommandParameters parms)
overridevirtual

Change settings to those stored in parms.

Reimplemented from Effect.

Definition at line 213 of file Wahwah.cpp.

214 {
215  ReadAndVerifyDouble(Freq);
216  ReadAndVerifyDouble(Phase);
217  ReadAndVerifyInt(Depth);
218  ReadAndVerifyDouble(Res);
219  ReadAndVerifyInt(FreqOfs);
220  ReadAndVerifyDouble(OutGain);
221 
222  mFreq = Freq;
223  mPhase = Phase;
224  mDepth = Depth;
225  mRes = Res;
226  mFreqOfs = FreqOfs;
227  mOutGain = OutGain;
228 
229  return true;
230 }

References mDepth, mFreq, mFreqOfs, mOutGain, mPhase, mRes, ReadAndVerifyDouble, and ReadAndVerifyInt.

◆ SupportsRealtime()

bool EffectWahwah::SupportsRealtime ( )
overridevirtual

Whether the effect supports realtime previewing (while audio is playing).

Reimplemented from Effect.

Definition at line 121 of file Wahwah.cpp.

122 {
123  return true;
124 }

◆ TransferDataFromWindow()

bool EffectWahwah::TransferDataFromWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 330 of file Wahwah.cpp.

331 {
332  if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
333  {
334  return false;
335  }
336 
337  return true;
338 }

References Effect::mUIParent.

◆ TransferDataToWindow()

bool EffectWahwah::TransferDataToWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 313 of file Wahwah.cpp.

314 {
315  if (!mUIParent->TransferDataToWindow())
316  {
317  return false;
318  }
319 
320  mFreqS->SetValue((int) (mFreq * SCL_Freq));
321  mPhaseS->SetValue((int) (mPhase * SCL_Phase));
322  mDepthS->SetValue((int) (mDepth * SCL_Depth));
323  mResS->SetValue((int) (mRes * SCL_Res));
324  mFreqOfsS->SetValue((int) (mFreqOfs * SCL_FreqOfs));
325  mOutGainS->SetValue((int) (mOutGain * SCL_OutGain));
326 
327  return true;
328 }

References mDepth, mDepthS, mFreq, mFreqOfs, mFreqOfsS, mFreqS, mOutGain, mOutGainS, mPhase, mPhaseS, mRes, mResS, and Effect::mUIParent.

Member Data Documentation

◆ mDepth

int EffectWahwah::mDepth
private

◆ mDepthS

wxSlider* EffectWahwah::mDepthS
private

Definition at line 133 of file Wahwah.h.

Referenced by OnDepthText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mDepthT

wxTextCtrl* EffectWahwah::mDepthT
private

Definition at line 126 of file Wahwah.h.

Referenced by OnDepthSlider(), and PopulateOrExchange().

◆ mFreq

double EffectWahwah::mFreq
private

◆ mFreqOfs

int EffectWahwah::mFreqOfs
private

◆ mFreqOfsS

wxSlider* EffectWahwah::mFreqOfsS
private

Definition at line 135 of file Wahwah.h.

Referenced by OnFreqOffText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mFreqOfsT

wxTextCtrl* EffectWahwah::mFreqOfsT
private

Definition at line 128 of file Wahwah.h.

Referenced by OnFreqOffSlider(), and PopulateOrExchange().

◆ mFreqS

wxSlider* EffectWahwah::mFreqS
private

Definition at line 131 of file Wahwah.h.

Referenced by OnFreqText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mFreqT

wxTextCtrl* EffectWahwah::mFreqT
private

Definition at line 124 of file Wahwah.h.

Referenced by OnFreqSlider(), and PopulateOrExchange().

◆ mMaster

EffectWahwahState EffectWahwah::mMaster
private

Definition at line 102 of file Wahwah.h.

Referenced by ProcessBlock(), and ProcessInitialize().

◆ mOutGain

double EffectWahwah::mOutGain
private

◆ mOutGainS

wxSlider* EffectWahwah::mOutGainS
private

Definition at line 136 of file Wahwah.h.

Referenced by OnGainText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mOutGainT

wxTextCtrl* EffectWahwah::mOutGainT
private

Definition at line 129 of file Wahwah.h.

Referenced by OnGainSlider(), and PopulateOrExchange().

◆ mPhase

double EffectWahwah::mPhase
private

◆ mPhaseS

wxSlider* EffectWahwah::mPhaseS
private

Definition at line 132 of file Wahwah.h.

Referenced by OnPhaseSlider(), OnPhaseText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mPhaseT

wxTextCtrl* EffectWahwah::mPhaseT
private

Definition at line 125 of file Wahwah.h.

Referenced by OnPhaseSlider(), and PopulateOrExchange().

◆ mRes

double EffectWahwah::mRes
private

◆ mResS

wxSlider* EffectWahwah::mResS
private

Definition at line 134 of file Wahwah.h.

Referenced by OnResonanceText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mResT

wxTextCtrl* EffectWahwah::mResT
private

Definition at line 127 of file Wahwah.h.

Referenced by OnResonanceSlider(), and PopulateOrExchange().

◆ mSlaves

std::vector<EffectWahwahState> EffectWahwah::mSlaves
private

◆ Symbol

const ComponentInterfaceSymbol EffectWahwah::Symbol { XO("Wahwah") }
static

Definition at line 42 of file Wahwah.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
EffectWahwah::mSlaves
std::vector< EffectWahwahState > mSlaves
Definition: Wahwah.h:103
EffectWahwah::mFreqOfsT
wxTextCtrl * mFreqOfsT
Definition: Wahwah.h:128
ID_Phase
@ ID_Phase
Definition: Wahwah.cpp:37
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:56
DB_TO_LINEAR
const double MIN_Threshold_Linear DB_TO_LINEAR(MIN_Threshold_dB)
Effect::SetLinearEffectFlag
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: Effect.cpp:1764
EffectWahwah::mOutGain
double mOutGain
Definition: Wahwah.h:122
Effect::EnableApply
bool EnableApply(bool enable=true)
Definition: Effect.cpp:1694
S
#define S(N)
Definition: ToChars.cpp:64
EffectWahwahState::samplerate
float samplerate
Definition: Wahwah.h:28
ChannelNameFrontRight
@ ChannelNameFrontRight
Definition: EffectInterface.h:166
EffectWahwahState::depth
double depth
Definition: Wahwah.h:29
EffectWahwah::mResT
wxTextCtrl * mResT
Definition: Wahwah.h:127
EffectWahwahState::b1
double b1
Definition: Wahwah.h:36
XO
#define XO(s)
Definition: Internat.h:31
EffectWahwah::mDepth
int mDepth
Definition: Wahwah.h:119
EffectWahwahState::a2
double a2
Definition: Wahwah.h:36
ID_FreqOfs
@ ID_FreqOfs
Definition: Wahwah.cpp:40
EffectWahwahState::freqofs
double freqofs
Definition: Wahwah.h:30
EffectWahwah::mDepthS
wxSlider * mDepthS
Definition: Wahwah.h:133
EffectWahwah::mPhaseS
wxSlider * mPhaseS
Definition: Wahwah.h:132
EffectWahwahState::b2
double b2
Definition: Wahwah.h:36
EffectWahwahState::skipcount
unsigned long skipcount
Definition: Wahwah.h:34
ReadAndVerifyInt
#define ReadAndVerifyInt(name)
Definition: Effect.h:591
EffectWahwah::mPhaseT
wxTextCtrl * mPhaseT
Definition: Wahwah.h:125
XXO
#define XXO(s)
Definition: Internat.h:44
EffectWahwahState::outgain
double outgain
Definition: Wahwah.h:32
EffectWahwah::mOutGainS
wxSlider * mOutGainS
Definition: Wahwah.h:136
EffectWahwahState::phase
double phase
Definition: Wahwah.h:31
EffectWahwah::mFreqT
wxTextCtrl * mFreqT
Definition: Wahwah.h:124
EffectWahwah::mRes
double mRes
Definition: Wahwah.h:120
EffectWahwah::mFreqOfsS
wxSlider * mFreqOfsS
Definition: Wahwah.h:135
EffectWahwahState::xn2
double xn2
Definition: Wahwah.h:35
EffectWahwahState::yn1
double yn1
Definition: Wahwah.h:35
EffectWahwahState::lfoskip
double lfoskip
Definition: Wahwah.h:33
ReadAndVerifyDouble
#define ReadAndVerifyDouble(name)
Definition: Effect.h:592
EffectWahwah::mDepthT
wxTextCtrl * mDepthT
Definition: Wahwah.h:126
EffectWahwah::mFreqOfs
int mFreqOfs
Definition: Wahwah.h:121
ID_Depth
@ ID_Depth
Definition: Wahwah.cpp:38
EffectWahwah::mFreqS
wxSlider * mFreqS
Definition: Wahwah.h:131
EffectWahwah::mMaster
EffectWahwahState mMaster
Definition: Wahwah.h:102
Effect::mSampleRate
double mSampleRate
Definition: Effect.h:418
lfoskipsamples
#define lfoskipsamples
Definition: Wahwah.cpp:55
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:438
EffectWahwah::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Wahwah.h:42
ID_OutGain
@ ID_OutGain
Definition: Wahwah.cpp:41
EffectWahwahState::a1
double a1
Definition: Wahwah.h:36
EffectWahwahState::xn1
double xn1
Definition: Wahwah.h:35
EffectWahwah::mResS
wxSlider * mResS
Definition: Wahwah.h:134
EffectWahwah::InstanceInit
void InstanceInit(EffectWahwahState &data, float sampleRate)
Definition: Wahwah.cpp:342
EffectWahwahState::a0
double a0
Definition: Wahwah.h:36
M_PI
#define M_PI
Definition: Distortion.cpp:29
ID_Res
@ ID_Res
Definition: Wahwah.cpp:39
EffectWahwahState::yn2
double yn2
Definition: Wahwah.h:35
EffectWahwah::mOutGainT
wxTextCtrl * mOutGainT
Definition: Wahwah.h:129
ID_Freq
@ ID_Freq
Definition: Wahwah.cpp:36
EffectWahwah::mFreq
double mFreq
Definition: Wahwah.h:117
Effect::SetBlockSize
size_t SetBlockSize(size_t maxBlockSize) override
Definition: Effect.cpp:294
EffectWahwahState::b0
double b0
Definition: Wahwah.h:36
EffectWahwah::mPhase
double mPhase
Definition: Wahwah.h:118
EffectWahwahState
Definition: Wahwah.h:26
EffectWahwah::InstanceProcess
size_t InstanceProcess(EffectWahwahState &data, float **inBlock, float **outBlock, size_t blockLen)
Definition: Wahwah.cpp:364