aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/SurgeTide
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/SurgeTide
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/SurgeTide')
-rwxr-xr-xplugins/MacVST/SurgeTide/SurgeTide.xcodeproj/christopherjohnson.pbxuser22
-rwxr-xr-xplugins/MacVST/SurgeTide/SurgeTide.xcodeproj/christopherjohnson.perspectivev330
-rwxr-xr-xplugins/MacVST/SurgeTide/source/SurgeTide.cpp6
-rwxr-xr-xplugins/MacVST/SurgeTide/source/SurgeTide.h6
-rwxr-xr-xplugins/MacVST/SurgeTide/source/SurgeTideProc.cpp66
5 files changed, 48 insertions, 82 deletions
diff --git a/plugins/MacVST/SurgeTide/SurgeTide.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/SurgeTide/SurgeTide.xcodeproj/christopherjohnson.pbxuser
index c98ccc2..4f6f5f0 100755
--- a/plugins/MacVST/SurgeTide/SurgeTide.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/SurgeTide/SurgeTide.xcodeproj/christopherjohnson.pbxuser
@@ -49,11 +49,11 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 528463581;
- PBXWorkspaceStateSaveDate = 528463581;
+ PBXPerProjectTemplateStateSaveDate = 569772872;
+ PBXWorkspaceStateSaveDate = 569772872;
};
perUserProjectItems = {
- 8B9D70D31F7EF8CC007AB60F /* PBXTextBookmark */ = 8B9D70D31F7EF8CC007AB60F /* PBXTextBookmark */;
+ 8B7940F021F60B71006E9731 /* PBXTextBookmark */ = 8B7940F021F60B71006E9731 /* PBXTextBookmark */;
8B9D7EA31F7FB6EC007AB60F /* PBXTextBookmark */ = 8B9D7EA31F7FB6EC007AB60F /* PBXTextBookmark */;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
@@ -62,23 +62,23 @@
};
2407DEB6089929BA00EB68BF /* SurgeTide.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {848, 1846}}";
- sepNavSelRange = "{4583, 0}";
- sepNavVisRange = "{0, 1913}";
+ sepNavIntBoundsRect = "{{0, 0}, {848, 1859}}";
+ sepNavSelRange = "{517, 0}";
+ sepNavVisRange = "{0, 1960}";
sepNavWindowFrame = "{{12, 47}, {895, 831}}";
};
};
245463B80991757100464AD3 /* SurgeTide.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {866, 949}}";
- sepNavSelRange = "{2633, 0}";
- sepNavVisRange = "{377, 2268}";
+ sepNavIntBoundsRect = "{{0, 0}, {866, 923}}";
+ sepNavSelRange = "{2465, 0}";
+ sepNavVisRange = "{369, 2224}";
sepNavWindowFrame = "{{20, 47}, {895, 831}}";
};
};
24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {747, 19864}}";
+ sepNavIntBoundsRect = "{{0, 0}, {747, 19877}}";
sepNavSelRange = "{10616, 0}";
sepNavVisRange = "{0, 0}";
sepNavWindowFrame = "{{15, 42}, {895, 831}}";
@@ -106,7 +106,7 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
- 8B9D70D31F7EF8CC007AB60F /* PBXTextBookmark */ = {
+ 8B7940F021F60B71006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */;
name = "audioeffectx.cpp: 307";
diff --git a/plugins/MacVST/SurgeTide/SurgeTide.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/SurgeTide/SurgeTide.xcodeproj/christopherjohnson.perspectivev3
index 4c96578..ad29a23 100755
--- a/plugins/MacVST/SurgeTide/SurgeTide.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/SurgeTide/SurgeTide.xcodeproj/christopherjohnson.perspectivev3
@@ -300,7 +300,7 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>6</integer>
+ <integer>5</integer>
<integer>4</integer>
<integer>0</integer>
</array>
@@ -351,10 +351,10 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B9D7EA31F7FB6EC007AB60F</string>
+ <string>8B7940F021F60B71006E9731</string>
<key>history</key>
<array>
- <string>8B9D70D31F7EF8CC007AB60F</string>
+ <string>8B9D7EA31F7FB6EC007AB60F</string>
</array>
</dict>
<key>SplitCount</key>
@@ -368,18 +368,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 13}}</string>
+ <string>{{0, 0}, {603, 0}}</string>
<key>RubberWindowFrame</key>
<string>384 385 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>13pt</string>
+ <string>0pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>428pt</string>
+ <string>441pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -393,9 +393,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 401}}</string>
- <key>RubberWindowFrame</key>
- <string>384 385 810 487 0 0 1440 878 </string>
+ <string>{{10, 27}, {603, 414}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -449,7 +447,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 363}}</string>
+ <string>{{10, 27}, {603, 414}}</string>
+ <key>RubberWindowFrame</key>
+ <string>384 385 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -477,11 +477,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B9D7EA41F7FB6EC007AB60F</string>
+ <string>8B7940F121F60B71006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B9D7EA51F7FB6EC007AB60F</string>
+ <string>8B7940F221F60B71006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8B9D7EA61F7FB6EC007AB60F</string>
+ <string>8B7940F321F60B71006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -634,7 +634,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>528463596.67712098</real>
+ <real>569772913.08327401</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -651,7 +651,7 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B9D7EA71F7FB6EC007AB60F</string>
+ <string>8B7940F421F60B71006E9731</string>
<string>/Users/christopherjohnson/Desktop/MacVST/SurgeTide/SurgeTide.xcodeproj</string>
</array>
<key>WindowString</key>
diff --git a/plugins/MacVST/SurgeTide/source/SurgeTide.cpp b/plugins/MacVST/SurgeTide/source/SurgeTide.cpp
index 8df46c0..494e886 100755
--- a/plugins/MacVST/SurgeTide/source/SurgeTide.cpp
+++ b/plugins/MacVST/SurgeTide/source/SurgeTide.cpp
@@ -15,10 +15,8 @@ SurgeTide::SurgeTide(audioMasterCallback audioMaster) :
A = 0.5;
B = 0.3;
C = 1.0;
- fpNShapeAL = 0.0;
- fpNShapeBL = 0.0;
- fpNShapeAR = 0.0;
- fpNShapeBR = 0.0;
+ fpNShapeL = 0.0;
+ fpNShapeR = 0.0;
flip = true;
chaseA = 0.0;
chaseB = 0.0;
diff --git a/plugins/MacVST/SurgeTide/source/SurgeTide.h b/plugins/MacVST/SurgeTide/source/SurgeTide.h
index 27495d7..8f8cd42 100755
--- a/plugins/MacVST/SurgeTide/source/SurgeTide.h
+++ b/plugins/MacVST/SurgeTide/source/SurgeTide.h
@@ -54,10 +54,8 @@ private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;
- long double fpNShapeAL;
- long double fpNShapeBL;
- long double fpNShapeAR;
- long double fpNShapeBR;
+ long double fpNShapeL;
+ long double fpNShapeR;
bool flip;
long double chaseA;
long double chaseB;
diff --git a/plugins/MacVST/SurgeTide/source/SurgeTideProc.cpp b/plugins/MacVST/SurgeTide/source/SurgeTideProc.cpp
index 2fc6a1a..59a92aa 100755
--- a/plugins/MacVST/SurgeTide/source/SurgeTideProc.cpp
+++ b/plugins/MacVST/SurgeTide/source/SurgeTideProc.cpp
@@ -17,9 +17,6 @@ void SurgeTide::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 inputSampleL;
long double inputSampleR;
@@ -110,27 +107,14 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl
inputSampleR = drySampleR - (inputSampleR * intensity);
inputSampleR = (drySampleR * dry) + (inputSampleR * wet);
- //noise shaping to 32-bit floating point
- if (flip) {
- fpTemp = inputSampleL;
- fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeAL;
-
- fpTemp = inputSampleR;
- fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeAR;
- }
- else {
- fpTemp = inputSampleL;
- fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeBL;
-
- fpTemp = inputSampleR;
- fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeBR;
- }
- flip = !flip;
- //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;
@@ -152,9 +136,6 @@ void SurgeTide::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 inputSampleL;
long double inputSampleR;
@@ -245,27 +226,16 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt
inputSampleR = drySampleR - (inputSampleR * intensity);
inputSampleR = (drySampleR * dry) + (inputSampleR * wet);
- //noise shaping to 64-bit floating point
- if (flip) {
- fpTemp = inputSampleL;
- fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeAL;
-
- fpTemp = inputSampleR;
- fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeAR;
- }
- else {
- fpTemp = inputSampleL;
- fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeBL;
-
- fpTemp = inputSampleR;
- fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeBR;
- }
- flip = !flip;
- //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;