aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/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/MacAU/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/MacAU/DubSub')
-rwxr-xr-xplugins/MacAU/DubSub/DubSub.cpp19
-rwxr-xr-xplugins/MacAU/DubSub/DubSub.xcodeproj/christopherjohnson.pbxuser36
-rwxr-xr-xplugins/MacAU/DubSub/DubSub.xcodeproj/christopherjohnson.perspectivev336
3 files changed, 40 insertions, 51 deletions
diff --git a/plugins/MacAU/DubSub/DubSub.cpp b/plugins/MacAU/DubSub/DubSub.cpp
index 3d375c7..49a371b 100755
--- a/plugins/MacAU/DubSub/DubSub.cpp
+++ b/plugins/MacAU/DubSub/DubSub.cpp
@@ -523,23 +523,14 @@ void DubSub::DubSubKernel::Process( const Float32 *inSourceP,
bflip++;
if (bflip < 1 || bflip > 3) bflip = 1;
-
- //noise shaping to 32-bit floating point
- Float32 fpTemp = inputSample;
- fpNShape += (inputSample-fpTemp);
- inputSample += fpNShape;
- //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
+ //32 bit dither, made small and tidy.
+ int expon; frexpf((Float32)inputSample, &expon);
+ long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62);
+ inputSample += (dither-fpNShape); fpNShape = dither;
+ //end 32 bit dither
*destP = inputSample;
sourceP += inNumChannels; destP += inNumChannels;
}
- fpNShape *= 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.
}
diff --git a/plugins/MacAU/DubSub/DubSub.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/DubSub/DubSub.xcodeproj/christopherjohnson.pbxuser
index 1b78563..0bf9966 100755
--- a/plugins/MacAU/DubSub/DubSub.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/DubSub/DubSub.xcodeproj/christopherjohnson.pbxuser
@@ -49,43 +49,43 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 560565055;
- PBXWorkspaceStateSaveDate = 560565055;
+ PBXPerProjectTemplateStateSaveDate = 569602135;
+ PBXWorkspaceStateSaveDate = 569602135;
};
perUserProjectItems = {
- 8B42FE3E21698BC50092969A /* PBXTextBookmark */ = 8B42FE3E21698BC50092969A /* PBXTextBookmark */;
- 8B42FE3F21698BC50092969A /* PBXTextBookmark */ = 8B42FE3F21698BC50092969A /* PBXTextBookmark */;
+ 8B792B7521F3708C006E9731 /* PBXTextBookmark */ = 8B792B7521F3708C006E9731 /* PBXTextBookmark */;
+ 8B792B7A21F3709C006E9731 /* PBXTextBookmark */ = 8B792B7A21F3709C006E9731 /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
};
};
- 8B42FE3E21698BC50092969A /* PBXTextBookmark */ = {
+ 8B792B7521F3708C006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A660720730100365D66 /* DubSub.cpp */;
name = "DubSub.cpp: 521";
rLen = 0;
rLoc = 22045;
rType = 0;
- vrLen = 160;
- vrLoc = 21949;
+ vrLen = 68;
+ vrLoc = 21996;
};
- 8B42FE3F21698BC50092969A /* PBXTextBookmark */ = {
+ 8B792B7A21F3709C006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A660720730100365D66 /* DubSub.cpp */;
name = "DubSub.cpp: 521";
rLen = 0;
rLoc = 22045;
rType = 0;
- vrLen = 160;
- vrLoc = 21915;
+ vrLen = 68;
+ vrLoc = 21996;
};
8BA05A660720730100365D66 /* DubSub.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {663, 7241}}";
+ sepNavIntBoundsRect = "{{0, 0}, {554, 7072}}";
sepNavSelRange = "{22045, 0}";
- sepNavVisRange = "{21915, 160}";
- sepNavWindowFrame = "{{749, 66}, {1145, 812}}";
+ sepNavVisRange = "{21996, 68}";
+ sepNavWindowFrame = "{{1, 41}, {1145, 812}}";
};
};
8BA05A670720730100365D66 /* DubSub.exp */ = {
@@ -108,16 +108,16 @@
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1098, 767}}";
sepNavSelRange = "{2869, 0}";
- sepNavVisRange = "{68, 2869}";
+ sepNavVisRange = "{49, 2888}";
sepNavWindowFrame = "{{295, 66}, {1145, 812}}";
};
};
8BC6025B073B072D006C4272 /* DubSub.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {824, 2392}}";
- sepNavSelRange = "{3332, 0}";
- sepNavVisRange = "{2519, 1677}";
- sepNavWindowFrame = "{{832, 72}, {608, 806}}";
+ sepNavIntBoundsRect = "{{0, 0}, {824, 2756}}";
+ sepNavSelRange = "{6097, 1035}";
+ sepNavVisRange = "{6232, 1033}";
+ sepNavWindowFrame = "{{26, 54}, {608, 806}}";
};
};
8BD3CCB8148830B20062E48C /* Source Control */ = {
diff --git a/plugins/MacAU/DubSub/DubSub.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/DubSub/DubSub.xcodeproj/christopherjohnson.perspectivev3
index 5e22a02..b95829d 100755
--- a/plugins/MacAU/DubSub/DubSub.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/DubSub/DubSub.xcodeproj/christopherjohnson.perspectivev3
@@ -256,8 +256,6 @@
<key>Layout</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -324,7 +322,7 @@
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>625 371 810 487 0 0 1440 878 </string>
+ <string>412 359 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -352,10 +350,10 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B42FE3F21698BC50092969A</string>
+ <string>8B792B7A21F3709C006E9731</string>
<key>history</key>
<array>
- <string>8B42FE3E21698BC50092969A</string>
+ <string>8B792B7521F3708C006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -369,18 +367,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 117}}</string>
+ <string>{{0, 0}, {603, 69}}</string>
<key>RubberWindowFrame</key>
- <string>625 371 810 487 0 0 1440 878 </string>
+ <string>412 359 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>117pt</string>
+ <string>69pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>324pt</string>
+ <string>372pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -394,9 +392,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 297}}</string>
- <key>RubberWindowFrame</key>
- <string>625 371 810 487 0 0 1440 878 </string>
+ <string>{{10, 27}, {603, 345}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -450,7 +446,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 414}}</string>
+ <string>{{10, 27}, {603, 345}}</string>
+ <key>RubberWindowFrame</key>
+ <string>412 359 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -478,11 +476,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B42FE4021698BC50092969A</string>
+ <string>8B792B7B21F3709C006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B42FE4121698BC50092969A</string>
+ <string>8B792B7C21F3709C006E9731</string>
<string>8BE6256A2157A03900E4E476</string>
- <string>8B42FE4221698BC50092969A</string>
+ <string>8B792B7D21F3709C006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -635,7 +633,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>560565189.36784196</real>
+ <real>569602204.74752998</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -652,11 +650,11 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B42FE4321698BC50092969A</string>
+ <string>8B792B7E21F3709C006E9731</string>
<string>/Users/christopherjohnson/Desktop/MacAU/DubSub/DubSub.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>625 371 810 487 0 0 1440 878 </string>
+ <string>412 359 810 487 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>