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/Aura | |
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/Aura')
-rwxr-xr-x | plugins/MacAU/Aura/Aura.cpp | 27 | ||||
-rwxr-xr-x | plugins/MacAU/Aura/Aura.h | 4 | ||||
-rwxr-xr-x | plugins/MacAU/Aura/Aura.xcodeproj/christopherjohnson.pbxuser | 65 | ||||
-rwxr-xr-x | plugins/MacAU/Aura/Aura.xcodeproj/christopherjohnson.perspectivev3 | 36 |
4 files changed, 57 insertions, 75 deletions
diff --git a/plugins/MacAU/Aura/Aura.cpp b/plugins/MacAU/Aura/Aura.cpp index 93e1411..48fd283 100755 --- a/plugins/MacAU/Aura/Aura.cpp +++ b/plugins/MacAU/Aura/Aura.cpp @@ -169,9 +169,7 @@ void Aura::AuraKernel::Reset() for(int count = 0; count < 21; count++) {b[count] = 0.0; f[count] = 0.0;} lastSample = 0.0; previousVelocity = 0.0; - fpNShapeA = 0.0; - fpNShapeB = 0.0; - fpFlip = true; + fpNShape = 0.0; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -186,11 +184,6 @@ void Aura::AuraKernel::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; - Float64 correction; Float64 accumulatorSample; Float64 velocity; @@ -321,19 +314,11 @@ void Aura::AuraKernel::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/Aura/Aura.h b/plugins/MacAU/Aura/Aura.h index 504b1fd..56ef492 100755 --- a/plugins/MacAU/Aura/Aura.h +++ b/plugins/MacAU/Aura/Aura.h @@ -131,9 +131,7 @@ public: Float64 previousVelocity; Float64 b[21]; Float64 f[21]; - long double fpNShapeA; - long double fpNShapeB; - bool fpFlip; + long double fpNShape; }; }; diff --git a/plugins/MacAU/Aura/Aura.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Aura/Aura.xcodeproj/christopherjohnson.pbxuser index 8daaddf..16877c1 100755 --- a/plugins/MacAU/Aura/Aura.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/Aura/Aura.xcodeproj/christopherjohnson.pbxuser @@ -49,24 +49,44 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 546126137; - PBXWorkspaceStateSaveDate = 546126137; + PBXPerProjectTemplateStateSaveDate = 569589029; + PBXWorkspaceStateSaveDate = 569589029; }; perUserProjectItems = { + 8B7927C921F33D8C006E9731 /* PBXTextBookmark */ = 8B7927C921F33D8C006E9731 /* PBXTextBookmark */; + 8B7927CE21F33D9D006E9731 /* PBXTextBookmark */ = 8B7927CE21F33D9D006E9731 /* PBXTextBookmark */; 8BC5CC27208D3AE60058B257 /* PBXTextBookmark */ = 8BC5CC27208D3AE60058B257 /* PBXTextBookmark */; - 8BC5CCC3208D4FDB0058B257 /* XCBuildMessageTextBookmark */ = 8BC5CCC3208D4FDB0058B257 /* XCBuildMessageTextBookmark */; - 8BC5CEBB208D734C0058B257 /* PBXTextBookmark */ = 8BC5CEBB208D734C0058B257 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; + 8B7927C921F33D8C006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* Aura.cpp */; + name = "Aura.cpp: 196"; + rLen = 0; + rLoc = 8658; + rType = 0; + vrLen = 0; + vrLoc = 0; + }; + 8B7927CE21F33D9D006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* Aura.cpp */; + name = "Aura.cpp: 196"; + rLen = 0; + rLoc = 8658; + rType = 0; + vrLen = 0; + vrLoc = 0; + }; 8BA05A660720730100365D66 /* Aura.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {558, 4589}}"; - sepNavSelRange = "{8813, 0}"; - sepNavVisRange = "{8966, 228}"; - sepNavWindowFrame = "{{379, 63}, {932, 815}}"; + sepNavIntBoundsRect = "{{0, 0}, {554, 4446}}"; + sepNavSelRange = "{8658, 0}"; + sepNavVisRange = "{0, 0}"; + sepNavWindowFrame = "{{5, 63}, {932, 815}}"; }; }; 8BA05A670720730100365D66 /* Aura.exp */ = { @@ -89,37 +109,18 @@ isa = PBXTextBookmark; fRef = 8BC6025B073B072D006C4272 /* Aura.h */; name = "Aura.h: 135"; - rLen = 65; + rLen = 24; rLoc = 5201; rType = 0; vrLen = 65; vrLoc = 5232; }; - 8BC5CCC3208D4FDB0058B257 /* XCBuildMessageTextBookmark */ = { - isa = PBXTextBookmark; - comments = "Unused variable 'wet'"; - fRef = 8BA05A660720730100365D66 /* Aura.cpp */; - fallbackIsa = XCBuildMessageTextBookmark; - rLen = 0; - rLoc = 202; - rType = 1; - }; - 8BC5CEBB208D734C0058B257 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BA05A660720730100365D66 /* Aura.cpp */; - name = "Aura.cpp: 203"; - rLen = 0; - rLoc = 8813; - rType = 0; - vrLen = 228; - vrLoc = 8966; - }; 8BC6025B073B072D006C4272 /* Aura.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {894, 1859}}"; - sepNavSelRange = "{5111, 0}"; - sepNavVisRange = "{3864, 1511}"; - sepNavWindowFrame = "{{504, 63}, {932, 815}}"; + sepNavIntBoundsRect = "{{0, 0}, {894, 1794}}"; + sepNavSelRange = "{5226, 0}"; + sepNavVisRange = "{3752, 1576}"; + sepNavWindowFrame = "{{340, 63}, {932, 815}}"; }; }; 8BD3CCB8148830B20062E48C /* Source Control */ = { diff --git a/plugins/MacAU/Aura/Aura.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Aura/Aura.xcodeproj/christopherjohnson.perspectivev3 index ab104e0..55525f3 100755 --- a/plugins/MacAU/Aura/Aura.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/Aura/Aura.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> @@ -256,8 +256,6 @@ <key>Layout</key> <array> <dict> - <key>BecomeActive</key> - <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> @@ -324,7 +322,7 @@ <real>185</real> </array> <key>RubberWindowFrame</key> - <string>623 315 810 487 0 0 1440 878 </string> + <string>0 312 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -352,11 +350,11 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8BC5CEBB208D734C0058B257</string> + <string>8B7927CE21F33D9D006E9731</string> <key>history</key> <array> <string>8BC5CC27208D3AE60058B257</string> - <string>8BC5CCC3208D4FDB0058B257</string> + <string>8B7927C921F33D8C006E9731</string> </array> </dict> <key>SplitCount</key> @@ -370,18 +368,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {603, 69}}</string> + <string>{{0, 0}, {603, 13}}</string> <key>RubberWindowFrame</key> - <string>623 315 810 487 0 0 1440 878 </string> + <string>0 312 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>69pt</string> + <string>13pt</string> </dict> <dict> <key>Proportion</key> - <string>372pt</string> + <string>428pt</string> <key>Tabs</key> <array> <dict> @@ -395,7 +393,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 345}}</string> + <string>{{10, 27}, {603, 401}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -449,9 +447,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 345}}</string> + <string>{{10, 27}, {603, 401}}</string> <key>RubberWindowFrame</key> - <string>623 315 810 487 0 0 1440 878 </string> + <string>0 312 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -479,11 +477,11 @@ </array> <key>TableOfContents</key> <array> - <string>8BC5CC15208D39550058B257</string> + <string>8B7927CF21F33D9D006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8BC5CC16208D39550058B257</string> + <string>8B7927D021F33D9D006E9731</string> <string>8B0C0F5D201157B700BC8782</string> - <string>8BC5CC17208D39550058B257</string> + <string>8B7927D121F33D9D006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -636,7 +634,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>546141004.69631898</real> + <real>569589149.88835204</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -656,7 +654,7 @@ <string>/Users/christopherjohnson/Desktop/MacAU/Aura/Aura.xcodeproj</string> </array> <key>WindowString</key> - <string>623 315 810 487 0 0 1440 878 </string> + <string>0 312 810 487 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |