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/Console5Buss | |
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/Console5Buss')
4 files changed, 53 insertions, 70 deletions
diff --git a/plugins/MacAU/Console5Buss/Console5Buss.cpp b/plugins/MacAU/Console5Buss/Console5Buss.cpp index 13008f9..3c1c845 100755 --- a/plugins/MacAU/Console5Buss/Console5Buss.cpp +++ b/plugins/MacAU/Console5Buss/Console5Buss.cpp @@ -165,9 +165,7 @@ void Console5Buss::Console5BussKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShapeA = 0.0; - fpNShapeB = 0.0; - fpFlip = true; + fpNShape = 0.0; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,9 +183,6 @@ void Console5Buss::Console5BussKernel::Process( const Float32 *inSourceP, long double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - Float32 fpTemp; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; Float64 inputgain = GetParameter( kParam_One ); Float64 difference; @@ -278,19 +273,11 @@ void Console5Buss::Console5BussKernel::Process( const Float32 *inSourceP, lastFXBuss *= (1.0 - (nearZero * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //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/Console5Buss/Console5Buss.h b/plugins/MacAU/Console5Buss/Console5Buss.h index 51cd70c..c7f1638 100755 --- a/plugins/MacAU/Console5Buss/Console5Buss.h +++ b/plugins/MacAU/Console5Buss/Console5Buss.h @@ -132,9 +132,7 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShapeA; - long double fpNShapeB; - bool fpFlip; + long double fpNShape; }; }; diff --git a/plugins/MacAU/Console5Buss/Console5Buss.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Console5Buss/Console5Buss.xcodeproj/christopherjohnson.pbxuser index 77bac7c..d93ee0d 100755 --- a/plugins/MacAU/Console5Buss/Console5Buss.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/Console5Buss/Console5Buss.xcodeproj/christopherjohnson.pbxuser @@ -49,55 +49,55 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 538690007; - PBXWorkspaceStateSaveDate = 538690007; + PBXPerProjectTemplateStateSaveDate = 569593643; + PBXWorkspaceStateSaveDate = 569593643; }; perUserProjectItems = { - 8B4E5566201BC09200B5DC2A /* PBXTextBookmark */ = 8B4E5566201BC09200B5DC2A /* PBXTextBookmark */; - 8B4E5591201BC43400B5DC2A /* PBXTextBookmark */ = 8B4E5591201BC43400B5DC2A /* PBXTextBookmark */; - 8B95A7D820006AC3007183A2 /* PBXTextBookmark */ = 8B95A7D820006AC3007183A2 /* PBXTextBookmark */; + 8B7929A221F34F6F006E9731 /* PBXTextBookmark */ = 8B7929A221F34F6F006E9731 /* PBXTextBookmark */; + 8B7929A321F34F6F006E9731 /* PBXTextBookmark */ = 8B7929A321F34F6F006E9731 /* PBXTextBookmark */; + 8B7929A821F34F7F006E9731 /* PBXTextBookmark */ = 8B7929A821F34F7F006E9731 /* PBXTextBookmark */; 8BBE44D71FE5EAC70022E6F7 /* PlistBookmark */ = 8BBE44D71FE5EAC70022E6F7 /* PlistBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; - 8B4E5566201BC09200B5DC2A /* PBXTextBookmark */ = { + 8B7929A221F34F6F006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BA05A660720730100365D66 /* Console5Buss.cpp */; name = "Console5Buss.cpp: 197"; rLen = 0; - rLoc = 8561; + rLoc = 8409; rType = 0; - vrLen = 0; - vrLoc = 0; + vrLen = 272; + vrLoc = 3; }; - 8B4E5591201BC43400B5DC2A /* PBXTextBookmark */ = { + 8B7929A321F34F6F006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; - fRef = 8BA05A660720730100365D66 /* Console5Buss.cpp */; - name = "Console5Buss.cpp: 197"; + fRef = 8BC6025B073B072D006C4272 /* Console5Buss.h */; + name = "Console5Buss.h: 128"; rLen = 0; - rLoc = 8561; + rLoc = 5111; rType = 0; - vrLen = 0; - vrLoc = 0; + vrLen = 149; + vrLoc = 5032; }; - 8B95A7D820006AC3007183A2 /* PBXTextBookmark */ = { + 8B7929A821F34F7F006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BC6025B073B072D006C4272 /* Console5Buss.h */; name = "Console5Buss.h: 128"; rLen = 0; rLoc = 5111; rType = 0; - vrLen = 63; - vrLoc = 5096; + vrLen = 149; + vrLoc = 5032; }; 8BA05A660720730100365D66 /* Console5Buss.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {346, 3991}}"; - sepNavSelRange = "{8561, 0}"; - sepNavVisRange = "{0, 0}"; - sepNavWindowFrame = "{{519, 39}, {895, 839}}"; + sepNavIntBoundsRect = "{{0, 0}, {848, 4043}}"; + sepNavSelRange = "{12118, 0}"; + sepNavVisRange = "{10187, 2019}"; + sepNavWindowFrame = "{{422, 39}, {895, 839}}"; }; }; 8BA05A690720730100365D66 /* Console5BussVersion.h */ = { @@ -122,9 +122,9 @@ }; 8BC6025B073B072D006C4272 /* Console5Buss.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {894, 1872}}"; - sepNavSelRange = "{2819, 272}"; - sepNavVisRange = "{1789, 1938}"; + sepNavIntBoundsRect = "{{0, 0}, {656, 2002}}"; + sepNavSelRange = "{5111, 0}"; + sepNavVisRange = "{5032, 149}"; sepNavWindowFrame = "{{545, 39}, {895, 839}}"; }; }; diff --git a/plugins/MacAU/Console5Buss/Console5Buss.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Console5Buss/Console5Buss.xcodeproj/christopherjohnson.perspectivev3 index 71675a6..9aef77c 100755 --- a/plugins/MacAU/Console5Buss/Console5Buss.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/Console5Buss/Console5Buss.xcodeproj/christopherjohnson.perspectivev3 @@ -225,8 +225,8 @@ <array/> <key>PerspectiveWidths</key> <array> - <integer>841</integer> - <integer>841</integer> + <integer>705</integer> + <integer>705</integer> </array> <key>Perspectives</key> <array> @@ -256,8 +256,6 @@ <key>Layout</key> <array> <dict> - <key>BecomeActive</key> - <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> @@ -325,7 +323,7 @@ <real>288</real> </array> <key>RubberWindowFrame</key> - <string>710 433 705 445 0 0 1440 878 </string> + <string>539 403 705 445 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -341,7 +339,7 @@ <key>PBXProjectModuleGUID</key> <string>8BD7274A1D46E5A5000176F0</string> <key>PBXProjectModuleLabel</key> - <string>Console5Buss.cpp</string> + <string>Console5Buss.h</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> @@ -349,16 +347,16 @@ <key>PBXProjectModuleGUID</key> <string>8BD7274B1D46E5A5000176F0</string> <key>PBXProjectModuleLabel</key> - <string>Console5Buss.cpp</string> + <string>Console5Buss.h</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B4E5591201BC43400B5DC2A</string> + <string>8B7929A821F34F7F006E9731</string> <key>history</key> <array> <string>8BBE44D71FE5EAC70022E6F7</string> - <string>8B95A7D820006AC3007183A2</string> - <string>8B4E5566201BC09200B5DC2A</string> + <string>8B7929A221F34F6F006E9731</string> + <string>8B7929A321F34F6F006E9731</string> </array> </dict> <key>SplitCount</key> @@ -372,18 +370,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {395, 0}}</string> + <string>{{0, 0}, {395, 120}}</string> <key>RubberWindowFrame</key> - <string>710 433 705 445 0 0 1440 878 </string> + <string>539 403 705 445 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>0pt</string> + <string>120pt</string> </dict> <dict> <key>Proportion</key> - <string>399pt</string> + <string>279pt</string> <key>Tabs</key> <array> <dict> @@ -397,9 +395,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {395, 372}}</string> - <key>RubberWindowFrame</key> - <string>710 433 705 445 0 0 1440 878 </string> + <string>{{10, 27}, {395, 252}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -453,7 +449,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 315}}</string> + <string>{{10, 27}, {395, 252}}</string> + <key>RubberWindowFrame</key> + <string>539 403 705 445 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -481,11 +479,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B4E5592201BC43400B5DC2A</string> + <string>8B7929A921F34F7F006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B4E5593201BC43400B5DC2A</string> + <string>8B7929AA21F34F7F006E9731</string> <string>8BD7274A1D46E5A5000176F0</string> - <string>8B4E5594201BC43400B5DC2A</string> + <string>8B7929AB21F34F7F006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -658,7 +656,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>538690612.183846</real> + <real>569593727.64458299</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -678,7 +676,7 @@ <string>/Users/christopherjohnson/Desktop/MacAU/Console5Buss/Console5Buss.xcodeproj</string> </array> <key>WindowString</key> - <string>710 433 705 445 0 0 1440 878 </string> + <string>539 403 705 445 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |