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/CrunchyGrooveWear | |
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/CrunchyGrooveWear')
4 files changed, 60 insertions, 66 deletions
diff --git a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp index 847c101..be4cd10 100755 --- a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp +++ b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp @@ -177,9 +177,7 @@ void CrunchyGrooveWear::CrunchyGrooveWearKernel::Reset() bMidPrev = 0.0; cMidPrev = 0.0; dMidPrev = 0.0; - fpNShapeA = 0.0; - fpNShapeB = 0.0; - fpFlip = true; + fpNShape = 0.0; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -193,11 +191,7 @@ void CrunchyGrooveWear::CrunchyGrooveWearKernel::Process( const Float32 *inSou { 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; - + Float32 *destP = inDestP; Float64 overallscale = (pow(GetParameter( kParam_One ),2)*19.0)+1.0; Float64 gain = overallscale; //mid groove wear @@ -450,19 +444,11 @@ void CrunchyGrooveWear::CrunchyGrooveWearKernel::Process( const Float32 *inSou inputSample = (inputSample * dWet) + (drySample * dDry); } - //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/CrunchyGrooveWear/CrunchyGrooveWear.h b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.h index a1d9fc8..07db5c7 100755 --- a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.h +++ b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.h @@ -138,9 +138,7 @@ public: Float64 cMidPrev; Float64 dMidPrev; - long double fpNShapeA; - long double fpNShapeB; - bool fpFlip; + long double fpNShape; }; }; diff --git a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.xcodeproj/christopherjohnson.pbxuser index 3479d30..af3720e 100755 --- a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.xcodeproj/christopherjohnson.pbxuser @@ -49,13 +49,14 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 541894646; - PBXWorkspaceStateSaveDate = 541894646; + PBXPerProjectTemplateStateSaveDate = 569595525; + PBXWorkspaceStateSaveDate = 569595525; }; perUserProjectItems = { 8B181BD6204CA7CC00516BEE /* PlistBookmark */ = 8B181BD6204CA7CC00516BEE /* PlistBookmark */; - 8B181BD8204CA7CC00516BEE /* PBXTextBookmark */ = 8B181BD8204CA7CC00516BEE /* PBXTextBookmark */; - 8B1A6DF8204CA7FC009DEEA1 /* PBXTextBookmark */ = 8B1A6DF8204CA7FC009DEEA1 /* PBXTextBookmark */; + 8B7929E621F356D5006E9731 /* PBXTextBookmark */ = 8B7929E621F356D5006E9731 /* PBXTextBookmark */; + 8B7929EB21F356E6006E9731 /* PBXTextBookmark */ = 8B7929EB21F356E6006E9731 /* PBXTextBookmark */; + 8B9D5E35207AB7DF00C332E2 /* PBXTextBookmark */ = 8B9D5E35207AB7DF00C332E2 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { @@ -73,32 +74,42 @@ rLen = 0; rLoc = 9223372036854775808; }; - 8B181BD8204CA7CC00516BEE /* PBXTextBookmark */ = { + 8B7929E621F356D5006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; - fRef = 8BC6025B073B072D006C4272 /* CrunchyGrooveWear.h */; - name = "CrunchyGrooveWear.h: 56"; - rLen = 0; - rLoc = 2856; + fRef = 8BA05A660720730100365D66 /* CrunchyGrooveWear.cpp */; + name = "CrunchyGrooveWear.cpp: 349"; + rLen = 875; + rLoc = 16513; rType = 0; - vrLen = 229; - vrLoc = 2728; + vrLen = 316; + vrLoc = 19570; }; - 8B1A6DF8204CA7FC009DEEA1 /* PBXTextBookmark */ = { + 8B7929EB21F356E6006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* CrunchyGrooveWear.cpp */; + name = "CrunchyGrooveWear.cpp: 349"; + rLen = 875; + rLoc = 16513; + rType = 0; + vrLen = 316; + vrLoc = 19570; + }; + 8B9D5E35207AB7DF00C332E2 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BC6025B073B072D006C4272 /* CrunchyGrooveWear.h */; name = "CrunchyGrooveWear.h: 56"; rLen = 0; rLoc = 2856; rType = 0; - vrLen = 228; - vrLoc = 2729; + vrLen = 178; + vrLoc = 2730; }; 8BA05A660720730100365D66 /* CrunchyGrooveWear.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {769, 6084}}"; - sepNavSelRange = "{12165, 581}"; - sepNavVisRange = "{11798, 2704}"; - sepNavWindowFrame = "{{528, 46}, {816, 832}}"; + sepNavIntBoundsRect = "{{0, 0}, {677, 6058}}"; + sepNavSelRange = "{16513, 875}"; + sepNavVisRange = "{19570, 316}"; + sepNavWindowFrame = "{{500, 44}, {816, 832}}"; }; }; 8BA05A670720730100365D66 /* CrunchyGrooveWear.exp */ = { @@ -119,10 +130,10 @@ }; 8BC6025B073B072D006C4272 /* CrunchyGrooveWear.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {803, 1963}}"; - sepNavSelRange = "{2856, 0}"; - sepNavVisRange = "{2729, 228}"; - sepNavWindowFrame = "{{15, 41}, {816, 832}}"; + sepNavIntBoundsRect = "{{0, 0}, {894, 1898}}"; + sepNavSelRange = "{5501, 0}"; + sepNavVisRange = "{4045, 1558}"; + sepNavWindowFrame = "{{451, 39}, {816, 832}}"; }; }; 8BD3CCB8148830B20062E48C /* Source Control */ = { diff --git a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.xcodeproj/christopherjohnson.perspectivev3 index 5152037..e829e94 100755 --- a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.xcodeproj/christopherjohnson.perspectivev3 @@ -256,8 +256,6 @@ <key>Layout</key> <array> <dict> - <key>BecomeActive</key> - <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> @@ -326,7 +324,7 @@ <real>288</real> </array> <key>RubberWindowFrame</key> - <string>476 182 841 654 0 0 1440 878 </string> + <string>398 187 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -342,7 +340,7 @@ <key>PBXProjectModuleGUID</key> <string>8BD7274A1D46E5A5000176F0</string> <key>PBXProjectModuleLabel</key> - <string>CrunchyGrooveWear.h</string> + <string>CrunchyGrooveWear.cpp</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> @@ -350,15 +348,16 @@ <key>PBXProjectModuleGUID</key> <string>8BD7274B1D46E5A5000176F0</string> <key>PBXProjectModuleLabel</key> - <string>CrunchyGrooveWear.h</string> + <string>CrunchyGrooveWear.cpp</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B1A6DF8204CA7FC009DEEA1</string> + <string>8B7929EB21F356E6006E9731</string> <key>history</key> <array> <string>8B181BD6204CA7CC00516BEE</string> - <string>8B181BD8204CA7CC00516BEE</string> + <string>8B9D5E35207AB7DF00C332E2</string> + <string>8B7929E621F356D5006E9731</string> </array> </dict> <key>SplitCount</key> @@ -372,18 +371,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {531, 158}}</string> + <string>{{0, 0}, {531, 109}}</string> <key>RubberWindowFrame</key> - <string>476 182 841 654 0 0 1440 878 </string> + <string>398 187 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>158pt</string> + <string>109pt</string> </dict> <dict> <key>Proportion</key> - <string>450pt</string> + <string>499pt</string> <key>Tabs</key> <array> <dict> @@ -397,9 +396,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 423}}</string> - <key>RubberWindowFrame</key> - <string>476 182 841 654 0 0 1440 878 </string> + <string>{{10, 27}, {531, 472}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -453,7 +450,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 365}}</string> + <string>{{10, 27}, {531, 472}}</string> + <key>RubberWindowFrame</key> + <string>398 187 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -481,11 +480,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B1A6DF5204CA7FC009DEEA1</string> + <string>8B7929EC21F356E6006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B1A6DF6204CA7FC009DEEA1</string> + <string>8B7929ED21F356E6006E9731</string> <string>8BD7274A1D46E5A5000176F0</string> - <string>8B1A6DF7204CA7FC009DEEA1</string> + <string>8B7929EE21F356E6006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -658,7 +657,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>541894652.77613103</real> + <real>569595622.14955699</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -678,7 +677,7 @@ <string>/Users/christopherjohnson/Desktop/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.xcodeproj</string> </array> <key>WindowString</key> - <string>476 182 841 654 0 0 1440 878 </string> + <string>398 187 841 654 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |