aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/ButterComp2
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/ButterComp2
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/ButterComp2')
-rwxr-xr-xplugins/MacAU/ButterComp2/ButterComp2.cpp18
-rwxr-xr-xplugins/MacAU/ButterComp2/ButterComp2.xcodeproj/christopherjohnson.pbxuser22
-rwxr-xr-xplugins/MacAU/ButterComp2/ButterComp2.xcodeproj/christopherjohnson.perspectivev335
3 files changed, 32 insertions, 43 deletions
diff --git a/plugins/MacAU/ButterComp2/ButterComp2.cpp b/plugins/MacAU/ButterComp2/ButterComp2.cpp
index e85626f..ec45914 100755
--- a/plugins/MacAU/ButterComp2/ButterComp2.cpp
+++ b/plugins/MacAU/ButterComp2/ButterComp2.cpp
@@ -317,23 +317,15 @@ void ButterComp2::ButterComp2Kernel::Process( const Float32 *inSourceP,
flip = !flip;
- //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/ButterComp2/ButterComp2.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/ButterComp2/ButterComp2.xcodeproj/christopherjohnson.pbxuser
index e13714b..9bf558f 100755
--- a/plugins/MacAU/ButterComp2/ButterComp2.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/ButterComp2/ButterComp2.xcodeproj/christopherjohnson.pbxuser
@@ -49,13 +49,13 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 559960504;
- PBXWorkspaceStateSaveDate = 559960504;
+ PBXPerProjectTemplateStateSaveDate = 569590507;
+ PBXWorkspaceStateSaveDate = 569590507;
};
perUserProjectItems = {
8B42FD41216050B10092969A /* PBXTextBookmark */ = 8B42FD41216050B10092969A /* PBXTextBookmark */;
- 8B42FD83216056480092969A /* PBXTextBookmark */ = 8B42FD83216056480092969A /* PBXTextBookmark */;
- 8B42FD84216056480092969A /* PBXTextBookmark */ = 8B42FD84216056480092969A /* PBXTextBookmark */;
+ 8B79289621F34318006E9731 /* PBXTextBookmark */ = 8B79289621F34318006E9731 /* PBXTextBookmark */;
+ 8B79289B21F34328006E9731 /* PBXTextBookmark */ = 8B79289B21F34328006E9731 /* PBXTextBookmark */;
8BE6255F2157A02A00E4E476 /* PlistBookmark */ = 8BE6255F2157A02A00E4E476 /* PlistBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
@@ -72,32 +72,32 @@
vrLen = 214;
vrLoc = 5453;
};
- 8B42FD83216056480092969A /* PBXTextBookmark */ = {
+ 8B79289621F34318006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A660720730100365D66 /* ButterComp2.cpp */;
name = "ButterComp2.cpp: 252";
rLen = 0;
rLoc = 10778;
rType = 0;
- vrLen = 265;
+ vrLen = 180;
vrLoc = 10712;
};
- 8B42FD84216056480092969A /* PBXTextBookmark */ = {
+ 8B79289B21F34328006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A660720730100365D66 /* ButterComp2.cpp */;
name = "ButterComp2.cpp: 252";
rLen = 0;
rLoc = 10778;
rType = 0;
- vrLen = 265;
+ vrLen = 180;
vrLoc = 10712;
};
8BA05A660720730100365D66 /* ButterComp2.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {586, 4498}}";
+ sepNavIntBoundsRect = "{{0, 0}, {558, 4329}}";
sepNavSelRange = "{10778, 0}";
- sepNavVisRange = "{10712, 265}";
- sepNavWindowFrame = "{{864, 45}, {816, 833}}";
+ sepNavVisRange = "{10712, 180}";
+ sepNavWindowFrame = "{{496, 45}, {816, 833}}";
};
};
8BA05A690720730100365D66 /* ButterComp2Version.h */ = {
diff --git a/plugins/MacAU/ButterComp2/ButterComp2.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/ButterComp2/ButterComp2.xcodeproj/christopherjohnson.perspectivev3
index c95d3a7..22a4926 100755
--- a/plugins/MacAU/ButterComp2/ButterComp2.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/ButterComp2/ButterComp2.xcodeproj/christopherjohnson.perspectivev3
@@ -256,8 +256,6 @@
<key>Layout</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -326,7 +324,7 @@
<real>288</real>
</array>
<key>RubberWindowFrame</key>
- <string>662 164 841 654 0 0 1440 878 </string>
+ <string>456 186 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -354,12 +352,12 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B42FD84216056480092969A</string>
+ <string>8B79289B21F34328006E9731</string>
<key>history</key>
<array>
<string>8BE6255F2157A02A00E4E476</string>
<string>8B42FD41216050B10092969A</string>
- <string>8B42FD83216056480092969A</string>
+ <string>8B79289621F34318006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -373,18 +371,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {531, 126}}</string>
+ <string>{{0, 0}, {531, 109}}</string>
<key>RubberWindowFrame</key>
- <string>662 164 841 654 0 0 1440 878 </string>
+ <string>456 186 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>126pt</string>
+ <string>109pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>482pt</string>
+ <string>499pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -398,9 +396,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 455}}</string>
- <key>RubberWindowFrame</key>
- <string>662 164 841 654 0 0 1440 878 </string>
+ <string>{{10, 27}, {531, 472}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -454,7 +450,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 393}}</string>
+ <string>{{10, 27}, {531, 472}}</string>
+ <key>RubberWindowFrame</key>
+ <string>456 186 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -482,11 +480,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B42FD85216056480092969A</string>
+ <string>8B79289C21F34328006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B42FD86216056480092969A</string>
+ <string>8B79289D21F34328006E9731</string>
<string>8BD7274A1D46E5A5000176F0</string>
- <string>8B42FD87216056480092969A</string>
+ <string>8B79289E21F34328006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -659,7 +657,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>559961672.53862405</real>
+ <real>569590568.39095497</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -676,11 +674,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B42FD88216056480092969A</string>
<string>/Users/christopherjohnson/Desktop/MacAU/ButterComp2/ButterComp2.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>662 164 841 654 0 0 1440 878 </string>
+ <string>456 186 841 654 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>