1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-08 14:13:57 +01:00

Experimental RTP for Phaser and Wahwah

This can be disabled by undefining EXPERIMENTAL_REALTIME_AUDACITY_EFFECTS
in Experimental.cpp
This commit is contained in:
Leland Lucius
2015-08-01 07:03:02 -05:00
parent 7414b000c2
commit f3ef8a27c7
6 changed files with 301 additions and 105 deletions

View File

@@ -27,6 +27,21 @@ class ShuttleGui;
#define WAHWAH_PLUGIN_SYMBOL XO("Wahwah")
class EffectWahwahState
{
public:
float samplerate;
double depth;
double freqofs;
double phase;
double lfoskip;
unsigned long skipcount;
double xn1, xn2, yn1, yn2;
double b0, b1, b2, a0, a1, a2;
};
WX_DECLARE_OBJARRAY(EffectWahwahState, EffectWahwahStateArray);
class EffectWahwah : public Effect
{
public:
@@ -41,6 +56,7 @@ public:
// EffectIdentInterface implementation
virtual EffectType GetType();
virtual bool SupportsRealtime();
// EffectClientInterface implementation
@@ -48,6 +64,13 @@ public:
virtual int GetAudioOutCount();
virtual bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap = NULL);
virtual sampleCount ProcessBlock(float **inBlock, float **outBlock, sampleCount blockLen);
virtual bool RealtimeInitialize();
virtual bool RealtimeAddProcessor(int numChannels, float sampleRate);
virtual bool RealtimeFinalize();
virtual sampleCount RealtimeProcess(int group,
float **inbuf,
float **outbuf,
sampleCount numSamples);
virtual bool GetAutomationParameters(EffectAutomationParameters & parms);
virtual bool SetAutomationParameters(EffectAutomationParameters & parms);
@@ -60,6 +83,9 @@ public:
private:
// EffectWahwah implementation
void InstanceInit(EffectWahwahState & data, float sampleRate);
sampleCount InstanceProcess(EffectWahwahState & data, float **inBlock, float **outBlock, sampleCount blockLen);
void OnFreqSlider(wxCommandEvent & evt);
void OnPhaseSlider(wxCommandEvent & evt);
void OnDepthSlider(wxCommandEvent & evt);
@@ -73,15 +99,10 @@ private:
void OnFreqOffText(wxCommandEvent & evt);
private:
double depth;
double freqofs;
double phase;
double lfoskip;
unsigned long skipcount;
double xn1, xn2, yn1, yn2;
double b0, b1, b2, a0, a1, a2;
EffectWahwahState mMaster;
EffectWahwahStateArray mSlaves;
/* Parameters:
/* Parameters:
mFreq - LFO frequency
mPhase - LFO startphase in RADIANS - useful for stereo WahWah
mDepth - Wah depth