diff options
author | Chris Johnson <jinx6568@sover.net> | 2019-01-27 21:13:54 -0500 |
---|---|---|
committer | Chris Johnson <jinx6568@sover.net> | 2019-01-27 21:13:54 -0500 |
commit | 966f2d253cd2ee6ce140ad68095a20a9d2b63052 (patch) | |
tree | b0400d95bd06512531ade6ddf55190a58b6a5623 /plugins/MacAU/AtmosphereBuss | |
parent | 0887543349dbbec0721a1fc8b1c7deba9afefa8b (diff) | |
download | airwindows-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/AtmosphereBuss')
3 files changed, 63 insertions, 66 deletions
diff --git a/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.cpp b/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.cpp index 508cd06..c68d1ee 100755 --- a/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.cpp +++ b/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.cpp @@ -203,7 +203,6 @@ void AtmosphereBuss::AtmosphereBussKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - Float32 fpTemp; Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -342,23 +341,15 @@ void AtmosphereBuss::AtmosphereBussKernel::Process( const Float32 *inSourceP, 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 Atmosphere, 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/AtmosphereBuss/AtmosphereBuss.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.xcodeproj/christopherjohnson.pbxuser index 6387880..d3cdc9f 100755 --- a/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.xcodeproj/christopherjohnson.pbxuser @@ -49,18 +49,48 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 546563283; - PBXWorkspaceStateSaveDate = 546563283; + PBXPerProjectTemplateStateSaveDate = 569588700; + PBXWorkspaceStateSaveDate = 569588700; }; perUserProjectItems = { + 8B7927A021F33C4A006E9731 /* PBXTextBookmark */ = 8B7927A021F33C4A006E9731 /* PBXTextBookmark */; + 8B7927A121F33C4A006E9731 /* XCBuildMessageTextBookmark */ = 8B7927A121F33C4A006E9731 /* XCBuildMessageTextBookmark */; + 8B7927A221F33C4A006E9731 /* PBXTextBookmark */ = 8B7927A221F33C4A006E9731 /* PBXTextBookmark */; 8B7A85312054728D0074B00C /* PlistBookmark */ = 8B7A85312054728D0074B00C /* PlistBookmark */; - 8BC5CF4A2093F4B70058B257 /* PBXTextBookmark */ = 8BC5CF4A2093F4B70058B257 /* PBXTextBookmark */; - 8BC5CF4B2093F4B70058B257 /* PBXTextBookmark */ = 8BC5CF4B2093F4B70058B257 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; + 8B7927A021F33C4A006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BC6025B073B072D006C4272 /* AtmosphereBuss.h */; + name = "AtmosphereBuss.h: 130"; + rLen = 0; + rLoc = 5139; + rType = 0; + vrLen = 177; + vrLoc = 5070; + }; + 8B7927A121F33C4A006E9731 /* XCBuildMessageTextBookmark */ = { + isa = PBXTextBookmark; + comments = "Unused variable 'fpTemp'"; + fRef = 8BA05A660720730100365D66 /* AtmosphereBuss.cpp */; + fallbackIsa = XCBuildMessageTextBookmark; + rLen = 1; + rLoc = 205; + rType = 1; + }; + 8B7927A221F33C4A006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* AtmosphereBuss.cpp */; + name = "AtmosphereBuss.cpp: 206"; + rLen = 0; + rLoc = 8815; + rType = 0; + vrLen = 266; + vrLoc = 8708; + }; 8B7A85312054728D0074B00C /* PlistBookmark */ = { isa = PlistBookmark; fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */; @@ -75,10 +105,10 @@ }; 8BA05A660720730100365D66 /* AtmosphereBuss.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {677, 4914}}"; - sepNavSelRange = "{13285, 0}"; - sepNavVisRange = "{13794, 273}"; - sepNavWindowFrame = "{{815, 35}, {816, 832}}"; + sepNavIntBoundsRect = "{{0, 0}, {656, 4667}}"; + sepNavSelRange = "{8815, 0}"; + sepNavVisRange = "{8708, 266}"; + sepNavWindowFrame = "{{378, 46}, {816, 832}}"; }; }; 8BA05A690720730100365D66 /* AtmosphereBussVersion.h */ = { @@ -89,31 +119,11 @@ sepNavWindowFrame = "{{692, 46}, {816, 832}}"; }; }; - 8BC5CF4A2093F4B70058B257 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BA05A660720730100365D66 /* AtmosphereBuss.cpp */; - name = "AtmosphereBuss.cpp: 321"; - rLen = 0; - rLoc = 13285; - rType = 0; - vrLen = 273; - vrLoc = 13794; - }; - 8BC5CF4B2093F4B70058B257 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BA05A660720730100365D66 /* AtmosphereBuss.cpp */; - name = "AtmosphereBuss.cpp: 321"; - rLen = 0; - rLoc = 13285; - rType = 0; - vrLen = 273; - vrLoc = 13794; - }; 8BC6025B073B072D006C4272 /* AtmosphereBuss.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {894, 2132}}"; + sepNavIntBoundsRect = "{{0, 0}, {810, 2483}}"; sepNavSelRange = "{5139, 0}"; - sepNavVisRange = "{1894, 1791}"; + sepNavVisRange = "{5070, 177}"; sepNavWindowFrame = "{{743, 46}, {816, 832}}"; }; }; diff --git a/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.xcodeproj/christopherjohnson.perspectivev3 index e3a1dec..b791cf4 100755 --- a/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.xcodeproj/christopherjohnson.perspectivev3 @@ -256,8 +256,6 @@ <key>Layout</key> <array> <dict> - <key>BecomeActive</key> - <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> @@ -302,9 +300,6 @@ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> - <integer>4</integer> - <integer>2</integer> - <integer>1</integer> <integer>0</integer> </array> </array> @@ -326,7 +321,7 @@ <real>288</real> </array> <key>RubberWindowFrame</key> - <string>597 180 841 654 0 0 1440 878 </string> + <string>434 184 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -354,11 +349,12 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8BC5CF4B2093F4B70058B257</string> + <string>8B7927A221F33C4A006E9731</string> <key>history</key> <array> <string>8B7A85312054728D0074B00C</string> - <string>8BC5CF4A2093F4B70058B257</string> + <string>8B7927A021F33C4A006E9731</string> + <string>8B7927A121F33C4A006E9731</string> </array> </dict> <key>SplitCount</key> @@ -372,18 +368,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {531, 142}}</string> + <string>{{0, 0}, {531, 126}}</string> <key>RubberWindowFrame</key> - <string>597 180 841 654 0 0 1440 878 </string> + <string>434 184 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>142pt</string> + <string>126pt</string> </dict> <dict> <key>Proportion</key> - <string>466pt</string> + <string>482pt</string> <key>Tabs</key> <array> <dict> @@ -397,9 +393,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 439}}</string> - <key>RubberWindowFrame</key> - <string>597 180 841 654 0 0 1440 878 </string> + <string>{{10, 27}, {531, 455}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -453,7 +447,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 339}}</string> + <string>{{10, 27}, {531, 455}}</string> + <key>RubberWindowFrame</key> + <string>434 184 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -481,11 +477,11 @@ </array> <key>TableOfContents</key> <array> - <string>8BC5CF4C2093F4B70058B257</string> + <string>8B7927A321F33C4A006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8BC5CF4D2093F4B70058B257</string> + <string>8B7927A421F33C4A006E9731</string> <string>8BD7274A1D46E5A5000176F0</string> - <string>8BC5CF4E2093F4B70058B257</string> + <string>8B7927A521F33C4A006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -658,7 +654,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>546567351.06036103</real> + <real>569588810.27972102</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -675,11 +671,11 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8BC5CF4F2093F4B70058B257</string> + <string>8B7927A621F33C4A006E9731</string> <string>/Users/christopherjohnson/Desktop/MacAU/AtmosphereBuss/AtmosphereBuss.xcodeproj</string> </array> <key>WindowString</key> - <string>597 180 841 654 0 0 1440 878 </string> + <string>434 184 841 654 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |