aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/DubSub
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/DubSub
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/DubSub')
-rwxr-xr-xplugins/MacVST/DubSub/DubSub.xcodeproj/christopherjohnson.pbxuser76
-rwxr-xr-xplugins/MacVST/DubSub/DubSub.xcodeproj/christopherjohnson.perspectivev338
-rwxr-xr-xplugins/MacVST/DubSub/source/DubSubProc.cpp54
3 files changed, 75 insertions, 93 deletions
diff --git a/plugins/MacVST/DubSub/DubSub.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/DubSub/DubSub.xcodeproj/christopherjohnson.pbxuser
index d93b3f3..759f11f 100755
--- a/plugins/MacVST/DubSub/DubSub.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/DubSub/DubSub.xcodeproj/christopherjohnson.pbxuser
@@ -49,14 +49,14 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 560565932;
- PBXWorkspaceStateSaveDate = 560565932;
+ PBXPerProjectTemplateStateSaveDate = 569734904;
+ PBXWorkspaceStateSaveDate = 569734904;
};
perUserProjectItems = {
- 8B42FC0221604E960092969A /* PBXTextBookmark */ = 8B42FC0221604E960092969A /* PBXTextBookmark */;
- 8B42FC0321604E960092969A /* PBXTextBookmark */ = 8B42FC0321604E960092969A /* PBXTextBookmark */;
- 8B42FE27216978EE0092969A /* PBXTextBookmark */ = 8B42FE27216978EE0092969A /* PBXTextBookmark */;
- 8B42FE6F216992760092969A /* PBXTextBookmark */ = 8B42FE6F216992760092969A /* PBXTextBookmark */;
+ 8B15DBE121788E19007AD769 /* PBXTextBookmark */ = 8B15DBE121788E19007AD769 /* PBXTextBookmark */;
+ 8B15DC4F21789111007AD769 /* PBXTextBookmark */ = 8B15DC4F21789111007AD769 /* PBXTextBookmark */;
+ 8B15DC6F217891D4007AD769 /* PBXTextBookmark */ = 8B15DC6F217891D4007AD769 /* PBXTextBookmark */;
+ 8B79394121F57705006E9731 /* PBXTextBookmark */ = 8B79394121F57705006E9731 /* PBXTextBookmark */;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
@@ -64,18 +64,18 @@
};
2407DEB6089929BA00EB68BF /* DubSub.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {848, 3237}}";
- sepNavSelRange = "{7461, 0}";
- sepNavVisRange = "{6004, 3058}";
- sepNavWindowFrame = "{{4, 38}, {895, 831}}";
+ sepNavIntBoundsRect = "{{0, 0}, {712, 3575}}";
+ sepNavSelRange = "{8745, 0}";
+ sepNavVisRange = "{44, 171}";
+ sepNavWindowFrame = "{{705, 47}, {895, 831}}";
};
};
245463B80991757100464AD3 /* DubSub.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {554, 2314}}";
- sepNavSelRange = "{0, 0}";
- sepNavVisRange = "{0, 99}";
- sepNavWindowFrame = "{{20, 47}, {895, 831}}";
+ sepNavIntBoundsRect = "{{0, 0}, {866, 2340}}";
+ sepNavSelRange = "{2508, 2128}";
+ sepNavVisRange = "{3746, 901}";
+ sepNavWindowFrame = "{{659, 47}, {895, 831}}";
};
};
24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = {
@@ -88,10 +88,10 @@
};
24D8286F09A914000093AEF8 /* DubSubProc.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {848, 10296}}";
- sepNavSelRange = "{30534, 0}";
- sepNavVisRange = "{29455, 2823}";
- sepNavWindowFrame = "{{229, 47}, {895, 831}}";
+ sepNavIntBoundsRect = "{{0, 0}, {554, 10985}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 0}";
+ sepNavWindowFrame = "{{563, 47}, {895, 831}}";
};
};
8B02375E1D42B1C400E1E8C8 /* Source Control */ = {
@@ -108,45 +108,45 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
- 8B42FC0221604E960092969A /* PBXTextBookmark */ = {
+ 8B15DBE121788E19007AD769 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
- fRef = 2407DEB6089929BA00EB68BF /* DubSub.cpp */;
- name = "DubSub.cpp: 142";
+ fRef = 245463B80991757100464AD3 /* DubSub.h */;
+ name = "DubSub.h: 1";
rLen = 0;
- rLoc = 8745;
+ rLoc = 0;
rType = 0;
- vrLen = 281;
- vrLoc = 1938;
+ vrLen = 66;
+ vrLoc = 0;
};
- 8B42FC0321604E960092969A /* PBXTextBookmark */ = {
+ 8B15DC4F21789111007AD769 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 24D8286F09A914000093AEF8 /* DubSubProc.cpp */;
name = "DubSubProc.cpp: 1";
rLen = 0;
rLoc = 0;
rType = 0;
- vrLen = 208;
+ vrLen = 0;
vrLoc = 0;
};
- 8B42FE27216978EE0092969A /* PBXTextBookmark */ = {
+ 8B15DC6F217891D4007AD769 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
- fRef = 245463B80991757100464AD3 /* DubSub.h */;
- name = "DubSub.h: 1";
+ fRef = 2407DEB6089929BA00EB68BF /* DubSub.cpp */;
+ name = "DubSub.cpp: 267";
rLen = 0;
- rLoc = 0;
+ rLoc = 8745;
rType = 0;
- vrLen = 208;
- vrLoc = 0;
+ vrLen = 172;
+ vrLoc = 44;
};
- 8B42FE6F216992760092969A /* PBXTextBookmark */ = {
+ 8B79394121F57705006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
- fRef = 245463B80991757100464AD3 /* DubSub.h */;
- name = "DubSub.h: 1";
+ fRef = 2407DEB6089929BA00EB68BF /* DubSub.cpp */;
+ name = "DubSub.cpp: 267";
rLen = 0;
- rLoc = 0;
+ rLoc = 8745;
rType = 0;
- vrLen = 99;
- vrLoc = 0;
+ vrLen = 171;
+ vrLoc = 44;
};
8D01CCC60486CAD60068D4B7 /* DubSub */ = {
activeExec = 0;
diff --git a/plugins/MacVST/DubSub/DubSub.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/DubSub/DubSub.xcodeproj/christopherjohnson.perspectivev3
index 681760b..f2fabd2 100755
--- a/plugins/MacVST/DubSub/DubSub.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/DubSub/DubSub.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>
@@ -323,7 +323,7 @@
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>86 201 810 487 0 0 1440 878 </string>
+ <string>613 292 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -339,7 +339,7 @@
<key>PBXProjectModuleGUID</key>
<string>8B0237581D42B1C400E1E8C8</string>
<key>PBXProjectModuleLabel</key>
- <string>DubSub.h</string>
+ <string>DubSub.cpp</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -347,16 +347,16 @@
<key>PBXProjectModuleGUID</key>
<string>8B0237591D42B1C400E1E8C8</string>
<key>PBXProjectModuleLabel</key>
- <string>DubSub.h</string>
+ <string>DubSub.cpp</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B42FE6F216992760092969A</string>
+ <string>8B79394121F57705006E9731</string>
<key>history</key>
<array>
- <string>8B42FC0221604E960092969A</string>
- <string>8B42FC0321604E960092969A</string>
- <string>8B42FE27216978EE0092969A</string>
+ <string>8B15DBE121788E19007AD769</string>
+ <string>8B15DC4F21789111007AD769</string>
+ <string>8B15DC6F217891D4007AD769</string>
</array>
</dict>
<key>SplitCount</key>
@@ -370,18 +370,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 69}}</string>
+ <string>{{0, 0}, {603, 117}}</string>
<key>RubberWindowFrame</key>
- <string>86 201 810 487 0 0 1440 878 </string>
+ <string>613 292 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>69pt</string>
+ <string>117pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>372pt</string>
+ <string>324pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -395,9 +395,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 345}}</string>
+ <string>{{10, 27}, {603, 297}}</string>
<key>RubberWindowFrame</key>
- <string>86 201 810 487 0 0 1440 878 </string>
+ <string>613 292 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -479,11 +479,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B42FE70216992760092969A</string>
+ <string>8B79394221F57705006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B42FE71216992760092969A</string>
+ <string>8B79394321F57705006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8B42FE72216992760092969A</string>
+ <string>8B79394421F57705006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -636,7 +636,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>560566902.22521102</real>
+ <real>569734917.70818102</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -656,7 +656,7 @@
<string>/Users/christopherjohnson/Desktop/MacVST/DubSub/DubSub.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>86 201 810 487 0 0 1440 878 </string>
+ <string>613 292 810 487 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>
diff --git a/plugins/MacVST/DubSub/source/DubSubProc.cpp b/plugins/MacVST/DubSub/source/DubSubProc.cpp
index 037480c..7a0349d 100755
--- a/plugins/MacVST/DubSub/source/DubSubProc.cpp
+++ b/plugins/MacVST/DubSub/source/DubSubProc.cpp
@@ -392,18 +392,14 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr
bflip++;
if (bflip < 1 || bflip > 3) bflip = 1;
- //noise shaping to 32-bit floating point
- float fpTemp = inputSampleL;
- fpNShapeL += (inputSampleL-fpTemp);
- inputSampleL += fpNShapeL;
- //if this confuses you look at the wordlength for fpTemp :)
- fpTemp = inputSampleR;
- fpNShapeR += (inputSampleR-fpTemp);
- inputSampleR += fpNShapeR;
- //for deeper space and warmth, we try a non-oscillating noise shaping
- //that is kind of ruthless: it will forever retain the rounding errors
- //except we'll dial it back a hair at the end of every buffer processed
- //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;
@@ -413,12 +409,6 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr
*out1++;
*out2++;
}
- fpNShapeL *= 0.999999;
- fpNShapeR *= 0.999999;
- //we will just delicately dial back the FP noise shaping, not even every sample
- //this is a good place to put subtle 'no runaway' calculations, though bear in mind
- //that it will be called more often when you use shorter sample buffers in the DAW.
- //So, very low latency operation will call these calculations more often.
}
void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
@@ -805,18 +795,16 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32
bflip++;
if (bflip < 1 || bflip > 3) bflip = 1;
- //noise shaping to 64-bit floating point
- double fpTemp = inputSampleL;
- fpNShapeL += (inputSampleL-fpTemp);
- inputSampleL += fpNShapeL;
- //if this confuses you look at the wordlength for fpTemp :)
- fpTemp = inputSampleR;
- fpNShapeR += (inputSampleR-fpTemp);
- inputSampleR += fpNShapeR;
- //for deeper space and warmth, we try a non-oscillating noise shaping
- //that is kind of ruthless: it will forever retain the rounding errors
- //except we'll dial it back a hair at the end of every buffer processed
- //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;
@@ -826,10 +814,4 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32
*out1++;
*out2++;
}
- fpNShapeL *= 0.999999;
- fpNShapeR *= 0.999999;
- //we will just delicately dial back the FP noise shaping, not even every sample
- //this is a good place to put subtle 'no runaway' calculations, though bear in mind
- //that it will be called more often when you use shorter sample buffers in the DAW.
- //So, very low latency operation will call these calculations more often.
}