void Valve::changepar (int npar, int value) { switch (npar) { case 0: setvolume (value); break; case 1: setpanning (value); break; case 2: setlrcross (value); break; case 3: Pdrive = value; dist = (float) Pdrive / 127.0f * 40.0f + .5f; break; case 4: Plevel = value; break; case 5: if (value > 1) value = 1; Pnegate = value; break; case 6: setlpf (value); break; case 7: sethpf (value); break; case 8: if (value > 1) value = 1; Pstereo = value; break; case 9: Pprefiltering = value; break; case 10: Q_q = value; q = (float)Q_q /127.0f - 1.0f; factor = 1.0f - ((float)Q_q / 128.0f); break; case 11: Ped = value; break; case 12: Presence=value; setpresence(value); break; init_coefs(); }; };
void Distorsion::changepar(int npar, unsigned char value) { switch (npar) { case 0: setvolume(value); break; case 1: setpanning(value); break; case 2: setlrcross(value); break; case 3: Pdrive = value; break; case 4: Plevel = value; break; case 5: if (value > 13) Ptype = 13; // this must be increased if more distorsion types are added else Ptype = value; break; case 6: if (value > 1) Pnegate = 1; else Pnegate = value; break; case 7: setlpf(value); break; case 8: sethpf(value); break; case 9: Pstereo = (value > 0) ? 1 : 0; break; case 10: Pprefiltering = value; break; } }
void NewDist::changepar (int npar, int value) { switch (npar) { case 0: setvolume (value); break; case 1: setpanning (value); break; case 2: setlrcross (value); break; case 3: Pdrive = value; break; case 4: Plevel = value; break; case 5: Ptype = value; break; case 6: if (value > 1) value = 1; Pnegate = value; break; case 7: setlpf (value); break; case 8: sethpf (value); break; case 9: Prfreq = value; rfreq = expf (powf ((float)value / 127.0f, 0.5f) * logf (25000.0f)) + 40.0f; filterl->setfreq(rfreq); filterr->setfreq(rfreq); break; case 10: Pprefiltering = value; break; case 11: setoctave (value); break; }; };
void Distorsion::changepar (int npar, int value) { switch (npar) { case 0: setvolume (value); break; case 1: setpanning (value); break; case 2: setlrcross (value); break; case 3: Pdrive = value; break; case 4: Plevel = value; break; case 5: Ptype = value; break; case 6: if (value > 1) value = 1; Pnegate = value; break; case 7: setlpf (value); break; case 8: sethpf (value); break; case 9: if (value > 1) value = 1; Pstereo = value; break; case 10: Pprefiltering = value; break; case 11: break; case 12: setoctave (value); break; }; };
void Exciter::changepar (int npar, int value) { switch (npar) { case 0: setvolume (value); break; case 1: sethar(0,value); break; case 2: sethar(1,value); break; case 3: sethar(2,value); break; case 4: sethar(3,value); break; case 5: sethar(4,value); break; case 6: sethar(5,value); break; case 7: sethar(6,value); break; case 8: sethar(7,value); break; case 9: sethar(8,value); break; case 10: sethar(9,value); break; case 11: setlpf(value); break; case 12: sethpf(value); break; }; };
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 (); };
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 (); };
void Reverb::changepar(int npar, unsigned char value) { switch(npar) { case 0: setvolume(value); break; case 1: setpan(value); break; case 2: settime(value); break; case 3: setidelay(value); break; case 4: setidelayfb(value); break; // case 5: setrdelay(value); // break; // case 6: seterbalance(value); // break; case 7: setlpf(value); break; case 8: sethpf(value); break; case 9: setlohidamp(value); break; case 10: settype(value); break; case 11: setroomsize(value); break; case 12: setbandwidth(value); break; } }
void Expander::Expander_Change (int np, int value) { switch (np) { case 1: Pthreshold = value; tfactor = dB2rap (-((float) Pthreshold)); tlevel = 1.0f/tfactor; break; case 2: Pshape = value; sfactor = dB2rap ((float)Pshape/2); sgain = expf(-sfactor); break; case 3: Pattack = value; a_rate = 1000.0f/((float)Pattack * fs); break; case 4: Pdecay = value; d_rate = 1000.0f/((float)Pdecay * fs); break; case 5: setlpf(value); break; case 6: sethpf(value); break; case 7: Plevel = value; level = dB2rap((float) value/6.0f); break; } }