From 26c27c75130e37b099ec6ca7bae3d107e5232efe Mon Sep 17 00:00:00 2001 From: GithubActions BaconPaul Bot Date: Sun, 22 Oct 2023 00:05:21 +0000 Subject: [PATCH] Update to Latest Airwin --- libs/airwindows | 2 +- res/awpdoc/YNotBandpass.txt | 7 ++ res/awpdoc/YNotHighpass.txt | 2 +- src/ModuleAdd.h | 22 ++-- src/autogen_airwin/ConsoleMCBuss.cpp | 2 +- src/autogen_airwin/ConsoleMCBuss.h | 58 +---------- src/autogen_airwin/ConsoleMCBussProc.cpp | 122 ++++++++--------------- 7 files changed, 64 insertions(+), 151 deletions(-) create mode 100644 res/awpdoc/YNotBandpass.txt diff --git a/libs/airwindows b/libs/airwindows index c6a220e..08ade46 160000 --- a/libs/airwindows +++ b/libs/airwindows @@ -1 +1 @@ -Subproject commit c6a220ed39279a1c4b43c1de6f876769dda58192 +Subproject commit 08ade46aad71815ee0dfcd95ff54fcfcc5836f3a diff --git a/res/awpdoc/YNotBandpass.txt b/res/awpdoc/YNotBandpass.txt new file mode 100644 index 0000000..fd48ce8 --- /dev/null +++ b/res/awpdoc/YNotBandpass.txt @@ -0,0 +1,7 @@ +# YNotBandpass is soft and smooth to nasty, edgy texture-varying filtering, no control smoothing. + +YNotBandpass has various uses. One I was trying out in the original video, was setting it up as a ‘walkie-talkie’ sort of tone on my voice, and then turning up ResEdge to really trash the hell out of the audio in a characteristic way that’s not easily found anywhere else. + +In the video for YNotBandpass, the version without control smoothing, I demoed it on a bunch of huge reverb, alternating between a Bricasti Cathedral and my version of that same sound… and the more rapid switching between Freq settings turns out to sound pretty nice! Except when the ResEdge control is used to give a mean, electrical, circuit-bendy quality that still retains a lot of the depth of the underlying sound. + + diff --git a/res/awpdoc/YNotHighpass.txt b/res/awpdoc/YNotHighpass.txt index caa802e..101785f 100644 --- a/res/awpdoc/YNotHighpass.txt +++ b/res/awpdoc/YNotHighpass.txt @@ -1,4 +1,4 @@ -# YNotHighpass is soft and smooth to nasty, edgy texture-varying filtering. +# YNotHighpass is soft and smooth to nasty, edgy texture-varying filtering, no control smoothing. See YNotLowpass, except it’s a highpass :) interestingly, the original YHighpass saw some significant improvements in CPU usage. Turns out that going to YNot mode, with no control smoothing, boosts performance even more. diff --git a/src/ModuleAdd.h b/src/ModuleAdd.h index c7218e0..5c75fa5 100644 --- a/src/ModuleAdd.h +++ b/src/ModuleAdd.h @@ -677,31 +677,31 @@ int Weight_unused = AirwinRegistry::registerAirwindow({"Weight", "Filter", 202, #include "autogen_airwin/Wider.h" int Wider_unused = AirwinRegistry::registerAirwindow({"Wider", "Stereo", 277, "Wider is Airwindows stereo space shaping.", airwin2rack::Wider::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/XBandpass.h" -int XBandpass_unused = AirwinRegistry::registerAirwindow({"XBandpass", "XYZ Filters", 361, "XBandpass is a distorted digital EQ, inspired by retro sampler DSP.", airwin2rack::XBandpass::kNumParameters, []() { return std::make_unique(0); }}); +int XBandpass_unused = AirwinRegistry::registerAirwindow({"XBandpass", "XYZ Filters", 362, "XBandpass is a distorted digital EQ, inspired by retro sampler DSP.", airwin2rack::XBandpass::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/XHighpass.h" -int XHighpass_unused = AirwinRegistry::registerAirwindow({"XHighpass", "XYZ Filters", 362, "XHighpass is a distorted digital EQ, inspired by retro sampler DSP.", airwin2rack::XHighpass::kNumParameters, []() { return std::make_unique(0); }}); +int XHighpass_unused = AirwinRegistry::registerAirwindow({"XHighpass", "XYZ Filters", 363, "XHighpass is a distorted digital EQ, inspired by retro sampler DSP.", airwin2rack::XHighpass::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/XLowpass.h" -int XLowpass_unused = AirwinRegistry::registerAirwindow({"XLowpass", "XYZ Filters", 363, "XLowpass is a distorted digital EQ, inspired by retro sampler DSP.", airwin2rack::XLowpass::kNumParameters, []() { return std::make_unique(0); }}); +int XLowpass_unused = AirwinRegistry::registerAirwindow({"XLowpass", "XYZ Filters", 364, "XLowpass is a distorted digital EQ, inspired by retro sampler DSP.", airwin2rack::XLowpass::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/XNotch.h" -int XNotch_unused = AirwinRegistry::registerAirwindow({"XNotch", "XYZ Filters", 364, "XNotch is a distorted digital EQ, not as glitchy as the others.", airwin2rack::XNotch::kNumParameters, []() { return std::make_unique(0); }}); +int XNotch_unused = AirwinRegistry::registerAirwindow({"XNotch", "XYZ Filters", 365, "XNotch is a distorted digital EQ, not as glitchy as the others.", airwin2rack::XNotch::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/XRegion.h" -int XRegion_unused = AirwinRegistry::registerAirwindow({"XRegion", "XYZ Filters", 365, "XRegion is distorted staggered bandpasses, for extreme soundmangling.", airwin2rack::XRegion::kNumParameters, []() { return std::make_unique(0); }}); +int XRegion_unused = AirwinRegistry::registerAirwindow({"XRegion", "XYZ Filters", 366, "XRegion is distorted staggered bandpasses, for extreme soundmangling.", airwin2rack::XRegion::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/YBandpass.h" int YBandpass_unused = AirwinRegistry::registerAirwindow({"YBandpass", "XYZ Filters", 355, "YBandpass is soft and smooth to nasty, edgy texture-varying filtering.", airwin2rack::YBandpass::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/YHighpass.h" -int YHighpass_unused = AirwinRegistry::registerAirwindow({"YHighpass", "XYZ Filters", 356, "YHighpass is soft and smooth to nasty, edgy texture-varying filtering.", airwin2rack::YHighpass::kNumParameters, []() { return std::make_unique(0); }}); +int YHighpass_unused = AirwinRegistry::registerAirwindow({"YHighpass", "XYZ Filters", 357, "YHighpass is soft and smooth to nasty, edgy texture-varying filtering.", airwin2rack::YHighpass::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/YLowpass.h" -int YLowpass_unused = AirwinRegistry::registerAirwindow({"YLowpass", "XYZ Filters", 358, "YLowpass is soft and smooth to nasty, edgy texture-varying filtering.", airwin2rack::YLowpass::kNumParameters, []() { return std::make_unique(0); }}); +int YLowpass_unused = AirwinRegistry::registerAirwindow({"YLowpass", "XYZ Filters", 359, "YLowpass is soft and smooth to nasty, edgy texture-varying filtering.", airwin2rack::YLowpass::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/YNotBandpass.h" -int YNotBandpass_unused = AirwinRegistry::registerAirwindow({"YNotBandpass", "Unclassified", -1, "", airwin2rack::YNotBandpass::kNumParameters, []() { return std::make_unique(0); }}); +int YNotBandpass_unused = AirwinRegistry::registerAirwindow({"YNotBandpass", "XYZ Filters", 356, "YNotBandpass is soft and smooth to nasty, edgy texture-varying filtering, no control smoothing.", airwin2rack::YNotBandpass::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/YNotHighpass.h" -int YNotHighpass_unused = AirwinRegistry::registerAirwindow({"YNotHighpass", "XYZ Filters", 357, "YNotHighpass is soft and smooth to nasty, edgy texture-varying filtering, no control smoothing.", airwin2rack::YNotHighpass::kNumParameters, []() { return std::make_unique(0); }}); +int YNotHighpass_unused = AirwinRegistry::registerAirwindow({"YNotHighpass", "XYZ Filters", 358, "YNotHighpass is soft and smooth to nasty, edgy texture-varying filtering, no control smoothing.", airwin2rack::YNotHighpass::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/YNotLowpass.h" -int YNotLowpass_unused = AirwinRegistry::registerAirwindow({"YNotLowpass", "XYZ Filters", 359, "YNotLowpass is soft and smooth to nasty, edgy texture-varying filtering, no control smoothing.", airwin2rack::YNotLowpass::kNumParameters, []() { return std::make_unique(0); }}); +int YNotLowpass_unused = AirwinRegistry::registerAirwindow({"YNotLowpass", "XYZ Filters", 360, "YNotLowpass is soft and smooth to nasty, edgy texture-varying filtering, no control smoothing.", airwin2rack::YNotLowpass::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/YNotNotch.h" int YNotNotch_unused = AirwinRegistry::registerAirwindow({"YNotNotch", "Unclassified", -1, "", airwin2rack::YNotNotch::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/YNotch.h" -int YNotch_unused = AirwinRegistry::registerAirwindow({"YNotch", "XYZ Filters", 360, "YNotch is soft and smooth to nasty, edgy texture-varying filtering.", airwin2rack::YNotch::kNumParameters, []() { return std::make_unique(0); }}); +int YNotch_unused = AirwinRegistry::registerAirwindow({"YNotch", "XYZ Filters", 361, "YNotch is soft and smooth to nasty, edgy texture-varying filtering.", airwin2rack::YNotch::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/ZBandpass.h" int ZBandpass_unused = AirwinRegistry::registerAirwindow({"ZBandpass", "XYZ Filters", 350, "ZBandpass is a bandpass made to sound and act like the Emu e6400 Ultra bandpass.", airwin2rack::ZBandpass::kNumParameters, []() { return std::make_unique(0); }}); #include "autogen_airwin/ZBandpass2.h" diff --git a/src/autogen_airwin/ConsoleMCBuss.cpp b/src/autogen_airwin/ConsoleMCBuss.cpp index e9f587e..93bcc6e 100644 --- a/src/autogen_airwin/ConsoleMCBuss.cpp +++ b/src/autogen_airwin/ConsoleMCBuss.cpp @@ -15,7 +15,7 @@ ConsoleMCBuss::ConsoleMCBuss(audioMasterCallback audioMaster) : { A = 1.0; - for (int x = 0; x < gslew_total; x++) gslew[x] = 0.0; + lastSinewL = lastSinewR = 0.0; subAL = subAR = subBL = subBR = subCL = subCR = subDL = subDR = 0.0; gainA = gainB = 1.0; diff --git a/src/autogen_airwin/ConsoleMCBuss.h b/src/autogen_airwin/ConsoleMCBuss.h index 4a6a98d..7ba6a68 100644 --- a/src/autogen_airwin/ConsoleMCBuss.h +++ b/src/autogen_airwin/ConsoleMCBuss.h @@ -54,61 +54,9 @@ class ConsoleMCBuss : char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - enum { - prevSampL1, - prevSampR1, - invSampL1, - invSampR1, - threshold1, - prevSampL2, - prevSampR2, - invSampL2, - invSampR2, - threshold2, - prevSampL3, - prevSampR3, - invSampL3, - invSampR3, - threshold3, - prevSampL4, - prevSampR4, - invSampL4, - invSampR4, - threshold4, - prevSampL5, - prevSampR5, - invSampL5, - invSampR5, - threshold5, - prevSampL6, - prevSampR6, - invSampL6, - invSampR6, - threshold6, - prevSampL7, - prevSampR7, - invSampL7, - invSampR7, - threshold7, - prevSampL8, - prevSampR8, - invSampL8, - invSampR8, - threshold8, - prevSampL9, - prevSampR9, - invSampL9, - invSampR9, - threshold9, - prevSampL10, - prevSampR10, - invSampL10, - invSampR10, - threshold10, - gslew_total - }; //fixed frequency pear filter for ultrasonics, stereo - double gslew[gslew_total]; //probably worth just using a number here - + double lastSinewL; + double lastSinewR; + double subAL; double subAR; double subBL; diff --git a/src/autogen_airwin/ConsoleMCBussProc.cpp b/src/autogen_airwin/ConsoleMCBussProc.cpp index 1c97d91..223be2c 100644 --- a/src/autogen_airwin/ConsoleMCBussProc.cpp +++ b/src/autogen_airwin/ConsoleMCBussProc.cpp @@ -19,37 +19,17 @@ void ConsoleMCBuss::processReplacing(float **inputs, float **outputs, VstInt32 s double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - - double source = 0.814/overallscale; - gslew[threshold10] = source; - source *= 1.618033988749894848204586; - gslew[threshold9] = source; - source *= 1.618033988749894848204586; - gslew[threshold8] = source; - source *= 1.618033988749894848204586; - gslew[threshold7] = source; - source *= 1.618033988749894848204586; - gslew[threshold6] = source; - source *= 1.618033988749894848204586; - gslew[threshold5] = source; - source *= 1.618033988749894848204586; - gslew[threshold4] = source; - source *= 1.618033988749894848204586; - gslew[threshold3] = source; - source *= 1.618033988749894848204586; - gslew[threshold2] = source; - source *= 1.618033988749894848204586; - gslew[threshold1] = source; - source *= 1.618033988749894848204586; - + gainA = gainB; gainB = sqrt(A); //smoothed master fader from Z2 filters //this will be applied three times: this is to make the various tone alterations //hit differently at different master fader drive levels. //in particular, backing off the master fader tightens the super lows - //but opens up the EverySlew, because more of the attentuation happens before + //but opens up the modified Sinew, because more of the attentuation happens before //you even get to slew clipping :) and if the fader is not active, it bypasses completely. + double threshSinew = 0.5171104/overallscale; + while (--sampleFrames >= 0) { double inputSampleL = *in1; @@ -121,23 +101,22 @@ void ConsoleMCBuss::processReplacing(float **inputs, float **outputs, VstInt32 s //after C7Buss but before EverySlew: allow highs to come out a bit more //when pulling back master fader. Less drive equals more open - //begin EverySlew - for (int x = 20; x < gslew_total; x += 5) { //gslew_total is 50 - - if (((inputSampleL-gslew[x])-((gslew[x]-gslew[x+2])*0.618033988749894848204586)) > gslew[x+4]) - inputSampleL = (gslew[x]-((gslew[x]-gslew[x+2])*0.141)) + (gslew[x+4]*(1.0-0.141)); - if (-((inputSampleL-gslew[x])-((gslew[x]-gslew[x+2])*0.618033988749894848204586)) > gslew[x+4]) - inputSampleL = (gslew[x]-((gslew[x]-gslew[x+2])*0.141*0.78)) - (gslew[x+4]*(1.0-(0.141*0.78))); - gslew[x+2] = gslew[x]*(1.0-0.141); - gslew[x] = inputSampleL; - - if (((inputSampleR-gslew[x+1])-((gslew[x+1]-gslew[x+3])*0.618033988749894848204586)) > gslew[x+4]) - inputSampleR = (gslew[x+1]-((gslew[x+1]-gslew[x+3])*0.141)) + (gslew[x+4]*(1.0-0.141)); - if (-((inputSampleR-gslew[x+1])-((gslew[x+1]-gslew[x+3])*0.618033988749894848204586)) > gslew[x+4]) - inputSampleR = (gslew[x+1]-((gslew[x+1]-gslew[x+3])*0.141*0.78)) - (gslew[x+4]*(1.0-(0.141*0.78))); - gslew[x+3] = gslew[x+1]*(1.0-0.141); - gslew[x+1] = inputSampleR; - } + temp = inputSampleL; + double clamp = inputSampleL - lastSinewL; + if (lastSinewL > 1.0) lastSinewL = 1.0; + if (lastSinewL < -1.0) lastSinewL = -1.0; + double sinew = threshSinew * cos(lastSinewL); + if (clamp > sinew) temp = lastSinewL + sinew; + if (-clamp > sinew) temp = lastSinewL - sinew; + inputSampleL = lastSinewL = temp; + temp = inputSampleR; + clamp = inputSampleR - lastSinewR; + if (lastSinewR > 1.0) lastSinewR = 1.0; + if (lastSinewR < -1.0) lastSinewR = -1.0; + sinew = threshSinew * cos(lastSinewR); + if (clamp > sinew) temp = lastSinewR + sinew; + if (-clamp > sinew) temp = lastSinewR - sinew; + inputSampleR = lastSinewR = temp; if (gain < 1.0) { inputSampleL *= gain; @@ -175,37 +154,17 @@ void ConsoleMCBuss::processDoubleReplacing(double **inputs, double **outputs, Vs double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - - double source = 0.814/overallscale; - gslew[threshold10] = source; - source *= 1.618033988749894848204586; - gslew[threshold9] = source; - source *= 1.618033988749894848204586; - gslew[threshold8] = source; - source *= 1.618033988749894848204586; - gslew[threshold7] = source; - source *= 1.618033988749894848204586; - gslew[threshold6] = source; - source *= 1.618033988749894848204586; - gslew[threshold5] = source; - source *= 1.618033988749894848204586; - gslew[threshold4] = source; - source *= 1.618033988749894848204586; - gslew[threshold3] = source; - source *= 1.618033988749894848204586; - gslew[threshold2] = source; - source *= 1.618033988749894848204586; - gslew[threshold1] = source; - source *= 1.618033988749894848204586; - + gainA = gainB; gainB = sqrt(A); //smoothed master fader from Z2 filters //this will be applied three times: this is to make the various tone alterations //hit differently at different master fader drive levels. //in particular, backing off the master fader tightens the super lows - //but opens up the EverySlew, because more of the attentuation happens before + //but opens up the modified Sinew, because more of the attentuation happens before //you even get to slew clipping :) and if the fader is not active, it bypasses completely. + double threshSinew = 0.5171104/overallscale; + while (--sampleFrames >= 0) { double inputSampleL = *in1; @@ -277,23 +236,22 @@ void ConsoleMCBuss::processDoubleReplacing(double **inputs, double **outputs, Vs //after C7Buss but before EverySlew: allow highs to come out a bit more //when pulling back master fader. Less drive equals more open - //begin EverySlew - for (int x = 20; x < gslew_total; x += 5) { //gslew_total is 50 - - if (((inputSampleL-gslew[x])-((gslew[x]-gslew[x+2])*0.618033988749894848204586)) > gslew[x+4]) - inputSampleL = (gslew[x]-((gslew[x]-gslew[x+2])*0.141)) + (gslew[x+4]*(1.0-0.141)); - if (-((inputSampleL-gslew[x])-((gslew[x]-gslew[x+2])*0.618033988749894848204586)) > gslew[x+4]) - inputSampleL = (gslew[x]-((gslew[x]-gslew[x+2])*0.141*0.78)) - (gslew[x+4]*(1.0-(0.141*0.78))); - gslew[x+2] = gslew[x]*(1.0-0.141); - gslew[x] = inputSampleL; - - if (((inputSampleR-gslew[x+1])-((gslew[x+1]-gslew[x+3])*0.618033988749894848204586)) > gslew[x+4]) - inputSampleR = (gslew[x+1]-((gslew[x+1]-gslew[x+3])*0.141)) + (gslew[x+4]*(1.0-0.141)); - if (-((inputSampleR-gslew[x+1])-((gslew[x+1]-gslew[x+3])*0.618033988749894848204586)) > gslew[x+4]) - inputSampleR = (gslew[x+1]-((gslew[x+1]-gslew[x+3])*0.141*0.78)) - (gslew[x+4]*(1.0-(0.141*0.78))); - gslew[x+3] = gslew[x+1]*(1.0-0.141); - gslew[x+1] = inputSampleR; - } + temp = inputSampleL; + double clamp = inputSampleL - lastSinewL; + if (lastSinewL > 1.0) lastSinewL = 1.0; + if (lastSinewL < -1.0) lastSinewL = -1.0; + double sinew = threshSinew * cos(lastSinewL); + if (clamp > sinew) temp = lastSinewL + sinew; + if (-clamp > sinew) temp = lastSinewL - sinew; + inputSampleL = lastSinewL = temp; + temp = inputSampleR; + clamp = inputSampleR - lastSinewR; + if (lastSinewR > 1.0) lastSinewR = 1.0; + if (lastSinewR < -1.0) lastSinewR = -1.0; + sinew = threshSinew * cos(lastSinewR); + if (clamp > sinew) temp = lastSinewR + sinew; + if (-clamp > sinew) temp = lastSinewR - sinew; + inputSampleR = lastSinewR = temp; if (gain < 1.0) { inputSampleL *= gain;