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/C5RawBuss | |
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/C5RawBuss')
4 files changed, 43 insertions, 118 deletions
diff --git a/plugins/MacAU/C5RawBuss/C5RawBuss.cpp b/plugins/MacAU/C5RawBuss/C5RawBuss.cpp index 4f45ac0..9cca2dd 100755 --- a/plugins/MacAU/C5RawBuss/C5RawBuss.cpp +++ b/plugins/MacAU/C5RawBuss/C5RawBuss.cpp @@ -160,9 +160,7 @@ void C5RawBuss::C5RawBussKernel::Reset() { lastFXBuss = 0.0; lastSampleBuss = 0.0; - fpNShapeA = 0.0; - fpNShapeB = 0.0; - fpFlip = true; + fpNShape = 0.0; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -177,9 +175,6 @@ void C5RawBuss::C5RawBussKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - Float32 fpTemp; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; long double centering = GetParameter( kParam_One ) * 0.5; centering = 1.0 - pow(centering,5); @@ -237,19 +232,11 @@ void C5RawBuss::C5RawBussKernel::Process( const Float32 *inSourceP, //build new signal off what was present in output last time //slew aspect - //noise shaping to 32-bit floating point - if (fpFlip) { - fpTemp = inputSample; - fpNShapeA = (fpNShapeA*fpOld)+((inputSample-fpTemp)*fpNew); - inputSample += fpNShapeA; - } - else { - fpTemp = inputSample; - fpNShapeB = (fpNShapeB*fpOld)+((inputSample-fpTemp)*fpNew); - inputSample += fpNShapeB; - } - fpFlip = !fpFlip; - //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; diff --git a/plugins/MacAU/C5RawBuss/C5RawBuss.h b/plugins/MacAU/C5RawBuss/C5RawBuss.h index b8a3a7c..1d3209e 100755 --- a/plugins/MacAU/C5RawBuss/C5RawBuss.h +++ b/plugins/MacAU/C5RawBuss/C5RawBuss.h @@ -127,9 +127,7 @@ public: private: Float64 lastFXBuss; Float64 lastSampleBuss; - long double fpNShapeA; - long double fpNShapeB; - bool fpFlip; + long double fpNShape; }; }; diff --git a/plugins/MacAU/C5RawBuss/C5RawBuss.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/C5RawBuss/C5RawBuss.xcodeproj/christopherjohnson.pbxuser index b1e416f..cd94a9b 100755 --- a/plugins/MacAU/C5RawBuss/C5RawBuss.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/C5RawBuss/C5RawBuss.xcodeproj/christopherjohnson.pbxuser @@ -49,20 +49,18 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 538699005; - PBXWorkspaceStateSaveDate = 538699005; + PBXPerProjectTemplateStateSaveDate = 569590602; + PBXWorkspaceStateSaveDate = 569590602; }; perUserProjectItems = { - 8B4E55B3201BC48D00B5DC2A /* PlistBookmark */ = 8B4E55B3201BC48D00B5DC2A /* PlistBookmark */; - 8B4E57B0201BE78F00B5DC2A /* PBXBookmark */ = 8B4E57B0201BE78F00B5DC2A /* PBXBookmark */; - 8B4E57B9201BF00900B5DC2A /* PlistBookmark */ = 8B4E57B9201BF00900B5DC2A /* PlistBookmark */; - 8B4E57BC201BF00900B5DC2A /* PBXTextBookmark */ = 8B4E57BC201BF00900B5DC2A /* PBXTextBookmark */; + 8B7928AC21F343AD006E9731 /* PlistBookmark */ = 8B7928AC21F343AD006E9731 /* PlistBookmark */; + 8B7928B121F343BF006E9731 /* PlistBookmark */ = 8B7928B121F343BF006E9731 /* PlistBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; - 8B4E55B3201BC48D00B5DC2A /* PlistBookmark */ = { + 8B7928AC21F343AD006E9731 /* PlistBookmark */ = { isa = PlistBookmark; fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */; fallbackIsa = PBXBookmark; @@ -70,15 +68,11 @@ kPath = ( CFBundleName, ); - name = /Users/christopherjohnson/Desktop/C5RawBuss/Info.plist; + name = /Users/christopherjohnson/Desktop/MacAU/C5RawBuss/Info.plist; rLen = 0; - rLoc = 9223372036854775808; - }; - 8B4E57B0201BE78F00B5DC2A /* PBXBookmark */ = { - isa = PBXBookmark; - fRef = 8BA05A660720730100365D66 /* C5RawBuss.cpp */; + rLoc = 9223372036854775807; }; - 8B4E57B9201BF00900B5DC2A /* PlistBookmark */ = { + 8B7928B121F343BF006E9731 /* PlistBookmark */ = { isa = PlistBookmark; fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */; fallbackIsa = PBXBookmark; @@ -87,25 +81,15 @@ CFBundleName, ); name = /Users/christopherjohnson/Desktop/MacAU/C5RawBuss/Info.plist; - rLen = 0; - rLoc = 9223372036854775807; - }; - 8B4E57BC201BF00900B5DC2A /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BA05A660720730100365D66 /* C5RawBuss.cpp */; - name = "C5RawBuss.cpp: 220"; - rLen = 762; - rLoc = 9965; - rType = 0; - vrLen = 1877; - vrLoc = 9307; + rLen = 26; + rLoc = 0; }; 8BA05A660720730100365D66 /* C5RawBuss.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {876, 3380}}"; - sepNavSelRange = "{9965, 762}"; - sepNavVisRange = "{9307, 1877}"; - sepNavWindowFrame = "{{-64, 50}, {923, 828}}"; + sepNavIntBoundsRect = "{{0, 0}, {876, 3419}}"; + sepNavSelRange = "{10825, 0}"; + sepNavVisRange = "{7481, 2627}"; + sepNavWindowFrame = "{{369, 50}, {923, 828}}"; }; }; 8BA05A690720730100365D66 /* C5RawBussVersion.h */ = { @@ -118,9 +102,9 @@ }; 8BC6025B073B072D006C4272 /* C5RawBuss.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {894, 1807}}"; - sepNavSelRange = "{5077, 48}"; - sepNavVisRange = "{2715, 1805}"; + sepNavIntBoundsRect = "{{0, 0}, {894, 1781}}"; + sepNavSelRange = "{5147, 0}"; + sepNavVisRange = "{3528, 1724}"; sepNavWindowFrame = "{{517, 50}, {923, 828}}"; }; }; diff --git a/plugins/MacAU/C5RawBuss/C5RawBuss.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/C5RawBuss/C5RawBuss.xcodeproj/christopherjohnson.perspectivev3 index dc4bb99..a043097 100755 --- a/plugins/MacAU/C5RawBuss/C5RawBuss.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/C5RawBuss/C5RawBuss.xcodeproj/christopherjohnson.perspectivev3 @@ -222,52 +222,11 @@ </dict> </array> <key>OpenEditors</key> - <array> - <dict> - <key>Content</key> - <dict> - <key>PBXProjectModuleGUID</key> - <string>8B4E57BA201BF00900B5DC2A</string> - <key>PBXProjectModuleLabel</key> - <string>C5RawBuss.cpp</string> - <key>PBXSplitModuleInNavigatorKey</key> - <dict> - <key>Split0</key> - <dict> - <key>PBXProjectModuleGUID</key> - <string>8B4E57BB201BF00900B5DC2A</string> - <key>PBXProjectModuleLabel</key> - <string>C5RawBuss.cpp</string> - <key>_historyCapacity</key> - <integer>0</integer> - <key>bookmark</key> - <string>8B4E57BC201BF00900B5DC2A</string> - <key>history</key> - <array> - <string>8B4E57B0201BE78F00B5DC2A</string> - </array> - </dict> - <key>SplitCount</key> - <string>1</string> - </dict> - <key>StatusBarVisibility</key> - <true/> - </dict> - <key>Geometry</key> - <dict> - <key>Frame</key> - <string>{{0, 20}, {923, 731}}</string> - <key>PBXModuleWindowStatusBarHidden2</key> - <false/> - <key>RubberWindowFrame</key> - <string>-64 106 923 772 0 0 1440 878 </string> - </dict> - </dict> - </array> + <array/> <key>PerspectiveWidths</key> <array> - <integer>810</integer> - <integer>810</integer> + <integer>682</integer> + <integer>682</integer> </array> <key>Perspectives</key> <array> @@ -297,8 +256,6 @@ <key>Layout</key> <array> <dict> - <key>BecomeActive</key> - <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> @@ -367,7 +324,7 @@ <real>288</real> </array> <key>RubberWindowFrame</key> - <string>719 408 682 464 0 0 1440 878 </string> + <string>598 397 682 464 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -395,10 +352,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B4E57B9201BF00900B5DC2A</string> + <string>8B7928B121F343BF006E9731</string> <key>history</key> <array> - <string>8B4E55B3201BC48D00B5DC2A</string> + <string>8B7928AC21F343AD006E9731</string> </array> </dict> <key>SplitCount</key> @@ -412,18 +369,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {372, 39}}</string> + <string>{{0, 0}, {372, 20}}</string> <key>RubberWindowFrame</key> - <string>719 408 682 464 0 0 1440 878 </string> + <string>598 397 682 464 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>39pt</string> + <string>20pt</string> </dict> <dict> <key>Proportion</key> - <string>379pt</string> + <string>398pt</string> <key>Tabs</key> <array> <dict> @@ -437,9 +394,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {372, 352}}</string> - <key>RubberWindowFrame</key> - <string>719 408 682 464 0 0 1440 878 </string> + <string>{{10, 27}, {372, 371}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -493,7 +448,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 31}, {603, 297}}</string> + <string>{{10, 27}, {372, 371}}</string> + <key>RubberWindowFrame</key> + <string>598 397 682 464 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -521,11 +478,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B4E5791201BE4FE00B5DC2A</string> + <string>8B7928B221F343BF006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B4E5792201BE4FE00B5DC2A</string> + <string>8B7928B321F343BF006E9731</string> <string>8BD7274A1D46E5A5000176F0</string> - <string>8B4E5793201BE4FE00B5DC2A</string> + <string>8B7928B421F343BF006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -698,7 +655,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>538701833.475577</real> + <real>569590719.21111</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -715,11 +672,10 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8B4E57BA201BF00900B5DC2A</string> <string>/Users/christopherjohnson/Desktop/MacAU/C5RawBuss/C5RawBuss.xcodeproj</string> </array> <key>WindowString</key> - <string>719 408 682 464 0 0 1440 878 </string> + <string>598 397 682 464 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |