Phaser::Phaser(bool insertion_, float *efxoutl_, float *efxoutr_) : Effect(insertion_, efxoutl_, efxoutr_, NULL, 0), oldl(NULL), oldr(NULL) { effect_type = phaser; setpreset(Ppreset); cleanup(); }
Echo::Echo(const int & insertion_,REALTYPE *const efxoutl_,REALTYPE *const efxoutr_) : Effect(insertion_,efxoutl_,efxoutr_,NULL,0), Pvolume(50),Ppanning(64),//Pdelay(60), Plrdelay(100),Plrcross(100),Pfb(40),Phidamp(60), lrdelay(0),delaySample(1),old(0.0) { setpreset(Ppreset); cleanup(); }
Alienwah::Alienwah(bool insertion_, float *efxoutl_, float *efxoutr_) :Effect(insertion_, efxoutl_, efxoutr_, NULL, 0), oldl(NULL), oldr(NULL) { setpreset(Ppreset); cleanup(); oldclfol = complex<float>(fb, 0.0f); oldclfor = complex<float>(fb, 0.0f); }
DynamicFilter::DynamicFilter(int insertion_, REALTYPE *efxoutl_, REALTYPE *efxoutr_) :Effect(insertion_, efxoutl_, efxoutr_, new FilterParams(0, 64, 64), 0), Pvolume(110), Ppanning(64), Pdepth(0), Pampsns(90), Pampsnsinv(0), Pampsmooth(60), filterl(NULL), filterr(NULL) { setpreset(Ppreset); cleanup(); }
StereoHarm::StereoHarm (Parameters *param,float *efxoutl_, float *efxoutr_, long int Quality, int DS, int uq, int dq) :Effect(WetDry) { this->param = param; efxoutl = efxoutl_; efxoutr = efxoutr_; param->PERIOD = 96000*2; param->fPERIOD = param->PERIOD; hq = Quality; adjust(DS); templ = (float *) malloc (sizeof (float) * param->PERIOD+100); tempr = (float *) malloc (sizeof (float) * param->PERIOD+100); outil = (float *) malloc (sizeof (float) * nPERIOD+100); outir = (float *) malloc (sizeof (float) * nPERIOD+100); outol = (float *) malloc (sizeof (float) * nPERIOD+100); outor = (float *) malloc (sizeof (float) * nPERIOD+100); memset (outil, 0, sizeof (float) * nPERIOD); memset (outir, 0, sizeof (float) * nPERIOD); memset (outol, 0, sizeof (float) * nPERIOD); memset (outor, 0, sizeof (float) * nPERIOD); U_Resample = new Resample(dq); D_Resample = new Resample(uq); chromel=0.0; chromer=0.0; PSl = new PitchShifter (window, hq, nfSAMPLE_RATE); PSl->ratio = 1.0f; PSr = new PitchShifter (window, hq, nfSAMPLE_RATE); PSr->ratio = 1.0f; param->PERIOD = 44114; param->fPERIOD = param->PERIOD; adjust(DS); Ppreset = 0; PMIDI = 0; mira = 0; setpreset (Ppreset); cleanup (); };
MBDist::MBDist (float * efxoutl_, float * efxoutr_) { efxoutl = efxoutl_; efxoutr = efxoutr_; lowl = (float *) malloc (sizeof (float) * PERIOD); lowr = (float *) malloc (sizeof (float) * PERIOD); midl = (float *) malloc (sizeof (float) * PERIOD); midr = (float *) malloc (sizeof (float) * PERIOD); highl = (float *) malloc (sizeof (float) * PERIOD); highr = (float *) malloc (sizeof (float) * PERIOD); lpf1l = new AnalogFilter (2, 500.0f, .7071f, 0); lpf1r = new AnalogFilter (2, 500.0f, .7071f, 0); hpf1l = new AnalogFilter (3, 500.0f, .7071f, 0); hpf1r = new AnalogFilter (3, 500.0f, .7071f, 0); lpf2l = new AnalogFilter (2, 2500.0f, .7071f, 0); lpf2r = new AnalogFilter (2, 2500.0f, .7071f, 0); hpf2l = new AnalogFilter (3, 2500.0f, .7071f, 0); hpf2r = new AnalogFilter (3, 2500.0f, .7071f, 0); DCl = new AnalogFilter (3, 30, 1, 0); DCr = new AnalogFilter (3, 30, 1, 0); DCl->setfreq (30.0f); DCr->setfreq (30.0f); mbwshape1l = new Waveshaper(); mbwshape2l = new Waveshaper(); mbwshape3l = new Waveshaper(); mbwshape1r = new Waveshaper(); mbwshape2r = new Waveshaper(); mbwshape3r = new Waveshaper(); //default values Ppreset = 0; Pvolume = 50; Plrcross = 40; Pdrive = 90; Plevel = 64; PtypeL = 0; PtypeM = 0; PtypeH = 0; PvolL = 0; PvolM = 0; PvolH = 0; Pnegate = 0; Pstereo = 0; setpreset (Ppreset); cleanup (); };
Phaser::Phaser(int insertion_,REALTYPE *efxoutl_,REALTYPE *efxoutr_){ efxoutl=efxoutl_; efxoutr=efxoutr_; filterpars=NULL; oldl=NULL; oldr=NULL; insertion=insertion_; Ppreset=0; setpreset(Ppreset); cleanup(); };
Dflange::Dflange (float * efxoutl_, float * efxoutr_) { efxoutl = efxoutl_; efxoutr = efxoutr_; period_const = 1.0f/fPERIOD; //default values Ppreset = 0; ldelay = NULL; rdelay = NULL; maxx_delay = (int) SAMPLE_RATE * 0.055f; ldelay = new float[maxx_delay]; rdelay = new float[maxx_delay]; zldelay = new float[maxx_delay]; zrdelay = new float[maxx_delay]; ldelayline0 = new delayline(0.055f, 2); rdelayline0 = new delayline(0.055f, 2); ldelayline1 = new delayline(0.055f, 2); rdelayline1 = new delayline(0.055f, 2); ldelayline0 -> set_averaging(0.05f); rdelayline0 -> set_averaging(0.05f); ldelayline0->set_mix( 0.5f ); rdelayline0->set_mix( 0.5f ); ldelayline1 -> set_averaging(0.05f); rdelayline1 -> set_averaging(0.05f); ldelayline1->set_mix( 0.5f ); rdelayline1->set_mix( 0.5f ); fsubtract = 0.5f; fhidamp = 1.0f; fwidth = 800; fdepth = 50; zcenter = (int) fSAMPLE_RATE/floorf(0.5f * (fdepth + fwidth)); base = 7.0f; //sets curve of modulation to frequency relationship ibase = 1.0f/base; //default values Ppreset = 0; Pintense = 0; rsA = 0.0f; rsB = 0.0f; lsA = 0.0f; lsB = 0.0f; logmax = logf(1000.0f)/logf(2.0f); setpreset (Ppreset); cleanup (); };
Alienwah::Alienwah (float * efxoutl_, float * efxoutr_) { efxoutl = efxoutl_; efxoutr = efxoutr_; Ppreset = 0; setpreset (Ppreset); cleanup (); oldclfol.a = fb; oldclfol.b = 0.0; oldclfor.a = fb; oldclfor.b = 0.0; };
CompBand::CompBand (Parameters *param, float * efxoutl_, float * efxoutr_) :Effect(WetDry) { this->param = param; efxoutl = efxoutl_; efxoutr = efxoutr_; param->PERIOD = 44102; lowl = (float *) malloc (sizeof (float) * param->PERIOD+100); lowr = (float *) malloc (sizeof (float) * param->PERIOD+100); midll = (float *) malloc (sizeof (float) * param->PERIOD+100); midlr = (float *) malloc (sizeof (float) * param->PERIOD+100); midhl = (float *) malloc (sizeof (float) * param->PERIOD+100); midhr = (float *) malloc (sizeof (float) * param->PERIOD+100); highl = (float *) malloc (sizeof (float) * param->PERIOD+100); highr = (float *) malloc (sizeof (float) * param->PERIOD+100); lpf1l = new AnalogFilter (param,2, 500.0f,.7071f, 0); lpf1r = new AnalogFilter (param,2, 500.0f,.7071f, 0); hpf1l = new AnalogFilter (param,3, 500.0f,.7071f, 0); hpf1r = new AnalogFilter (param,3, 500.0f,.7071f, 0); lpf2l = new AnalogFilter (param,2, 2500.0f,.7071f, 0); lpf2r = new AnalogFilter (param,2, 2500.0f,.7071f, 0); hpf2l = new AnalogFilter (param,3, 2500.0f,.7071f, 0); hpf2r = new AnalogFilter (param,3, 2500.0f,.7071f, 0); lpf3l = new AnalogFilter (param,2, 5000.0f,.7071f, 0); lpf3r = new AnalogFilter (param,2, 5000.0f,.7071f, 0); hpf3l = new AnalogFilter (param,3, 5000.0f,.7071f, 0); hpf3r = new AnalogFilter (param,3, 5000.0f,.7071f, 0); CL = new Compressor(param,efxoutl,efxoutr); CML = new Compressor(param,efxoutl,efxoutr); CMH = new Compressor(param,efxoutl,efxoutr); CH = new Compressor(param,efxoutl,efxoutr); CL->Compressor_Change_Preset(0,5); CML->Compressor_Change_Preset(0,5); CMH->Compressor_Change_Preset(0,5); CH->Compressor_Change_Preset(0,5); //default values Ppreset = 0; Pvolume = 50; setpreset (Ppreset); cleanup (); };
Phaser::Phaser(bool insertion_, float *efxoutl_, float *efxoutr_, SynthEngine *_synth) : Effect(insertion_, efxoutl_, efxoutr_, NULL, 0), lfo(_synth), oldl(NULL), oldr(NULL), xn1l(NULL), xn1r(NULL), yn1l(NULL), yn1r(NULL), synth(_synth) { analog_setup(); setpreset(Ppreset); cleanup(); }
DynamicFilter::DynamicFilter(EffectParams pars, const AbsTime *time) :Effect(pars), lfo(pars.srate, pars.bufsize), Pvolume(110), Pdepth(0), Pampsns(90), Pampsnsinv(0), Pampsmooth(60), filterl(NULL), filterr(NULL) { filterpars = memory.alloc<FilterParams>(0,0,0,time); setpreset(Ppreset); cleanup(); }
Echo::Echo(const int &insertion_, REALTYPE *const efxoutl_, REALTYPE *const efxoutr_) :Effect(insertion_, efxoutl_, efxoutr_, NULL, 0), samplerate(SAMPLE_RATE), Pvolume(50), Ppanning(64), Pdelay(60), Plrdelay(100), Plrcross(100), Pfb(40), Phidamp(60), delayTime(1), lrdelay(0), avgDelay(0), delay(new REALTYPE[(int)(MAX_DELAY * samplerate)], new REALTYPE[(int)(MAX_DELAY * samplerate)]), old(0.0), pos(0), delta(1), ndelta(1) { initdelays(); setpreset(Ppreset); }
DynamicFilter::DynamicFilter (float * efxoutl_, float * efxoutr_, double sample_rate, uint32_t ibufsz) { efxoutl = efxoutl_; efxoutr = efxoutr_; lfo = new EffectLFO(sample_rate); Ppreset = 0; filterl = NULL; filterr = NULL; filterpars = new FilterParams (0, 64, 64, sample_rate, ibufsz); PERIOD = 256;//best guess of period size setpreset (Ppreset); cleanup (); };
CompBand::CompBand (float * efxoutl_, float * efxoutr_, double sample_rate, uint32_t intermediate_bufsize) { efxoutl = efxoutl_; efxoutr = efxoutr_; lowl = (float *) malloc (sizeof (float) * intermediate_bufsize); lowr = (float *) malloc (sizeof (float) * intermediate_bufsize); midll = (float *) malloc (sizeof (float) * intermediate_bufsize); midlr = (float *) malloc (sizeof (float) * intermediate_bufsize); midhl = (float *) malloc (sizeof (float) * intermediate_bufsize); midhr = (float *) malloc (sizeof (float) * intermediate_bufsize); highl = (float *) malloc (sizeof (float) * intermediate_bufsize); highr = (float *) malloc (sizeof (float) * intermediate_bufsize); interpbuf = new float[intermediate_bufsize]; lpf1l = new AnalogFilter (2, 500.0f,.7071f, 0, sample_rate, interpbuf); lpf1r = new AnalogFilter (2, 500.0f,.7071f, 0, sample_rate, interpbuf); hpf1l = new AnalogFilter (3, 500.0f,.7071f, 0, sample_rate, interpbuf); hpf1r = new AnalogFilter (3, 500.0f,.7071f, 0, sample_rate, interpbuf); lpf2l = new AnalogFilter (2, 2500.0f,.7071f, 0, sample_rate, interpbuf); lpf2r = new AnalogFilter (2, 2500.0f,.7071f, 0, sample_rate, interpbuf); hpf2l = new AnalogFilter (3, 2500.0f,.7071f, 0, sample_rate, interpbuf); hpf2r = new AnalogFilter (3, 2500.0f,.7071f, 0, sample_rate, interpbuf); lpf3l = new AnalogFilter (2, 5000.0f,.7071f, 0, sample_rate, interpbuf); lpf3r = new AnalogFilter (2, 5000.0f,.7071f, 0, sample_rate, interpbuf); hpf3l = new AnalogFilter (3, 5000.0f,.7071f, 0, sample_rate, interpbuf); hpf3r = new AnalogFilter (3, 5000.0f,.7071f, 0, sample_rate, interpbuf); CL = new Compressor(efxoutl,efxoutr, sample_rate); CML = new Compressor(efxoutl,efxoutr, sample_rate); CMH = new Compressor(efxoutl,efxoutr, sample_rate); CH = new Compressor(efxoutl,efxoutr, sample_rate); CL->Compressor_Change_Preset(0,5); CML->Compressor_Change_Preset(0,5); CMH->Compressor_Change_Preset(0,5); CH->Compressor_Change_Preset(0,5); //default values Ppreset = 0; Pvolume = 50; setpreset (Ppreset); cleanup (); };
DynamicFilter::DynamicFilter(bool insertion_, float *efxoutl_, float *efxoutr_, SynthEngine *_synth) : Effect(insertion_, efxoutl_, efxoutr_, new FilterParams(0, 64, 64, 0, _synth), 0), lfo(_synth), Pdepth(0), Pampsns(90), Pampsnsinv(0), Pampsmooth(60), filterl(NULL), filterr(NULL), synth(_synth) { setvolume(110); setpreset(Ppreset); changepar(1, 64); // pan cleanup(); }
Distorsion::Distorsion (float * efxoutl_, float * efxoutr_) { efxoutl = efxoutl_; efxoutr = efxoutr_; octoutl = (float *) malloc (sizeof (float) * PERIOD); octoutr = (float *) malloc (sizeof (float) * PERIOD); lpfl = new AnalogFilter (2, 22000, 1, 0); lpfr = new AnalogFilter (2, 22000, 1, 0); hpfl = new AnalogFilter (3, 20, 1, 0); hpfr = new AnalogFilter (3, 20, 1, 0); blockDCl = new AnalogFilter (2, 440.0f, 1, 0); blockDCr = new AnalogFilter (2, 440.0f, 1, 0); blockDCl->setfreq (75.0f); blockDCr->setfreq (75.0f); DCl = new AnalogFilter (3, 30, 1, 0); DCr = new AnalogFilter (3, 30, 1, 0); DCl->setfreq (30.0f); DCr->setfreq (30.0f); dwshapel = new Waveshaper(); dwshaper = new Waveshaper(); //default values Ppreset = 0; Pvolume = 50; Plrcross = 40; Pdrive = 90; Plevel = 64; Ptype = 0; Pnegate = 0; Plpf = 127; Phpf = 0; Pstereo = 0; Pprefiltering = 0; Poctave = 0; togglel = 1.0; octave_memoryl = -1.0; toggler = 1.0; octave_memoryr = -1.0; octmix = 0.0; setpreset (1,Ppreset); cleanup (); };
Reverb::Reverb(const int &insertion_, REALTYPE *efxoutl_, REALTYPE *efxoutr_) :Effect(insertion_, efxoutl_, efxoutr_, NULL, 0) { inputbuf = new REALTYPE[SOUND_BUFFER_SIZE]; bandwidth = NULL; //defaults Pvolume = 48; Ppan = 64; Ptime = 64; Pidelay = 40; Pidelayfb = 0; Prdelay = 0; Plpf = 127; Phpf = 0; Perbalance = 64; Plohidamp = 80; Ptype = 1; Proomsize = 64; Pbandwidth = 30; roomsize = 1.0; rs = 1.0; for(int i = 0; i < REV_COMBS * 2; i++) { comblen[i] = 800 + (int)(RND * 1400); combk[i] = 0; lpcomb[i] = 0; combfb[i] = -0.97; comb[i] = NULL; } for(int i = 0; i < REV_APS * 2; i++) { aplen[i] = 500 + (int)(RND * 500); apk[i] = 0; ap[i] = NULL; } lpf = NULL; hpf = NULL; //no filter idelay = NULL; setpreset(Ppreset); cleanup(); //do not call this before the comb initialisation }
Valve::Valve (Parameters *param,float * efxoutl_, float * efxoutr_) :Effect(WetDry) { this->param = param; efxoutl = efxoutl_; efxoutr = efxoutr_; lpfl = new AnalogFilter (param,2, 22000.0f, 1.0f, 0); lpfr = new AnalogFilter (param,2, 22000.0f, 1.0f, 0); hpfl = new AnalogFilter (param,3, 20.0f, 1.0f, 0); hpfr = new AnalogFilter (param,3, 20.0f, 1.0f, 0); harm = new HarmEnhancer (param,rm, 20.0f,20000.0f,1.0f); //default values Ppreset = 0; Pvolume = 50; Plrcross = 40; Pdrive = 90; Plevel = 64; Pnegate = 0; Plpf = 127; Phpf = 0; Q_q = 64; Ped = 0; Pstereo = 0; Pprefiltering = 0; q = 0.0f; dist = 0.0f; setlpf(127); sethpf(1); atk = 1.0f - 40.0f/fSAMPLE_RATE; for(int i=0; i<10; i++) rm[i]=0.0; rm[0]=1.0f; rm[2]= -1.0f; rm[4]=1.0f; rm[6]=-1.0f; rm[8]=1.0f; harm->calcula_mag(rm); setpreset (Ppreset); init_coefs(); cleanup (); };
Pan::Pan (float *efxoutl_, float *efxoutr_, double sample_rate) { efxoutl = efxoutl_; efxoutr = efxoutr_; lfo = new EffectLFO(sample_rate); Ppreset = 0; PERIOD = 256; //make our best guess for the initializing setpreset (Ppreset); lfo->effectlfoout (&lfol, &lfor); cleanup (); };
Chorus::Chorus (float * efxoutl_, float * efxoutr_) { efxoutl = efxoutl_; efxoutr = efxoutr_; dlk = 0; drk = 0; maxdelay = lrintf (MAX_CHORUS_DELAY / 1000.0 * SAMPLE_RATE); delayl = new float[maxdelay]; delayr = new float[maxdelay]; Ppreset = 0; setpreset (0,Ppreset); lfo.effectlfoout (&lfol, &lfor); dl2 = getdelay (lfol); dr2 = getdelay (lfor); cleanup (); };
EQ::EQ(EffectParams pars) :Effect(pars) { for(int i = 0; i < MAX_EQ_BANDS; ++i) { filter[i].Ptype = 0; filter[i].Pfreq = 64; filter[i].Pgain = 64; filter[i].Pq = 64; filter[i].Pstages = 0; filter[i].l = memory.alloc<AnalogFilter>(6, 1000.0f, 1.0f, 0, pars.srate, pars.bufsize); filter[i].r = memory.alloc<AnalogFilter>(6, 1000.0f, 1.0f, 0, pars.srate, pars.bufsize); } //default values Pvolume = 50; setpreset(Ppreset); cleanup(); }
Sequence::Sequence (float * efxoutl_, float * efxoutr_, long int Quality, int DS, int uq, int dq) { efxoutl = efxoutl_; efxoutr = efxoutr_; hq = Quality; adjust(DS); templ = (float *) malloc (sizeof (float) * PERIOD); tempr = (float *) malloc (sizeof (float) * PERIOD); outi = (float *) malloc (sizeof (float) * nPERIOD); outo = (float *) malloc (sizeof (float) * nPERIOD); U_Resample = new Resample(dq); D_Resample = new Resample(uq); filterl = NULL; filterr = NULL; MAXFREQ = 10000.0f; MINFREQ = 100.0f; fq = 75.0f; Ppreset = 0; scount = 0; tcount = 0; rndflag = 0; subdiv = 2; filterl = new RBFilter (0, 80.0f, 40.0f, 2); filterr = new RBFilter (0, 80.0f, 40.0f, 2); modfilterl = new RBFilter (0, 25.0f, 0.15f, 2); modfilterr = new RBFilter (0, 25.0f, 0.15f, 2); setpreset (Ppreset); filterl->setmix(1, 0.33f, -1.0f, 0.25f); filterr->setmix(1, 0.33f, -1.0f, 0.25f); PS = new PitchShifter (window, hq, nfSAMPLE_RATE); PS->ratio = 1.0f; cleanup (); };
Valve::Valve (float * efxoutl_, float * efxoutr_, double sample_rate, uint32_t intermediate_bufsize) { efxoutl = efxoutl_; efxoutr = efxoutr_; interpbuf = new float[intermediate_bufsize]; lpfl = new AnalogFilter (2, 22000.0f, 1.0f, 0, sample_rate, interpbuf); lpfr = new AnalogFilter (2, 22000.0f, 1.0f, 0, sample_rate, interpbuf); hpfl = new AnalogFilter (3, 20.0f, 1.0f, 0, sample_rate, interpbuf); hpfr = new AnalogFilter (3, 20.0f, 1.0f, 0, sample_rate, interpbuf); harm = new HarmEnhancer (rm, 20.0f,20000.0f,1.0f, sample_rate, intermediate_bufsize); //default values Ppreset = 0; Pvolume = 50; Plrcross = 40; Pdrive = 90; Plevel = 64; Pnegate = 0; Plpf = 127; Phpf = 0; Q_q = 64; Ped = 0; Pstereo = 0; Pprefiltering = 0; q = 0.0f; dist = 0.0f; setlpf(127); sethpf(1); atk = 1.0f - 40.0f/sample_rate; for(int i=0; i<10; i++) rm[i]=0.0; rm[0]=1.0f; rm[2]= -1.0f; rm[4]=1.0f; rm[6]=-1.0f; rm[8]=1.0f; harm->calcula_mag(rm); setpreset (Ppreset); init_coefs(); cleanup (); };
StompBox::StompBox (float * efxoutl_, float * efxoutr_, double sample_rate, uint32_t intermediate_bufsize, int wave_res, int wave_upq, int wave_dnq) { efxoutl = efxoutl_; efxoutr = efxoutr_; //default values Ppreset = 0; Pvolume = 50; //left channel filters interpbuf = new float[intermediate_bufsize]; linput = new AnalogFilter (1, 80.0f, 1.0f, 0, sample_rate, interpbuf); // AnalogFilter (unsigned char Ftype, float Ffreq, float Fq,unsigned char Fstages); lpre1 = new AnalogFilter (1, 630.0f, 1.0f, 0, sample_rate, interpbuf); // LPF = 0, HPF = 1 lpre2 = new AnalogFilter (1, 220.0f, 1.0f, 0, sample_rate, interpbuf); lpost = new AnalogFilter (0, 720.0f, 1.0f, 0, sample_rate, interpbuf); ltonehg = new AnalogFilter (1, 1500.0f, 1.0f, 0, sample_rate, interpbuf); ltonemd = new AnalogFilter (4, 1000.0f, 1.0f, 0, sample_rate, interpbuf); ltonelw = new AnalogFilter (0, 500.0f, 1.0, 0, sample_rate, interpbuf); //Right channel filters rinput = new AnalogFilter (1, 80.0f, 1.0f, 0, sample_rate, interpbuf); // AnalogFilter (unsigned char Ftype, float Ffreq, float Fq,unsigned char Fstages); rpre1 = new AnalogFilter (1, 630.0f, 1.0f, 0, sample_rate, interpbuf); // , sample_rateLPF = 0, HPF = 1 rpre2 = new AnalogFilter (1, 220.0f, 1.0f, 0, sample_rate, interpbuf); rpost = new AnalogFilter (0, 720.0f, 1.0f, 0, sample_rate, interpbuf); rtonehg = new AnalogFilter (1, 1500.0f, 1.0f, 0, sample_rate, interpbuf); rtonemd = new AnalogFilter (4, 1000.0f, 1.0f, 0, sample_rate, interpbuf); rtonelw = new AnalogFilter (0, 500.0f, 1.0f, 0, sample_rate, interpbuf); //Anti-aliasing for between stages ranti = new AnalogFilter (0, 6000.0f, 0.707f, 1, sample_rate, interpbuf); lanti = new AnalogFilter (0, 6000.0f, 0.707f, 1, sample_rate, interpbuf); rwshape = new Waveshaper(sample_rate,wave_res,wave_upq,wave_dnq,intermediate_bufsize); lwshape = new Waveshaper(sample_rate,wave_res,wave_upq,wave_dnq,intermediate_bufsize); rwshape2 = new Waveshaper(sample_rate,wave_res,wave_upq,wave_dnq,intermediate_bufsize); lwshape2 = new Waveshaper(sample_rate,wave_res,wave_upq,wave_dnq,intermediate_bufsize); cleanup (); setpreset (Ppreset); };
Distorsion::Distorsion(EffectParams pars) :Effect(pars), Pvolume(50), Pdrive(90), Plevel(64), Ptype(0), Pnegate(0), Plpf(127), Phpf(0), Pstereo(0), Pprefiltering(0) { lpfl = memory.alloc<AnalogFilter>(2, 22000, 1, 0, pars.srate, pars.bufsize); lpfr = memory.alloc<AnalogFilter>(2, 22000, 1, 0, pars.srate, pars.bufsize); hpfl = memory.alloc<AnalogFilter>(3, 20, 1, 0, pars.srate, pars.bufsize); hpfr = memory.alloc<AnalogFilter>(3, 20, 1, 0, pars.srate, pars.bufsize); setpreset(Ppreset); cleanup(); }
EQ::EQ(bool insertion_, float *efxoutl_, float *efxoutr_, SynthEngine *_synth) : Effect(insertion_, efxoutl_, efxoutr_, NULL, 0), synth(_synth) { for (int i = 0; i < MAX_EQ_BANDS; ++i) { filter[i].Ptype = 0; filter[i].Pfreq = 64; filter[i].Pgain = 64; filter[i].Pq = 64; filter[i].Pstages = 0; filter[i].l = new AnalogFilter(6, 1000.0, 1.0, 0, synth); filter[i].r = new AnalogFilter(6, 1000.0, 1.0, 0, synth); } // default values Pvolume = 50; setpreset(Ppreset); cleanup(); }
Analog_Phaser::Analog_Phaser (float * efxoutl_, float * efxoutr_) { efxoutl = efxoutl_; efxoutr = efxoutr_; lxn1 = (float *) malloc(sizeof(float)* MAX_PHASER_STAGES); lyn1 = (float *) malloc(sizeof(float)* MAX_PHASER_STAGES); rxn1 = (float *) malloc(sizeof(float)* MAX_PHASER_STAGES); ryn1 = (float *) malloc(sizeof(float)* MAX_PHASER_STAGES); offset = (float *) malloc(sizeof(float)* MAX_PHASER_STAGES); //model mismatch between JFET devices offset[0] = -0.2509303f; offset[1] = 0.9408924f; offset[2] = 0.998f; offset[3] = -0.3486182f; offset[4] = -0.2762545f; offset[5] = -0.5215785f; offset[6] = 0.2509303f; offset[7] = -0.9408924f; offset[8] = -0.998f; offset[9] = 0.3486182f; offset[10] = 0.2762545f; offset[11] = 0.5215785f; barber = 0; //Deactivate barber pole phasing by default mis = 1.0f; Rmin = 625.0f; // 2N5457 typical on resistance at Vgs = 0 Rmax = 22000.0f; // Resistor parallel to FET Rmx = Rmin/Rmax; Rconst = 1.0f + Rmx; // Handle parallel resistor relationship C = 0.00000005f; // 50 nF CFs = 2.0f*fSAMPLE_RATE*C; invperiod = 1.0f / fPERIOD; Ppreset = 0; setpreset (Ppreset); cleanup (); };
Distorsion::Distorsion(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize) :Effect(insertion_, efxoutl_, efxoutr_, NULL, 0, srate, bufsize), Pvolume(50), Pdrive(90), Plevel(64), Ptype(0), Pnegate(0), Plpf(127), Phpf(0), Pstereo(0), Pprefiltering(0) { lpfl = new AnalogFilter(2, 22000, 1, 0, srate, bufsize); lpfr = new AnalogFilter(2, 22000, 1, 0, srate, bufsize); hpfl = new AnalogFilter(3, 20, 1, 0, srate, bufsize); hpfr = new AnalogFilter(3, 20, 1, 0, srate, bufsize); setpreset(Ppreset); cleanup(); }
ShelfBoost::ShelfBoost (float * efxoutl_, float * efxoutr_) { efxoutl = efxoutl_; efxoutr = efxoutr_; //default values Ppreset = 0; Pvolume = 50; Pstereo = 0; RB1l = new AnalogFilter(7,3200.0f,0.5f,0); RB1r = new AnalogFilter(7,3200.0f,0.5f,0); cleanup (); setpreset (Ppreset); };