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/Floor | |
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/Floor')
-rwxr-xr-x | plugins/MacAU/Floor/Floor.cpp | 18 | ||||
-rwxr-xr-x | plugins/MacAU/Floor/Floor.xcodeproj/christopherjohnson.pbxuser | 44 | ||||
-rwxr-xr-x | plugins/MacAU/Floor/Floor.xcodeproj/christopherjohnson.perspectivev3 | 34 |
3 files changed, 43 insertions, 53 deletions
diff --git a/plugins/MacAU/Floor/Floor.cpp b/plugins/MacAU/Floor/Floor.cpp index db0dbe5..fefa12e 100755 --- a/plugins/MacAU/Floor/Floor.cpp +++ b/plugins/MacAU/Floor/Floor.cpp @@ -346,23 +346,15 @@ void Floor::FloorKernel::Process( const Float32 *inSourceP, if (wet < 1.0) inputSample = (drySample * dry)+(inputSample*wet); - //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/Floor/Floor.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Floor/Floor.xcodeproj/christopherjohnson.pbxuser index c955700..6a349bf 100755 --- a/plugins/MacAU/Floor/Floor.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/Floor/Floor.xcodeproj/christopherjohnson.pbxuser @@ -49,34 +49,44 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 561685575; - PBXWorkspaceStateSaveDate = 561685575; + PBXPerProjectTemplateStateSaveDate = 569644795; + PBXWorkspaceStateSaveDate = 569644795; }; perUserProjectItems = { - 8B15DD2C217AA6B4007AD769 /* PBXTextBookmark */ = 8B15DD2C217AA6B4007AD769 /* PBXTextBookmark */; + 8B792C3E21F4179E006E9731 /* PBXTextBookmark */ = 8B792C3E21F4179E006E9731 /* PBXTextBookmark */; + 8B792C4321F4194B006E9731 /* PBXTextBookmark */ = 8B792C4321F4194B006E9731 /* PBXTextBookmark */; 8BE625F22157B1F000E4E476 /* PBXTextBookmark */ = 8BE625F22157B1F000E4E476 /* PBXTextBookmark */; - 8BE6261E2157B2E800E4E476 /* PBXTextBookmark */ = 8BE6261E2157B2E800E4E476 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; - 8B15DD2C217AA6B4007AD769 /* PBXTextBookmark */ = { + 8B792C3E21F4179E006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BC6025B073B072D006C4272 /* Floor.h */; name = "Floor.h: 1"; rLen = 0; rLoc = 0; rType = 0; - vrLen = 63; + vrLen = 60; + vrLoc = 0; + }; + 8B792C4321F4194B006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BC6025B073B072D006C4272 /* Floor.h */; + name = "Floor.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 60; vrLoc = 0; }; 8BA05A660720730100365D66 /* Floor.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {843, 4901}}"; - sepNavSelRange = "{10441, 3168}"; - sepNavVisRange = "{10017, 1785}"; - sepNavWindowFrame = "{{550, 56}, {890, 810}}"; + sepNavIntBoundsRect = "{{0, 0}, {843, 5096}}"; + sepNavSelRange = "{13928, 0}"; + sepNavVisRange = "{10975, 1602}"; + sepNavWindowFrame = "{{413, 68}, {890, 810}}"; }; }; 8BA05A670720730100365D66 /* Floor.exp */ = { @@ -99,8 +109,8 @@ uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {740, 2015}}"; sepNavSelRange = "{0, 0}"; - sepNavVisRange = "{0, 63}"; - sepNavWindowFrame = "{{743, 68}, {890, 810}}"; + sepNavVisRange = "{0, 60}"; + sepNavWindowFrame = "{{550, 68}, {890, 810}}"; }; }; 8BD3CCB8148830B20062E48C /* Source Control */ = { @@ -127,16 +137,6 @@ vrLen = 133; vrLoc = 0; }; - 8BE6261E2157B2E800E4E476 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BC6025B073B072D006C4272 /* Floor.h */; - name = "Floor.h: 1"; - rLen = 0; - rLoc = 0; - rType = 0; - vrLen = 126; - vrLoc = 0; - }; 8D01CCC60486CAD60068D4B7 /* Floor */ = { activeExec = 0; }; diff --git a/plugins/MacAU/Floor/Floor.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Floor/Floor.xcodeproj/christopherjohnson.perspectivev3 index 51cf855..d5526e2 100755 --- a/plugins/MacAU/Floor/Floor.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/Floor/Floor.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>745 315 810 487 0 0 1440 878 </string> + <string>517 310 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -352,11 +350,11 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B15DD2C217AA6B4007AD769</string> + <string>8B792C4321F4194B006E9731</string> <key>history</key> <array> <string>8BE625F22157B1F000E4E476</string> - <string>8BE6261E2157B2E800E4E476</string> + <string>8B792C3E21F4179E006E9731</string> </array> </dict> <key>SplitCount</key> @@ -370,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>745 315 810 487 0 0 1440 878 </string> + <string>517 310 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> @@ -395,9 +393,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 297}}</string> - <key>RubberWindowFrame</key> - <string>745 315 810 487 0 0 1440 878 </string> + <string>{{10, 27}, {603, 312}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -451,7 +447,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 282}}</string> + <string>{{10, 27}, {603, 312}}</string> + <key>RubberWindowFrame</key> + <string>517 310 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -479,11 +477,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B15DD08217AA44C007AD769</string> + <string>8B792C4421F4194B006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B15DD09217AA44C007AD769</string> + <string>8B792C4521F4194B006E9731</string> <string>8BE625F02157B1F000E4E476</string> - <string>8B15DD0A217AA44C007AD769</string> + <string>8B792C4621F4194B006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -636,7 +634,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>561686196.25954103</real> + <real>569645387.98353899</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -656,7 +654,7 @@ <string>/Users/christopherjohnson/Desktop/MacAU/Floor/Floor.xcodeproj</string> </array> <key>WindowString</key> - <string>745 315 810 487 0 0 1440 878 </string> + <string>517 310 810 487 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |