aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/Floor
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/Floor
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/Floor')
-rwxr-xr-xplugins/MacVST/Floor/Floor.xcodeproj/christopherjohnson.pbxuser16
-rwxr-xr-xplugins/MacVST/Floor/Floor.xcodeproj/christopherjohnson.perspectivev332
-rwxr-xr-xplugins/MacVST/Floor/source/FloorProc.cpp54
3 files changed, 41 insertions, 61 deletions
diff --git a/plugins/MacVST/Floor/Floor.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/Floor/Floor.xcodeproj/christopherjohnson.pbxuser
index 612e5ad..80b3123 100755
--- a/plugins/MacVST/Floor/Floor.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/Floor/Floor.xcodeproj/christopherjohnson.pbxuser
@@ -49,12 +49,12 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 561685582;
- PBXWorkspaceStateSaveDate = 561685582;
+ PBXPerProjectTemplateStateSaveDate = 569735322;
+ PBXWorkspaceStateSaveDate = 569735322;
};
perUserProjectItems = {
8B15DD34217AAF67007AD769 /* PBXTextBookmark */ = 8B15DD34217AAF67007AD769 /* PBXTextBookmark */;
- 8B42FCB721604F9E0092969A /* PBXTextBookmark */ = 8B42FCB721604F9E0092969A /* PBXTextBookmark */;
+ 8B793A6E21F578D2006E9731 /* PBXTextBookmark */ = 8B793A6E21F578D2006E9731 /* PBXTextBookmark */;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
@@ -70,9 +70,9 @@
};
245463B80991757100464AD3 /* Floor.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {866, 1170}}";
+ sepNavIntBoundsRect = "{{0, 0}, {600, 1365}}";
sepNavSelRange = "{0, 0}";
- sepNavVisRange = "{485, 163}";
+ sepNavVisRange = "{485, 155}";
sepNavWindowFrame = "{{20, 47}, {895, 831}}";
};
};
@@ -116,15 +116,15 @@
vrLen = 163;
vrLoc = 485;
};
- 8B42FCB721604F9E0092969A /* PBXTextBookmark */ = {
+ 8B793A6E21F578D2006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 245463B80991757100464AD3 /* Floor.h */;
name = "Floor.h: 1";
rLen = 0;
rLoc = 0;
rType = 0;
- vrLen = 217;
- vrLoc = 459;
+ vrLen = 155;
+ vrLoc = 485;
};
8D01CCC60486CAD60068D4B7 /* Floor */ = {
activeExec = 0;
diff --git a/plugins/MacVST/Floor/Floor.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/Floor/Floor.xcodeproj/christopherjohnson.perspectivev3
index 853f35f..3af6cc1 100755
--- a/plugins/MacVST/Floor/Floor.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/Floor/Floor.xcodeproj/christopherjohnson.perspectivev3
@@ -323,7 +323,7 @@
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>21 338 810 487 0 0 1440 878 </string>
+ <string>334 313 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -351,10 +351,10 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B15DD34217AAF67007AD769</string>
+ <string>8B793A6E21F578D2006E9731</string>
<key>history</key>
<array>
- <string>8B42FCB721604F9E0092969A</string>
+ <string>8B15DD34217AAF67007AD769</string>
</array>
</dict>
<key>SplitCount</key>
@@ -368,18 +368,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 117}}</string>
+ <string>{{0, 0}, {603, 102}}</string>
<key>RubberWindowFrame</key>
- <string>21 338 810 487 0 0 1440 878 </string>
+ <string>334 313 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>117pt</string>
+ <string>102pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>324pt</string>
+ <string>339pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -393,9 +393,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 297}}</string>
+ <string>{{10, 27}, {603, 312}}</string>
<key>RubberWindowFrame</key>
- <string>21 338 810 487 0 0 1440 878 </string>
+ <string>334 313 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -477,11 +477,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B15DD35217AAF67007AD769</string>
+ <string>8B793A6F21F578D2006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B15DD36217AAF67007AD769</string>
+ <string>8B793A7021F578D2006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8B15DD37217AAF67007AD769</string>
+ <string>8B793A7121F578D2006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -634,7 +634,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>561688423.58535099</real>
+ <real>569735378.06358504</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -651,12 +651,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B15DD38217AAF67007AD769</string>
- <string>8B15DD39217AAF67007AD769</string>
- <string>/Users/christopherjohnson/Desktop/Floor/Floor.xcodeproj</string>
+ <string>/Users/christopherjohnson/Desktop/MacVST/Floor/Floor.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>21 338 810 487 0 0 1440 878 </string>
+ <string>334 313 810 487 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>
diff --git a/plugins/MacVST/Floor/source/FloorProc.cpp b/plugins/MacVST/Floor/source/FloorProc.cpp
index 69a2ccb..865446b 100755
--- a/plugins/MacVST/Floor/source/FloorProc.cpp
+++ b/plugins/MacVST/Floor/source/FloorProc.cpp
@@ -247,18 +247,14 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
inputSampleR = (inputSampleR * wet) + (drySampleR * dry);
}
- //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;
@@ -268,12 +264,6 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
*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 Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
@@ -516,18 +506,16 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
inputSampleR = (inputSampleR * wet) + (drySampleR * dry);
}
- //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;
@@ -537,10 +525,4 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
*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.
}