just hit svf with astyle
parent
9455834b2a
commit
e1e4089b88
9
notes
9
notes
|
@ -32,16 +32,13 @@ parameters {
|
|||
|
||||
TODO {
|
||||
immediate frontburner {
|
||||
- support rendering to FLAC
|
||||
- figure out why it defaults to mp3 regardless of type selection?? (it's because qt does a default suffix)
|
||||
|
||||
- add rendering floater
|
||||
examine commandreader (nextsub w/ default for ,XX?)
|
||||
wet-only output for delay (be smart about it)
|
||||
check on filter
|
||||
|
||||
revert action
|
||||
|
||||
distortion effect
|
||||
|
||||
- add ,XX support to global tempo
|
||||
}
|
||||
|
||||
qt update causing some patchboard artifacting on mouse movement
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Description: State Variable Filter
|
||||
*
|
||||
*
|
||||
* Version:
|
||||
* Version:
|
||||
* Created: Fri Nov 1 23:36:50 2019
|
||||
* Revision: None
|
||||
* Author: Rachel Fae Fox (foxiepaws),fox@foxiepa.ws
|
||||
|
@ -74,7 +74,7 @@ void SVF::release() {
|
|||
}
|
||||
|
||||
void SVF::process() {
|
||||
|
||||
|
||||
|
||||
|
||||
auto in = std::static_pointer_cast<AudioPort>(port(Port::Input, Port::Audio, 0));
|
||||
|
@ -87,73 +87,73 @@ void SVF::process() {
|
|||
for (size_t f = 0; f < ts; f++) {
|
||||
AudioFrame fCurrent = (*in)[f];
|
||||
AudioFrame fOut;
|
||||
if (this->fm == _off) {
|
||||
(*out)[f] = fCurrent;
|
||||
continue;
|
||||
}
|
||||
|
||||
double res = this->resonance;
|
||||
//double damp = MIN(2.0*(1.0 - pow(res, 0.25)), MIN(2.0, 2.0/freq - freq*0.5));
|
||||
double q = sqrt(1.0 - atan(sqrt(res)) * 2.0 / PI);
|
||||
double damp = sqrt(q);
|
||||
if (this->fm == _off) {
|
||||
(*out)[f] = fCurrent;
|
||||
continue;
|
||||
}
|
||||
|
||||
//double freq = 2.0*sin(M_PI * MIN(0.25, this->frequency/audioEngine->curSampleRate()));
|
||||
double freq = this->frequency / (audioEngine->curSampleRate() * 2 );
|
||||
double in_l, in_r;
|
||||
double low_l, low_r;
|
||||
double band_l, band_r;
|
||||
double high_l, high_r;
|
||||
double notch_l, notch_r;
|
||||
double res = this->resonance;
|
||||
//double damp = MIN(2.0*(1.0 - pow(res, 0.25)), MIN(2.0, 2.0/freq - freq*0.5));
|
||||
double q = sqrt(1.0 - atan(sqrt(res)) * 2.0 / PI);
|
||||
double damp = sqrt(q);
|
||||
|
||||
in_l = fCurrent.l;
|
||||
in_r = fCurrent.r;
|
||||
low_l=low.l;
|
||||
low_r=low.r;
|
||||
band_l=band.l;
|
||||
band_r=band.r;
|
||||
high_l=high.l;
|
||||
high_r=high.r;
|
||||
notch_l=notch.l;
|
||||
notch_r=notch.r;
|
||||
//double freq = 2.0*sin(M_PI * MIN(0.25, this->frequency/audioEngine->curSampleRate()));
|
||||
double freq = this->frequency / (audioEngine->curSampleRate() * 2 );
|
||||
double in_l, in_r;
|
||||
double low_l, low_r;
|
||||
double band_l, band_r;
|
||||
double high_l, high_r;
|
||||
double notch_l, notch_r;
|
||||
|
||||
in_l = fCurrent.l;
|
||||
in_r = fCurrent.r;
|
||||
low_l=low.l;
|
||||
low_r=low.r;
|
||||
band_l=band.l;
|
||||
band_r=band.r;
|
||||
high_l=high.l;
|
||||
high_r=high.r;
|
||||
notch_l=notch.l;
|
||||
notch_r=notch.r;
|
||||
|
||||
|
||||
low_l = low_l + freq * band_l;
|
||||
high_l = damp * in_l - low_l - q * band_l;
|
||||
band_l = freq * high_l + band_l;
|
||||
notch_l = high_l + low_l;
|
||||
low_r = low_r + freq * band_r;
|
||||
high_r = damp * in_r - low_r - q * band_r;
|
||||
band_r = freq * high_r + band_r;
|
||||
notch_r = high_r + low_r;
|
||||
low_l = low_l + freq * band_l;
|
||||
high_l = damp * in_l - low_l - q * band_l;
|
||||
band_l = freq * high_l + band_l;
|
||||
notch_l = high_l + low_l;
|
||||
low_r = low_r + freq * band_r;
|
||||
high_r = damp * in_r - low_r - q * band_r;
|
||||
band_r = freq * high_r + band_r;
|
||||
notch_r = high_r + low_r;
|
||||
low_l = low_l + freq * band_l;
|
||||
high_l = damp * in_l - low_l - q * band_l;
|
||||
band_l = freq * high_l + band_l;
|
||||
notch_l = high_l + low_l;
|
||||
low_r = low_r + freq * band_r;
|
||||
high_r = damp * in_r - low_r - q * band_r;
|
||||
band_r = freq * high_r + band_r;
|
||||
notch_r = high_r + low_r;
|
||||
low_l = low_l + freq * band_l;
|
||||
high_l = damp * in_l - low_l - q * band_l;
|
||||
band_l = freq * high_l + band_l;
|
||||
notch_l = high_l + low_l;
|
||||
low_r = low_r + freq * band_r;
|
||||
high_r = damp * in_r - low_r - q * band_r;
|
||||
band_r = freq * high_r + band_r;
|
||||
notch_r = high_r + low_r;
|
||||
|
||||
low = {low_l, low_r};
|
||||
band = {band_l, band_r};
|
||||
high = {high_l, high_r};
|
||||
notch = {notch_l, notch_r};
|
||||
low = {low_l, low_r};
|
||||
band = {band_l, band_r};
|
||||
high = {high_l, high_r};
|
||||
notch = {notch_l, notch_r};
|
||||
|
||||
|
||||
switch (fm) {
|
||||
case _low:
|
||||
(*out)[f] = this->low;
|
||||
break;
|
||||
case _band:
|
||||
(*out)[f] = this->band;
|
||||
break;
|
||||
case _high:
|
||||
(*out)[f] = this->high;
|
||||
break;
|
||||
case _notch:
|
||||
(*out)[f] = this->notch;
|
||||
break;
|
||||
}
|
||||
switch (fm) {
|
||||
case _low:
|
||||
(*out)[f] = this->low;
|
||||
break;
|
||||
case _band:
|
||||
(*out)[f] = this->band;
|
||||
break;
|
||||
case _high:
|
||||
(*out)[f] = this->high;
|
||||
break;
|
||||
case _notch:
|
||||
(*out)[f] = this->notch;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Description:
|
||||
*
|
||||
*
|
||||
* Version:
|
||||
* Version:
|
||||
* Created: Fri Nov 1 23:34:34 2019
|
||||
* Revision: None
|
||||
* Author: Rachel Fae Fox (foxiepaws),fox@foxiepa.ws
|
||||
|
@ -25,16 +25,16 @@ namespace Xybrid::Effects {
|
|||
double frequency= 0.5;
|
||||
double resonance = 0.0;
|
||||
|
||||
Xybrid::Data::AudioFrame low = 0.0;
|
||||
Xybrid::Data::AudioFrame band = 0.0;
|
||||
Xybrid::Data::AudioFrame high = 0.0;
|
||||
Xybrid::Data::AudioFrame notch = 0.0;
|
||||
FilterMode fm = _off;
|
||||
Xybrid::Data::AudioFrame low = 0.0;
|
||||
Xybrid::Data::AudioFrame band = 0.0;
|
||||
Xybrid::Data::AudioFrame high = 0.0;
|
||||
Xybrid::Data::AudioFrame notch = 0.0;
|
||||
FilterMode fm = _off;
|
||||
|
||||
// solve these in cons.
|
||||
double max_freq;
|
||||
double freq;
|
||||
double q;
|
||||
// solve these in cons.
|
||||
double max_freq;
|
||||
double freq;
|
||||
double q;
|
||||
|
||||
public:
|
||||
SVF();
|
||||
|
|
Loading…
Reference in New Issue