aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/AtmosphereChannel
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/AtmosphereChannel
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/AtmosphereChannel')
-rwxr-xr-xplugins/MacAU/AtmosphereChannel/AtmosphereChannel.cpp19
-rwxr-xr-xplugins/MacAU/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.pbxuser86
-rwxr-xr-xplugins/MacAU/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.perspectivev340
3 files changed, 67 insertions, 78 deletions
diff --git a/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.cpp b/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.cpp
index d0ca7aa..6ca9131 100755
--- a/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.cpp
+++ b/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.cpp
@@ -203,7 +203,6 @@ void AtmosphereChannel::AtmosphereChannelKernel::Process( const Float32 *inSou
UInt32 nSampleFrames = inFramesToProcess;
const Float32 *sourceP = inSourceP;
Float32 *destP = inDestP;
- Float32 fpTemp;
Float64 overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= GetSampleRate();
@@ -339,23 +338,15 @@ void AtmosphereChannel::AtmosphereChannelKernel::Process( const Float32 *inSou
lastSampleA = drySample;
//store the raw input sample again for use next time
- //noise shaping to 32-bit floating point
- 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/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.pbxuser
index d21e452..64fb8bb 100755
--- a/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.pbxuser
@@ -49,14 +49,14 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 546562903;
- PBXWorkspaceStateSaveDate = 546562903;
+ PBXPerProjectTemplateStateSaveDate = 569588835;
+ PBXWorkspaceStateSaveDate = 569588835;
};
perUserProjectItems = {
8B2BAFD320548396002C5203 /* PlistBookmark */ = 8B2BAFD320548396002C5203 /* PlistBookmark */;
- 8BC5CF502093F4BA0058B257 /* PBXTextBookmark */ = 8BC5CF502093F4BA0058B257 /* PBXTextBookmark */;
- 8BC5CF512093F4BA0058B257 /* PBXTextBookmark */ = 8BC5CF512093F4BA0058B257 /* PBXTextBookmark */;
- 8BC5CF522093F4BA0058B257 /* PBXTextBookmark */ = 8BC5CF522093F4BA0058B257 /* PBXTextBookmark */;
+ 8B7927B321F33C89006E9731 /* PBXTextBookmark */ = 8B7927B321F33C89006E9731 /* PBXTextBookmark */;
+ 8B7927B821F33C9F006E9731 /* PBXTextBookmark */ = 8B7927B821F33C9F006E9731 /* PBXTextBookmark */;
+ 8BFBE901209D18FF00E1438C /* PBXTextBookmark */ = 8BFBE901209D18FF00E1438C /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
@@ -74,12 +74,32 @@
rLen = 0;
rLoc = 9223372036854775808;
};
+ 8B7927B321F33C89006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* AtmosphereChannel.cpp */;
+ name = "AtmosphereChannel.cpp: 277";
+ rLen = 0;
+ rLoc = 11355;
+ rType = 0;
+ vrLen = 169;
+ vrLoc = 13693;
+ };
+ 8B7927B821F33C9F006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* AtmosphereChannel.cpp */;
+ name = "AtmosphereChannel.cpp: 277";
+ rLen = 0;
+ rLoc = 11355;
+ rType = 0;
+ vrLen = 169;
+ vrLoc = 13693;
+ };
8BA05A660720730100365D66 /* AtmosphereChannel.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {769, 5018}}";
- sepNavSelRange = "{14355, 349}";
- sepNavVisRange = "{12684, 2023}";
- sepNavWindowFrame = "{{624, 46}, {816, 832}}";
+ sepNavIntBoundsRect = "{{0, 0}, {482, 4654}}";
+ sepNavSelRange = "{11355, 0}";
+ sepNavVisRange = "{13693, 169}";
+ sepNavWindowFrame = "{{566, 46}, {816, 832}}";
};
};
8BA05A690720730100365D66 /* AtmosphereChannelVersion.h */ = {
@@ -90,42 +110,12 @@
sepNavWindowFrame = "{{726, 46}, {816, 832}}";
};
};
- 8BC5CF502093F4BA0058B257 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 8BA05A660720730100365D66 /* AtmosphereChannel.cpp */;
- name = "AtmosphereChannel.cpp: 277";
- rLen = 0;
- rLoc = 11372;
- rType = 0;
- vrLen = 304;
- vrLoc = 13659;
- };
- 8BC5CF512093F4BA0058B257 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 8BC6025B073B072D006C4272 /* AtmosphereChannel.h */;
- name = "AtmosphereChannel.h: 131";
- rLen = 713;
- rLoc = 5181;
- rType = 0;
- vrLen = 187;
- vrLoc = 5816;
- };
- 8BC5CF522093F4BA0058B257 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 8BC6025B073B072D006C4272 /* AtmosphereChannel.h */;
- name = "AtmosphereChannel.h: 131";
- rLen = 713;
- rLoc = 5181;
- rType = 0;
- vrLen = 187;
- vrLoc = 5816;
- };
8BC6025B073B072D006C4272 /* AtmosphereChannel.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {803, 2379}}";
- sepNavSelRange = "{5181, 713}";
- sepNavVisRange = "{5816, 187}";
- sepNavWindowFrame = "{{635, 25}, {816, 832}}";
+ sepNavIntBoundsRect = "{{0, 0}, {894, 2132}}";
+ sepNavSelRange = "{5129, 0}";
+ sepNavVisRange = "{4652, 1351}";
+ sepNavWindowFrame = "{{624, 39}, {816, 832}}";
};
};
8BD3CCB8148830B20062E48C /* Source Control */ = {
@@ -142,6 +132,16 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
+ 8BFBE901209D18FF00E1438C /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BC6025B073B072D006C4272 /* AtmosphereChannel.h */;
+ name = "AtmosphereChannel.h: 131";
+ rLen = 713;
+ rLoc = 5181;
+ rType = 0;
+ vrLen = 181;
+ vrLoc = 5816;
+ };
8D01CCC60486CAD60068D4B7 /* AtmosphereChannel */ = {
activeExec = 0;
};
diff --git a/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.perspectivev3
index 08b4968..f684856 100755
--- a/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.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>599 209 841 654 0 0 1440 878 </string>
+ <string>472 198 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -342,7 +340,7 @@
<key>PBXProjectModuleGUID</key>
<string>8BD7274A1D46E5A5000176F0</string>
<key>PBXProjectModuleLabel</key>
- <string>AtmosphereChannel.h</string>
+ <string>AtmosphereChannel.cpp</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -350,16 +348,16 @@
<key>PBXProjectModuleGUID</key>
<string>8BD7274B1D46E5A5000176F0</string>
<key>PBXProjectModuleLabel</key>
- <string>AtmosphereChannel.h</string>
+ <string>AtmosphereChannel.cpp</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8BC5CF522093F4BA0058B257</string>
+ <string>8B7927B821F33C9F006E9731</string>
<key>history</key>
<array>
<string>8B2BAFD320548396002C5203</string>
- <string>8BC5CF502093F4BA0058B257</string>
- <string>8BC5CF512093F4BA0058B257</string>
+ <string>8BFBE901209D18FF00E1438C</string>
+ <string>8B7927B321F33C89006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -373,18 +371,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {531, 158}}</string>
+ <string>{{0, 0}, {531, 92}}</string>
<key>RubberWindowFrame</key>
- <string>599 209 841 654 0 0 1440 878 </string>
+ <string>472 198 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>158pt</string>
+ <string>92pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>450pt</string>
+ <string>516pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -398,9 +396,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 423}}</string>
- <key>RubberWindowFrame</key>
- <string>599 209 841 654 0 0 1440 878 </string>
+ <string>{{10, 27}, {531, 489}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -454,7 +450,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 339}}</string>
+ <string>{{10, 27}, {531, 489}}</string>
+ <key>RubberWindowFrame</key>
+ <string>472 198 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -482,11 +480,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BC5CF532093F4BA0058B257</string>
+ <string>8B7927B921F33C9F006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8BC5CF542093F4BA0058B257</string>
+ <string>8B7927BA21F33C9F006E9731</string>
<string>8BD7274A1D46E5A5000176F0</string>
- <string>8BC5CF552093F4BA0058B257</string>
+ <string>8B7927BB21F33C9F006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -659,7 +657,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>546567354.06319106</real>
+ <real>569588895.18574297</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -679,7 +677,7 @@
<string>/Users/christopherjohnson/Desktop/MacAU/AtmosphereChannel/AtmosphereChannel.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>599 209 841 654 0 0 1440 878 </string>
+ <string>472 198 841 654 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>