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<
71 EffectWahwahSettings, StatelessPerTrackEffect
72>
73{
74public:
75
77
79 virtual ~EffectWahwah();
80
81 // ComponentInterface implementation
82
83 ComponentInterfaceSymbol GetSymbol() const override;
84 TranslatableString GetDescription() const override;
85 ManualPageID ManualPage() const override;
86
87 // EffectDefinitionInterface implementation
88
89 EffectType GetType() const override;
90 RealtimeSince RealtimeSupport() const override;
91
92 // Effect implementation
93
94 std::unique_ptr<EffectEditor> MakeEditor(
95 ShuttleGui & S, EffectInstance &instance,
96 EffectSettingsAccess &access, const EffectOutputs *pOutputs)
97 const override;
98
99 struct Editor;
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,...
RealtimeSince
In which versions of Audacity was an effect realtime capable?
Performs effect computation.
Hold values to send to effect output meters.
Interface for manipulations of an Effect's settings.
An Effect that adds a 'spectral glide'.
Definition: Wahwah.h:73
static constexpr EffectParameter Freq
Definition: Wahwah.h:108
static constexpr EffectParameter FreqOfs
Definition: Wahwah.h:112
static constexpr EffectParameter Res
Definition: Wahwah.h:111
static constexpr EffectParameter Depth
Definition: Wahwah.h:110
const EffectParameterMethods & Parameters() const override
Definition: Wahwah.cpp:34
static const ComponentInterfaceSymbol Symbol
Definition: Wahwah.h:76
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
std::unique_ptr< EffectEditor > MakeEditor(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) const override
Called only from PopulateUI, to add controls to effect panel.
Definition: Wahwah.cpp:264
RealtimeSince RealtimeSupport() const override
Since which version of Audacity has the effect supported realtime?
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:640
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