Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename all Effect classes to ZynEffect classes #16

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Effects/Alienwah.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "Alienwah.h"

Alienwah::Alienwah(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize)
:Effect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize),
:ZynEffect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize),
lfo(srate, bufsize),
oldl(NULL),
oldr(NULL)
Expand Down
12 changes: 6 additions & 6 deletions src/Effects/Alienwah.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
#define ALIENWAH_H

#include <complex>
#include "Effect.h"
#include "EffectLFO.h"
#include "ZynEffect.h"
#include "ZynEffectLFO.h"

#define MAX_ALIENWAH_DELAY 100

/**"AlienWah" Effect*/
class Alienwah:public Effect
/**"AlienWah" ZynEffect*/
class Alienwah:public ZynEffect
{
public:
/**
* Constructor
* @param insertion_ true for insertion Effect
* @param insertion_ true for insertion ZynEffect
* @param efxoutl_ Pointer to Alienwah's left channel output buffer
* @param efxoutr_ Pointer to Alienwah's left channel output buffer
* @return Initialized Alienwah
Expand All @@ -54,7 +54,7 @@ class Alienwah:public Effect

private:
//Alienwah Parameters
EffectLFO lfo; //lfo-ul Alienwah
ZynEffectLFO lfo; //lfo-ul Alienwah
unsigned char Pvolume;
unsigned char Pdepth; //the depth of the Alienwah
unsigned char Pfb; //feedback
Expand Down
6 changes: 3 additions & 3 deletions src/Effects/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ set(zynaddsubfx_effect_SRCS
Effects/Distorsion.cpp
Effects/DynamicFilter.cpp
Effects/Echo.cpp
Effects/Effect.cpp
Effects/EffectLFO.cpp
Effects/EffectMgr.cpp
Effects/ZynEffect.cpp
Effects/ZynEffectLFO.cpp
Effects/ZynEffectMgr.cpp
Effects/EQ.cpp
Effects/Phaser.cpp
Effects/Reverb.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/Effects/Chorus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
using namespace std;

Chorus::Chorus(bool insertion_, float *const efxoutl_, float *efxoutr_, unsigned int srate, int bufsize)
:Effect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize),
:ZynEffect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize),
lfo(srate, bufsize),
maxdelay((int)(MAX_CHORUS_DELAY / 1000.0f * samplerate_f)),
delaySample(new float[maxdelay], new float[maxdelay])
Expand Down
8 changes: 4 additions & 4 deletions src/Effects/Chorus.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

#ifndef CHORUS_H
#define CHORUS_H
#include "Effect.h"
#include "EffectLFO.h"
#include "ZynEffect.h"
#include "ZynEffectLFO.h"
#include "../Misc/Stereo.h"

#define MAX_CHORUS_DELAY 250.0f //ms

/**Chorus and Flange effects*/
class Chorus:public Effect
class Chorus:public ZynEffect
{
public:
Chorus(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize);
Expand Down Expand Up @@ -85,7 +85,7 @@ class Chorus:public Effect
unsigned char Pfb; //feedback
unsigned char Pflangemode; //how the LFO is scaled, to result chorus or flange
unsigned char Poutsub; //if I wish to substract the output instead of the adding it
EffectLFO lfo; //lfo-ul chorus
ZynEffectLFO lfo; //lfo-ul chorus


//Parameter Controls
Expand Down
4 changes: 2 additions & 2 deletions src/Effects/Distorsion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <cmath>

Distorsion::Distorsion(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize)
:Effect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize),
:ZynEffect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize),
Pvolume(50),
Pdrive(90),
Plevel(64),
Expand Down Expand Up @@ -75,7 +75,7 @@ void Distorsion::applyfilters(float *efxoutl, float *efxoutr)
}


//Effect output
//ZynEffect output
void Distorsion::out(const Stereo<float *> &smp)
{
float inputvol = powf(5.0f, (Pdrive - 32.0f) / 127.0f);
Expand Down
8 changes: 4 additions & 4 deletions src/Effects/Distorsion.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
ZynAddSubFX - a software synthesizer

Distorsion.h - Distorsion Effect
Distorsion.h - Distorsion ZynEffect
Copyright (C) 2002-2005 Nasca Octavian Paul
Author: Nasca Octavian Paul

Expand All @@ -23,10 +23,10 @@
#ifndef DISTORSION_H
#define DISTORSION_H

#include "Effect.h"
#include "ZynEffect.h"

/**Distortion Effect*/
class Distorsion:public Effect
/**Distortion ZynEffect*/
class Distorsion:public ZynEffect
{
public:
Distorsion(bool insertion, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize);
Expand Down
2 changes: 1 addition & 1 deletion src/Effects/DynamicFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "../DSP/Filter.h"

DynamicFilter::DynamicFilter(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize)
:Effect(insertion_, efxoutl_, efxoutr_, new FilterParams(0, 64, 64), 0, srate, bufsize),
:ZynEffect(insertion_, efxoutl_, efxoutr_, new FilterParams(0, 64, 64), 0, srate, bufsize),
lfo(srate, bufsize),
Pvolume(110),
Pdepth(0),
Expand Down
10 changes: 5 additions & 5 deletions src/Effects/DynamicFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#ifndef DYNAMICFILTER_H
#define DYNAMICFILTER_H

#include "Effect.h"
#include "EffectLFO.h"
#include "ZynEffect.h"
#include "ZynEffectLFO.h"

/**DynamicFilter Effect*/
class DynamicFilter:public Effect
/**DynamicFilter ZynEffect*/
class DynamicFilter:public ZynEffect
{
public:
DynamicFilter(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize);
Expand All @@ -41,7 +41,7 @@ class DynamicFilter:public Effect

private:
//Parametrii DynamicFilter
EffectLFO lfo; //lfo-ul DynamicFilter
ZynEffectLFO lfo; //lfo-ul DynamicFilter
unsigned char Pvolume; //Volume
unsigned char Pdepth; //the depth of the lfo
unsigned char Pampsns; //how the filter varies according to the input amplitude
Expand Down
4 changes: 2 additions & 2 deletions src/Effects/EQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "../DSP/AnalogFilter.h"

EQ::EQ(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize)
:Effect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize)
:ZynEffect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize)
{
for(int i = 0; i < MAX_EQ_BANDS; ++i) {
filter[i].Ptype = 0;
Expand Down Expand Up @@ -61,7 +61,7 @@ void EQ::cleanup(void)
}
}

//Effect output
//ZynEffect output
void EQ::out(const Stereo<float *> &smp)
{
for(int i = 0; i < buffersize; ++i) {
Expand Down
8 changes: 4 additions & 4 deletions src/Effects/EQ.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
ZynAddSubFX - a software synthesizer

EQ.h - EQ Effect
EQ.h - EQ ZynEffect
Copyright (C) 2002-2005 Nasca Octavian Paul
Author: Nasca Octavian Paul

Expand All @@ -23,10 +23,10 @@
#ifndef EQ_H
#define EQ_H

#include "Effect.h"
#include "ZynEffect.h"

/**EQ Effect*/
class EQ:public Effect
/**EQ ZynEffect*/
class EQ:public ZynEffect
{
public:
EQ(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize);
Expand Down
4 changes: 2 additions & 2 deletions src/Effects/Echo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define MAX_DELAY 2

Echo::Echo(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize)
:Effect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize),
:ZynEffect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize),
samplerate(srate),
Pvolume(50),
Pdelay(60),
Expand Down Expand Up @@ -82,7 +82,7 @@ void Echo::initdelays(void)
ndelta.r = max(1, (int) (dr * samplerate));
}

//Effect output
//ZynEffect output
void Echo::out(const Stereo<float *> &input)
{
for(int i = 0; i < buffersize; ++i) {
Expand Down
8 changes: 4 additions & 4 deletions src/Effects/Echo.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
ZynAddSubFX - a software synthesizer

Echo.h - Echo Effect
Echo.h - Echo ZynEffect
Copyright (C) 2002-2005 Nasca Octavian Paul
Author: Nasca Octavian Paul

Expand All @@ -23,11 +23,11 @@
#ifndef ECHO_H
#define ECHO_H

#include "Effect.h"
#include "ZynEffect.h"
#include "../Misc/Stereo.h"

/**Echo Effect*/
class Echo:public Effect
/**Echo ZynEffect*/
class Echo:public ZynEffect
{
public:
Echo(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize);
Expand Down
4 changes: 2 additions & 2 deletions src/Effects/Phaser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ using namespace std;
#define ZERO_ 0.00001f // Same idea as above.

Phaser::Phaser(const int &insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize)
:Effect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize), lfo(srate, bufsize), old(NULL), xn1(NULL),
:ZynEffect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize), lfo(srate, bufsize), old(NULL), xn1(NULL),
yn1(NULL), diff(0.0f), oldgain(0.0f), fb(0.0f)
{
analog_setup();
Expand Down Expand Up @@ -93,7 +93,7 @@ Phaser::~Phaser()
}

/*
* Effect output
* ZynEffect output
*/
void Phaser::out(const Stereo<float *> &input)
{
Expand Down
8 changes: 4 additions & 4 deletions src/Effects/Phaser.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
#ifndef PHASER_H
#define PHASER_H
#include "../globals.h"
#include "Effect.h"
#include "EffectLFO.h"
#include "ZynEffect.h"
#include "ZynEffectLFO.h"

#define MAX_PHASER_STAGES 12

class Phaser:public Effect
class Phaser:public ZynEffect
{
public:
Phaser(const int &insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize);
Expand All @@ -45,7 +45,7 @@ class Phaser:public Effect

private:
//Phaser parameters
EffectLFO lfo; //Phaser modulator
ZynEffectLFO lfo; //Phaser modulator
unsigned char Pvolume; //Used to set wet/dry mix
unsigned char Pdistortion; //Model distortion added by FET element
unsigned char Pdepth; //Depth of phaser sweep
Expand Down
4 changes: 2 additions & 2 deletions src/Effects/Reverb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <cmath>

Reverb::Reverb(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize)
:Effect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize),
:ZynEffect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize),
// defaults
Pvolume(48),
Ptime(64),
Expand Down Expand Up @@ -138,7 +138,7 @@ void Reverb::processmono(int ch, float *output, float *inputbuf)
}
}

//Effect output
//ZynEffect output
void Reverb::out(const Stereo<float *> &smp)
{
if(!Pvolume && insertion)
Expand Down
6 changes: 3 additions & 3 deletions src/Effects/Reverb.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
#ifndef REVERB_H
#define REVERB_H

#include "Effect.h"
#include "ZynEffect.h"

#define REV_COMBS 8
#define REV_APS 4

/**Creates Reverberation Effects*/
class Reverb:public Effect
/**Creates Reverberation ZynEffects*/
class Reverb:public ZynEffect
{
public:
Reverb(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize);
Expand Down
14 changes: 7 additions & 7 deletions src/Effects/Effect.cpp → src/Effects/ZynEffect.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
ZynAddSubFX - a software synthesizer

Effect.cpp - this class is inherited by the all effects(Reverb, Echo, ..)
ZynEffect.cpp - this class is inherited by the all effects(Reverb, Echo, ..)
Copyright (C) 2002-2005 Nasca Octavian Paul
Copyright 2011, Alan Calvert
Author: Nasca Octavian Paul
Expand All @@ -21,11 +21,11 @@

*/

#include "Effect.h"
#include "ZynEffect.h"
#include "../Params/FilterParams.h"
#include <cmath>

Effect::Effect(bool insertion_, float *efxoutl_, float *efxoutr_,
ZynEffect::ZynEffect(bool insertion_, float *efxoutl_, float *efxoutr_,
FilterParams *filterpars_, unsigned char Ppreset_,
unsigned int srate, int bufsize)
:Ppreset(Ppreset_),
Expand All @@ -39,28 +39,28 @@ Effect::Effect(bool insertion_, float *efxoutl_, float *efxoutr_,
alias();
}

void Effect::out(float *const smpsl, float *const smpsr)
void ZynEffect::out(float *const smpsl, float *const smpsr)
{
out(Stereo<float *>(smpsl, smpsr));
}

void Effect::crossover(float &a, float &b, float crossover)
void ZynEffect::crossover(float &a, float &b, float crossover)
{
float tmpa = a;
float tmpb = b;
a = tmpa * (1.0f - crossover) + tmpb * crossover;
b = tmpb * (1.0f - crossover) + tmpa * crossover;
}

void Effect::setpanning(char Ppanning_)
void ZynEffect::setpanning(char Ppanning_)
{
Ppanning = Ppanning_;
float t = (Ppanning > 0) ? (float)(Ppanning - 1) / 126.0f : 0.0f;
pangainL = cosf(t * PI / 2.0f);
pangainR = cosf((1.0f - t) * PI / 2.0f);
}

void Effect::setlrcross(char Plrcross_)
void ZynEffect::setlrcross(char Plrcross_)
{
Plrcross = Plrcross_;
lrcross = (float)Plrcross / 127.0f;
Expand Down
Loading