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/Swell | |
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/Swell')
-rwxr-xr-x | plugins/MacAU/Swell/Swell.cpp | 28 | ||||
-rwxr-xr-x | plugins/MacAU/Swell/Swell.h | 5 | ||||
-rwxr-xr-x | plugins/MacAU/Swell/Swell.xcodeproj/christopherjohnson.pbxuser | 67 | ||||
-rwxr-xr-x | plugins/MacAU/Swell/Swell.xcodeproj/christopherjohnson.perspectivev3 | 51 |
4 files changed, 74 insertions, 77 deletions
diff --git a/plugins/MacAU/Swell/Swell.cpp b/plugins/MacAU/Swell/Swell.cpp index 821b33d..09dec89 100755 --- a/plugins/MacAU/Swell/Swell.cpp +++ b/plugins/MacAU/Swell/Swell.cpp @@ -176,10 +176,7 @@ void Swell::SwellKernel::Reset() { swell = 0.0; louder = false; - - fpNShapeA = 0.0; - fpNShapeB = 0.0; - fpFlip = true; + fpNShape = 0.0; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -197,10 +194,6 @@ void Swell::SwellKernel::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 thresholdOn = pow(GetParameter( kParam_One ),2) * GetParameter( kParam_Two ); Float64 speedOn = (pow(GetParameter( kParam_Two ),2)*0.001)/overallscale; Float64 thresholdOff = thresholdOn * GetParameter( kParam_Two ); @@ -252,20 +245,11 @@ void Swell::SwellKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - - //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/Swell/Swell.h b/plugins/MacAU/Swell/Swell.h index 31aa5a8..fa35436 100755 --- a/plugins/MacAU/Swell/Swell.h +++ b/plugins/MacAU/Swell/Swell.h @@ -134,10 +134,7 @@ public: long double swell; bool louder; - - long double fpNShapeA; - long double fpNShapeB; - bool fpFlip; + long double fpNShape; }; }; diff --git a/plugins/MacAU/Swell/Swell.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Swell/Swell.xcodeproj/christopherjohnson.pbxuser index 3af313e..ac01270 100755 --- a/plugins/MacAU/Swell/Swell.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/Swell/Swell.xcodeproj/christopherjohnson.pbxuser @@ -10,7 +10,7 @@ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, - 292, + 398, 20, 48, 43, @@ -49,24 +49,55 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 532491016; - PBXWorkspaceStateSaveDate = 532491016; + PBXPerProjectTemplateStateSaveDate = 569683044; + PBXWorkspaceStateSaveDate = 569683044; }; perUserProjectItems = { + 8B79311521F4ACEB006E9731 /* PBXTextBookmark */ = 8B79311521F4ACEB006E9731 /* PBXTextBookmark */; + 8B79311721F4ACEB006E9731 /* PBXTextBookmark */ = 8B79311721F4ACEB006E9731 /* PBXTextBookmark */; + 8B79311C21F4AD21006E9731 /* PBXTextBookmark */ = 8B79311C21F4AD21006E9731 /* PBXTextBookmark */; 8BB5DDF41FBD106E008B4570 /* PlistBookmark */ = 8BB5DDF41FBD106E008B4570 /* PlistBookmark */; 8BCC7CCD1FBD2D3C00982BD6 /* PBXTextBookmark */ = 8BCC7CCD1FBD2D3C00982BD6 /* PBXTextBookmark */; - 8BCC7CCE1FBD2D3C00982BD6 /* PBXBookmark */ = 8BCC7CCE1FBD2D3C00982BD6 /* PBXBookmark */; - 8BCC7CD31FBD2E6800982BD6 /* PBXTextBookmark */ = 8BCC7CD31FBD2E6800982BD6 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; + 8B79311521F4ACEB006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BC6025B073B072D006C4272 /* Swell.h */; + name = "Swell.h: 137"; + rLen = 0; + rLoc = 5329; + rType = 0; + vrLen = 700; + vrLoc = 4739; + }; + 8B79311721F4ACEB006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* Swell.cpp */; + name = "Swell.cpp: 247"; + rLen = 0; + rLoc = 11121; + rType = 0; + vrLen = 871; + vrLoc = 10589; + }; + 8B79311C21F4AD21006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* Swell.cpp */; + name = "Swell.cpp: 247"; + rLen = 0; + rLoc = 11121; + rType = 0; + vrLen = 957; + vrLoc = 10503; + }; 8BA05A660720730100365D66 /* Swell.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {848, 3809}}"; - sepNavSelRange = "{11320, 0}"; - sepNavVisRange = "{9895, 1840}"; + sepNavIntBoundsRect = "{{0, 0}, {691, 3484}}"; + sepNavSelRange = "{11121, 0}"; + sepNavVisRange = "{10503, 957}"; sepNavWindowFrame = "{{545, 39}, {895, 839}}"; }; }; @@ -92,9 +123,9 @@ }; 8BC6025B073B072D006C4272 /* Swell.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {824, 1755}}"; - sepNavSelRange = "{2846, 0}"; - sepNavVisRange = "{2642, 366}"; + sepNavIntBoundsRect = "{{0, 0}, {894, 2275}}"; + sepNavSelRange = "{5329, 0}"; + sepNavVisRange = "{4739, 700}"; sepNavWindowFrame = "{{678, 39}, {895, 839}}"; }; }; @@ -108,20 +139,6 @@ vrLen = 336; vrLoc = 2594; }; - 8BCC7CCE1FBD2D3C00982BD6 /* PBXBookmark */ = { - isa = PBXBookmark; - fRef = 8BC6025B073B072D006C4272 /* Swell.h */; - }; - 8BCC7CD31FBD2E6800982BD6 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BC6025B073B072D006C4272 /* Swell.h */; - name = "Swell.h: 57"; - rLen = 0; - rLoc = 2846; - rType = 0; - vrLen = 366; - vrLoc = 2642; - }; 8BD3CCB8148830B20062E48C /* Source Control */ = { isa = PBXSourceControlManager; fallbackIsa = XCSourceControlManager; diff --git a/plugins/MacAU/Swell/Swell.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Swell/Swell.xcodeproj/christopherjohnson.perspectivev3 index cf784ae..5de7e2f 100755 --- a/plugins/MacAU/Swell/Swell.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/Swell/Swell.xcodeproj/christopherjohnson.perspectivev3 @@ -256,8 +256,6 @@ <key>Layout</key> <array> <dict> - <key>BecomeActive</key> - <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> @@ -282,7 +280,7 @@ <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> - <real>288</real> + <real>182</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> @@ -308,7 +306,7 @@ </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> - <string>{{0, 0}, {288, 595}}</string> + <string>{{0, 0}, {182, 595}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> @@ -318,19 +316,19 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {305, 613}}</string> + <string>{{0, 0}, {199, 613}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> - <real>288</real> + <real>182</real> </array> <key>RubberWindowFrame</key> - <string>580 200 841 654 0 0 1440 878 </string> + <string>450 207 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> - <string>305pt</string> + <string>199pt</string> </dict> <dict> <key>Dock</key> @@ -341,7 +339,7 @@ <key>PBXProjectModuleGUID</key> <string>8BD7274A1D46E5A5000176F0</string> <key>PBXProjectModuleLabel</key> - <string>Swell.h</string> + <string>Swell.cpp</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> @@ -349,16 +347,17 @@ <key>PBXProjectModuleGUID</key> <string>8BD7274B1D46E5A5000176F0</string> <key>PBXProjectModuleLabel</key> - <string>Swell.h</string> + <string>Swell.cpp</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8BCC7CD31FBD2E6800982BD6</string> + <string>8B79311C21F4AD21006E9731</string> <key>history</key> <array> <string>8BB5DDF41FBD106E008B4570</string> <string>8BCC7CCD1FBD2D3C00982BD6</string> - <string>8BCC7CCE1FBD2D3C00982BD6</string> + <string>8B79311521F4ACEB006E9731</string> + <string>8B79311721F4ACEB006E9731</string> </array> </dict> <key>SplitCount</key> @@ -372,18 +371,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {531, 254}}</string> + <string>{{0, 0}, {637, 421}}</string> <key>RubberWindowFrame</key> - <string>580 200 841 654 0 0 1440 878 </string> + <string>450 207 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>254pt</string> + <string>421pt</string> </dict> <dict> <key>Proportion</key> - <string>354pt</string> + <string>187pt</string> <key>Tabs</key> <array> <dict> @@ -397,9 +396,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 327}}</string> - <key>RubberWindowFrame</key> - <string>580 200 841 654 0 0 1440 878 </string> + <string>{{10, 27}, {637, 160}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -453,7 +450,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 315}}</string> + <string>{{10, 27}, {637, 160}}</string> + <key>RubberWindowFrame</key> + <string>450 207 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -462,7 +461,7 @@ </dict> </array> <key>Proportion</key> - <string>531pt</string> + <string>637pt</string> </dict> </array> <key>Name</key> @@ -481,11 +480,11 @@ </array> <key>TableOfContents</key> <array> - <string>8BCC7CA61FBD2B1F00982BD6</string> + <string>8B79311D21F4AD21006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8BCC7CA71FBD2B1F00982BD6</string> + <string>8B79311E21F4AD21006E9731</string> <string>8BD7274A1D46E5A5000176F0</string> - <string>8BCC7CA81FBD2B1F00982BD6</string> + <string>8B79311F21F4AD21006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -658,7 +657,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>532491880.84511602</real> + <real>569683233.59178197</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -678,7 +677,7 @@ <string>/Users/christopherjohnson/Desktop/MacAU/Swell/Swell.xcodeproj</string> </array> <key>WindowString</key> - <string>580 200 841 654 0 0 1440 878 </string> + <string>450 207 841 654 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |