aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/Pyewacket
diff options
context:
space:
mode:
authorChris Johnson <jinx6568@sover.net>2019-01-27 21:13:54 -0500
committerChris Johnson <jinx6568@sover.net>2019-01-27 21:13:54 -0500
commit966f2d253cd2ee6ce140ad68095a20a9d2b63052 (patch)
treeb0400d95bd06512531ade6ddf55190a58b6a5623 /plugins/MacVST/Pyewacket
parent0887543349dbbec0721a1fc8b1c7deba9afefa8b (diff)
downloadairwindows-lv2-port-966f2d253cd2ee6ce140ad68095a20a9d2b63052.tar.gz
airwindows-lv2-port-966f2d253cd2ee6ce140ad68095a20a9d2b63052.tar.bz2
airwindows-lv2-port-966f2d253cd2ee6ce140ad68095a20a9d2b63052.zip
Floating Point Dither For All
Diffstat (limited to 'plugins/MacVST/Pyewacket')
-rwxr-xr-xplugins/MacVST/Pyewacket/Pyewacket.xcodeproj/christopherjohnson.pbxuser4
-rwxr-xr-xplugins/MacVST/Pyewacket/Pyewacket.xcodeproj/christopherjohnson.perspectivev317
-rwxr-xr-xplugins/MacVST/Pyewacket/source/Pyewacket.cpp7
-rwxr-xr-xplugins/MacVST/Pyewacket/source/Pyewacket.h7
-rwxr-xr-xplugins/MacVST/Pyewacket/source/PyewacketProc.cpp62
5 files changed, 34 insertions, 63 deletions
diff --git a/plugins/MacVST/Pyewacket/Pyewacket.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/Pyewacket/Pyewacket.xcodeproj/christopherjohnson.pbxuser
index 7900b2c..378f89f 100755
--- a/plugins/MacVST/Pyewacket/Pyewacket.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/Pyewacket/Pyewacket.xcodeproj/christopherjohnson.pbxuser
@@ -49,8 +49,8 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 528461728;
- PBXWorkspaceStateSaveDate = 528461728;
+ PBXPerProjectTemplateStateSaveDate = 569771462;
+ PBXWorkspaceStateSaveDate = 569771462;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
diff --git a/plugins/MacVST/Pyewacket/Pyewacket.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/Pyewacket/Pyewacket.xcodeproj/christopherjohnson.perspectivev3
index c05f255..6841380 100755
--- a/plugins/MacVST/Pyewacket/Pyewacket.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/Pyewacket/Pyewacket.xcodeproj/christopherjohnson.perspectivev3
@@ -360,18 +360,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 32}}</string>
+ <string>{{0, 0}, {603, 13}}</string>
<key>RubberWindowFrame</key>
<string>498 357 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>32pt</string>
+ <string>13pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>409pt</string>
+ <string>428pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -385,7 +385,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 382}}</string>
+ <string>{{10, 27}, {603, 401}}</string>
<key>RubberWindowFrame</key>
<string>498 357 810 487 0 0 1440 878 </string>
</dict>
@@ -469,11 +469,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B9D7D6A1F7FAFB4007AB60F</string>
+ <string>8B793F1C21F605CE006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B9D7D6B1F7FAFB4007AB60F</string>
+ <string>8B793F1D21F605CE006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8B9D7D6C1F7FAFB4007AB60F</string>
+ <string>8B793F1E21F605CE006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -626,7 +626,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>528461748.86590397</real>
+ <real>569771470.99615598</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -643,7 +643,6 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B9D7D6D1F7FAFB4007AB60F</string>
<string>/Users/christopherjohnson/Desktop/MacVST/Pyewacket/Pyewacket.xcodeproj</string>
</array>
<key>WindowString</key>
diff --git a/plugins/MacVST/Pyewacket/source/Pyewacket.cpp b/plugins/MacVST/Pyewacket/source/Pyewacket.cpp
index ee2db40..d500e74 100755
--- a/plugins/MacVST/Pyewacket/source/Pyewacket.cpp
+++ b/plugins/MacVST/Pyewacket/source/Pyewacket.cpp
@@ -18,11 +18,8 @@ Pyewacket::Pyewacket(audioMasterCallback audioMaster) :
chase = 1.0;
lastrectifierL = 0.0;
lastrectifierR = 0.0;
- fpNShapeLA = 0.0;
- fpNShapeLB = 0.0;
- fpNShapeRA = 0.0;
- fpNShapeRB = 0.0;
- fpFlip = true;
+ fpNShapeL = 0.0;
+ fpNShapeR = 0.0;
//this is reset: values being initialized only once. Startup values, whatever they are.
_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
diff --git a/plugins/MacVST/Pyewacket/source/Pyewacket.h b/plugins/MacVST/Pyewacket/source/Pyewacket.h
index 593001f..087a198 100755
--- a/plugins/MacVST/Pyewacket/source/Pyewacket.h
+++ b/plugins/MacVST/Pyewacket/source/Pyewacket.h
@@ -54,11 +54,8 @@ private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;
- long double fpNShapeLA;
- long double fpNShapeLB;
- long double fpNShapeRA;
- long double fpNShapeRB;
- bool fpFlip;
+ long double fpNShapeL;
+ long double fpNShapeR;
//default stuff
double chase;
double lastrectifierL;
diff --git a/plugins/MacVST/Pyewacket/source/PyewacketProc.cpp b/plugins/MacVST/Pyewacket/source/PyewacketProc.cpp
index 83112a2..8b3021a 100755
--- a/plugins/MacVST/Pyewacket/source/PyewacketProc.cpp
+++ b/plugins/MacVST/Pyewacket/source/PyewacketProc.cpp
@@ -17,9 +17,8 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
- float fpTemp;
long double fpOld = 0.618033988749894848204586; //golden ratio!
- long double fpNew = 1.0 - fpOld;
+ long double fpNew = 1.0 - fpOld;
long double inputSampleL;
long double inputSampleR;
long double drySampleL;
@@ -134,25 +133,14 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl
inputSampleR *= outputGain;
}
- //noise shaping to 32-bit floating point
- if (fpFlip) {
- fpTemp = inputSampleL;
- fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeLA;
- fpTemp = inputSampleR;
- fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeRA;
- }
- else {
- fpTemp = inputSampleL;
- fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeLB;
- fpTemp = inputSampleR;
- fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeRB;
- }
- fpFlip = !fpFlip;
- //end noise shaping on 32 bit output
+ //stereo 32 bit dither, made small and tidy.
+ int expon; frexpf((float)inputSampleL, &expon);
+ long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62);
+ inputSampleL += (dither-fpNShapeL); fpNShapeL = dither;
+ frexpf((float)inputSampleR, &expon);
+ dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62);
+ inputSampleR += (dither-fpNShapeR); fpNShapeR = dither;
+ //end 32 bit dither
*out1 = inputSampleL;
*out2 = inputSampleR;
@@ -174,9 +162,8 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
- double fpTemp; //this is different from singlereplacing
long double fpOld = 0.618033988749894848204586; //golden ratio!
- long double fpNew = 1.0 - fpOld;
+ long double fpNew = 1.0 - fpOld;
long double inputSampleL;
long double inputSampleR;
long double drySampleL;
@@ -291,25 +278,16 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt
inputSampleR *= outputGain;
}
- //noise shaping to 64-bit floating point
- if (fpFlip) {
- fpTemp = inputSampleL;
- fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeLA;
- fpTemp = inputSampleR;
- fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeRA;
- }
- else {
- fpTemp = inputSampleL;
- fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeLB;
- fpTemp = inputSampleR;
- fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeRB;
- }
- fpFlip = !fpFlip;
- //end noise shaping on 64 bit output
+ //stereo 64 bit dither, made small and tidy.
+ int expon; frexp((double)inputSampleL, &expon);
+ long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62);
+ dither /= 536870912.0; //needs this to scale to 64 bit zone
+ inputSampleL += (dither-fpNShapeL); fpNShapeL = dither;
+ frexp((double)inputSampleR, &expon);
+ dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62);
+ dither /= 536870912.0; //needs this to scale to 64 bit zone
+ inputSampleR += (dither-fpNShapeR); fpNShapeR = dither;
+ //end 64 bit dither
*out1 = inputSampleL;
*out2 = inputSampleR;