Audacity 3.2.0
Wahwah.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 Wahwah
6
7 Effect programming:
8 Nasca Octavian Paul (Paul Nasca)
9
10 UI programming:
11 Dominic Mazzoni (with the help of wxDesigner)
12 Vaughan Johnson (Preview)
13
14**********************************************************************/
15
16#ifndef __AUDACITY_EFFECT_WAHWAH__
17#define __AUDACITY_EFFECT_WAHWAH__
18
20#include "../ShuttleAutomation.h"
21
22class ShuttleGui;
23
25{
26public:
28 double depth;
29 double freqofs;
30 double phase;
31 double outgain;
32 double lfoskip;
33 unsigned long skipcount;
34 double xn1, xn2, yn1, yn2;
35 double b0, b1, b2, a0, a1, a2;
36};
37
38
40{
41 /* Parameters:
42 mFreq - LFO frequency
43 mPhase - LFO startphase in RADIANS - useful for stereo WahWah
44 mDepth - Wah depth
45 mRes - Resonance
46 mFreqOfs - Wah frequency offset
47 mOutGain - output gain
48
49 !!!!!!!!!!!!! IMPORTANT!!!!!!!!! :
50 mDepth and mFreqOfs should be from 0(min) to 1(max) !
51 mRes should be greater than 0 ! */
52
53 static constexpr double freqDefault = 1.5;
54 static constexpr double phaseDefault = 0.0;
55 static constexpr int depthDefault = 70;
56 static constexpr double resDefault = 2.5;
57 static constexpr int freqOfsDefault = 30;
58 static constexpr double outGainDefault = -6.0;
59
60
61 double mFreq { freqDefault };
62 double mPhase { phaseDefault };
64 double mRes { resDefault };
67};
68
69
70class EffectWahwah final : public EffectWithSettings<EffectWahwahSettings, PerTrackEffect>
71{
72public:
73
75
77 virtual ~EffectWahwah();
78
79 // ComponentInterface implementation
80
81 ComponentInterfaceSymbol GetSymbol() const override;
82 TranslatableString GetDescription() const override;
83 ManualPageID ManualPage() const override;
84
85 // EffectDefinitionInterface implementation
86
87 EffectType GetType() const override;
88 bool SupportsRealtime() const override;
89
90 unsigned GetAudioInCount() const override;
91 unsigned GetAudioOutCount() const override;
92
93 // Effect implementation
94
95 std::unique_ptr<EffectUIValidator> PopulateOrExchange(
96 ShuttleGui & S, EffectInstance &instance, EffectSettingsAccess &access)
97 override;
98
99 struct Validator;
100 struct Instance;
101 std::shared_ptr<EffectInstance> MakeInstance() const override;
102
103private:
104 // EffectWahwah implementation
105
106 const EffectParameterMethods& Parameters() const override;
107
110static constexpr EffectParameter Depth { &EffectWahwahSettings::mDepth, L"Depth", EffectWahwahSettings::depthDefault, 0, 100, 1 }; // scaled to 0-1 before processing
111static constexpr EffectParameter Res { &EffectWahwahSettings::mRes, L"Resonance", EffectWahwahSettings::resDefault, 0.1, 10.0, 10 };
112static constexpr EffectParameter FreqOfs{ &EffectWahwahSettings::mFreqOfs, L"Offset", EffectWahwahSettings::freqOfsDefault, 0, 100, 1 }; // scaled to 0-1 before processing
114};
115
116#endif
EffectType
#define S(N)
Definition: ToChars.cpp:64
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Performs effect computation.
Interface for manipulations of an Effect's settings.
An Effect that adds a 'spectral glide'.
Definition: Wahwah.h:71
static constexpr EffectParameter Freq
Definition: Wahwah.h:108
static constexpr EffectParameter FreqOfs
Definition: Wahwah.h:112
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
Definition: Wahwah.cpp:218
static constexpr EffectParameter Res
Definition: Wahwah.h:111
static constexpr EffectParameter Depth
Definition: Wahwah.h:110
unsigned GetAudioInCount() const override
How many input buffers to allocate at once.
Definition: Wahwah.cpp:213
const EffectParameterMethods & Parameters() const override
Definition: Wahwah.cpp:33
static const ComponentInterfaceSymbol Symbol
Definition: Wahwah.h:74
std::unique_ptr< EffectUIValidator > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
Add controls to effect panel; always succeeds.
Definition: Wahwah.cpp:278
ComponentInterfaceSymbol GetSymbol() const override
Definition: Wahwah.cpp:186
ManualPageID ManualPage() const override
Name of a page in the Audacity alpha manual, default is empty.
Definition: Wahwah.cpp:196
EffectType GetType() const override
Type determines how it behaves.
Definition: Wahwah.cpp:203
virtual ~EffectWahwah()
Definition: Wahwah.cpp:180
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
Definition: Wahwah.cpp:170
static constexpr EffectParameter Phase
Definition: Wahwah.h:109
TranslatableString GetDescription() const override
Definition: Wahwah.cpp:191
static constexpr EffectParameter OutGain
Definition: Wahwah.h:113
bool SupportsRealtime() const override
Whether the effect supports realtime previewing (while audio is playing).
Definition: Wahwah.cpp:208
double yn2
Definition: Wahwah.h:34
double freqofs
Definition: Wahwah.h:29
double xn2
Definition: Wahwah.h:34
float samplerate
Definition: Wahwah.h:27
unsigned long skipcount
Definition: Wahwah.h:33
double yn1
Definition: Wahwah.h:34
double outgain
Definition: Wahwah.h:31
double xn1
Definition: Wahwah.h:34
double phase
Definition: Wahwah.h:30
double depth
Definition: Wahwah.h:28
double lfoskip
Definition: Wahwah.h:32
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
Holds a msgid for the translation catalog; may also bind format arguments.
static constexpr int depthDefault
Definition: Wahwah.h:55
static constexpr int freqOfsDefault
Definition: Wahwah.h:57
static constexpr double outGainDefault
Definition: Wahwah.h:58
static constexpr double resDefault
Definition: Wahwah.h:56
static constexpr double freqDefault
Definition: Wahwah.h:53
static constexpr double phaseDefault
Definition: Wahwah.h:54