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/PhaseNudge | |
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/PhaseNudge')
5 files changed, 41 insertions, 50 deletions
diff --git a/plugins/MacAU/PhaseNudge/PhaseNudge.cpp b/plugins/MacAU/PhaseNudge/PhaseNudge.cpp index a60dc04..abb05e1 100755 --- a/plugins/MacAU/PhaseNudge/PhaseNudge.cpp +++ b/plugins/MacAU/PhaseNudge/PhaseNudge.cpp @@ -168,9 +168,7 @@ void PhaseNudge::PhaseNudgeKernel::Reset() { for(int count = 0; count < 1502; count++) {d[count] = 0.0;} one = 1; maxdelay = 9001; - fpNShapeA = 0.0; - fpNShapeB = 0.0; - fpFlip = true; + fpNShape = 0.0; //coded to snap directly to the value on instantiation if the disparity is great enough } @@ -186,9 +184,6 @@ void PhaseNudge::PhaseNudgeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - Float32 fpTemp; - Float64 fpOld = 0.618033988749894848204586; //golden ratio! - Float64 fpNew = 1.0 - fpOld; int allpasstemp; Float64 outallpass = 0.618033988749894848204586; //golden ratio! @@ -256,24 +251,13 @@ void PhaseNudge::PhaseNudgeKernel::Process( const Float32 *inSourceP, if (inputSample > 0) inputSample -= bridgerectifier; else inputSample += bridgerectifier; inputSample *= 4.0; - - if (wet < 1.0) inputSample = (drySample * dry)+(inputSample * wet); - //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/PhaseNudge/PhaseNudge.exp b/plugins/MacAU/PhaseNudge/PhaseNudge.exp index 6c86d46..a53e4f6 100755 --- a/plugins/MacAU/PhaseNudge/PhaseNudge.exp +++ b/plugins/MacAU/PhaseNudge/PhaseNudge.exp @@ -1 +1 @@ -_PhaseNudgeEntry
\ No newline at end of file +_PhaseNudgeEntry diff --git a/plugins/MacAU/PhaseNudge/PhaseNudge.h b/plugins/MacAU/PhaseNudge/PhaseNudge.h index a82a450..fa655e8 100755 --- a/plugins/MacAU/PhaseNudge/PhaseNudge.h +++ b/plugins/MacAU/PhaseNudge/PhaseNudge.h @@ -130,9 +130,7 @@ public: private: Float64 d[1503]; int one, maxdelay; - Float64 fpNShapeA; - Float64 fpNShapeB; - bool fpFlip; + long double fpNShape; }; }; diff --git a/plugins/MacAU/PhaseNudge/PhaseNudge.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/PhaseNudge/PhaseNudge.xcodeproj/christopherjohnson.pbxuser index 31eaa35..90714a5 100755 --- a/plugins/MacAU/PhaseNudge/PhaseNudge.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/PhaseNudge/PhaseNudge.xcodeproj/christopherjohnson.pbxuser @@ -49,8 +49,8 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 528457445; - PBXWorkspaceStateSaveDate = 528457445; + PBXPerProjectTemplateStateSaveDate = 569674908; + PBXWorkspaceStateSaveDate = 569674908; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { @@ -58,10 +58,18 @@ }; 8BA05A660720730100365D66 /* PhaseNudge.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {787, 3731}}"; - sepNavSelRange = "{9350, 0}"; - sepNavVisRange = "{9041, 2185}"; - sepNavWindowFrame = "{{594, 72}, {834, 801}}"; + sepNavIntBoundsRect = "{{0, 0}, {787, 3562}}"; + sepNavSelRange = "{8646, 0}"; + sepNavVisRange = "{7424, 2420}"; + sepNavWindowFrame = "{{467, 77}, {834, 801}}"; + }; + }; + 8BA05A670720730100365D66 /* PhaseNudge.exp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1253, 694}}"; + sepNavSelRange = "{17, 0}"; + sepNavVisRange = "{0, 17}"; + sepNavWindowFrame = "{{15, 51}, {1300, 822}}"; }; }; 8BA05A690720730100365D66 /* PhaseNudgeVersion.h */ = { @@ -74,10 +82,10 @@ }; 8BC6025B073B072D006C4272 /* PhaseNudge.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {824, 1794}}"; - sepNavSelRange = "{5126, 97}"; - sepNavVisRange = "{2715, 1561}"; - sepNavWindowFrame = "{{653, 65}, {787, 813}}"; + sepNavIntBoundsRect = "{{0, 0}, {824, 1768}}"; + sepNavSelRange = "{5179, 0}"; + sepNavVisRange = "{3774, 1525}"; + sepNavWindowFrame = "{{436, 61}, {787, 813}}"; }; }; 8BD3CCB8148830B20062E48C /* Source Control */ = { diff --git a/plugins/MacAU/PhaseNudge/PhaseNudge.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/PhaseNudge/PhaseNudge.xcodeproj/christopherjohnson.perspectivev3 index 72f64ac..14864b4 100755 --- a/plugins/MacAU/PhaseNudge/PhaseNudge.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/PhaseNudge/PhaseNudge.xcodeproj/christopherjohnson.perspectivev3 @@ -225,8 +225,8 @@ <array/> <key>PerspectiveWidths</key> <array> - <integer>-1</integer> - <integer>-1</integer> + <integer>810</integer> + <integer>810</integer> </array> <key>Perspectives</key> <array> @@ -300,7 +300,7 @@ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> - <integer>4</integer> + <integer>5</integer> <integer>2</integer> <integer>1</integer> <integer>0</integer> @@ -324,7 +324,7 @@ <real>185</real> </array> <key>RubberWindowFrame</key> - <string>614 298 810 487 0 0 1440 878 </string> + <string>500 313 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -363,7 +363,7 @@ <key>Frame</key> <string>{{0, 0}, {603, 0}}</string> <key>RubberWindowFrame</key> - <string>614 298 810 487 0 0 1440 878 </string> + <string>500 313 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> @@ -387,8 +387,6 @@ <dict> <key>Frame</key> <string>{{10, 27}, {603, 414}}</string> - <key>RubberWindowFrame</key> - <string>614 298 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -442,7 +440,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 31}, {603, 297}}</string> + <string>{{10, 27}, {603, 414}}</string> + <key>RubberWindowFrame</key> + <string>500 313 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -470,11 +470,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B9D75591F7F9F0E007AB60F</string> + <string>8B792EBE21F48D58006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B9D755A1F7F9F0E007AB60F</string> + <string>8B792EBF21F48D58006E9731</string> <string>8B45D5A31DB6A0F4001A01DF</string> - <string>8B9D755B1F7F9F0E007AB60F</string> + <string>8B792EC021F48D58006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -627,7 +627,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>528457486.34265399</real> + <real>569675096.38173199</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -644,11 +644,12 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8B9D755C1F7F9F0E007AB60F</string> + <string>8B792EC121F48D58006E9731</string> + <string>8B792EC221F48D58006E9731</string> <string>/Users/christopherjohnson/Desktop/MacAU/PhaseNudge/PhaseNudge.xcodeproj</string> </array> <key>WindowString</key> - <string>614 298 810 487 0 0 1440 878 </string> + <string>500 313 810 487 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |