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/TubeDesk | |
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/TubeDesk')
4 files changed, 60 insertions, 79 deletions
diff --git a/plugins/MacAU/TubeDesk/TubeDesk.cpp b/plugins/MacAU/TubeDesk/TubeDesk.cpp index 4b730c4..cf2c042 100755 --- a/plugins/MacAU/TubeDesk/TubeDesk.cpp +++ b/plugins/MacAU/TubeDesk/TubeDesk.cpp @@ -157,9 +157,7 @@ void TubeDesk::TubeDeskKernel::Reset() lastSample = 0.0; lastOutSample = 0.0; lastSlew = 0.0; - fpNShapeA = 0.0; - fpNShapeB = 0.0; - fpFlip = true; + fpNShape = 0.0; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -200,9 +198,6 @@ void TubeDesk::TubeDeskKernel::Process( const Float32 *inSourceP, Float64 combSample; long double inputSample; long double drySample; - Float32 fpTemp; - Float64 fpOld = 0.618033988749894848204586; //golden ratio! - Float64 fpNew = 1.0 - fpOld; while (nSampleFrames-- > 0) { inputSample = *sourceP; @@ -295,20 +290,11 @@ void TubeDesk::TubeDeskKernel::Process( const Float32 *inSourceP, inputSample /= gain; //end of Desk section - //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; sourceP += inNumChannels; diff --git a/plugins/MacAU/TubeDesk/TubeDesk.h b/plugins/MacAU/TubeDesk/TubeDesk.h index 93110b5..393c14b 100755 --- a/plugins/MacAU/TubeDesk/TubeDesk.h +++ b/plugins/MacAU/TubeDesk/TubeDesk.h @@ -124,9 +124,7 @@ public: long double lastSample; long double lastOutSample; Float64 lastSlew; - Float64 fpNShapeA; - Float64 fpNShapeB; - bool fpFlip; + Float64 fpNShape; }; }; diff --git a/plugins/MacAU/TubeDesk/TubeDesk.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/TubeDesk/TubeDesk.xcodeproj/christopherjohnson.pbxuser index 6c8870e..5884fa0 100755 --- a/plugins/MacAU/TubeDesk/TubeDesk.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/TubeDesk/TubeDesk.xcodeproj/christopherjohnson.pbxuser @@ -10,7 +10,7 @@ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, - 364, + 474, 20, 48, 43, @@ -49,43 +49,53 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 528458816; - PBXWorkspaceStateSaveDate = 528458816; + PBXPerProjectTemplateStateSaveDate = 569686163; + PBXWorkspaceStateSaveDate = 569686163; }; perUserProjectItems = { - 8B9D68401F7C91F2007AB60F /* PBXTextBookmark */ = 8B9D68401F7C91F2007AB60F /* PBXTextBookmark */; - 8B9D770A1F7FA48A007AB60F /* PBXTextBookmark */ = 8B9D770A1F7FA48A007AB60F /* PBXTextBookmark */; - 8BD8CB131DF8EDB000CC3427 /* PBXTextBookmark */ = 8BD8CB131DF8EDB000CC3427 /* PBXTextBookmark */; + 8B79320521F4B8E5006E9731 /* PBXTextBookmark */ = 8B79320521F4B8E5006E9731 /* PBXTextBookmark */; + 8B79320721F4B8E5006E9731 /* PBXTextBookmark */ = 8B79320721F4B8E5006E9731 /* PBXTextBookmark */; + 8B79320C21F4B8F7006E9731 /* PBXTextBookmark */ = 8B79320C21F4B8F7006E9731 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; - 8B9D68401F7C91F2007AB60F /* PBXTextBookmark */ = { + 8B79320521F4B8E5006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BC6025B073B072D006C4272 /* TubeDesk.h */; + name = "TubeDesk.h: 121"; + rLen = 127; + rLoc = 4740; + rType = 0; + vrLen = 159; + vrLoc = 4728; + }; + 8B79320721F4B8E5006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BA05A660720730100365D66 /* TubeDesk.cpp */; - name = "TubeDesk.cpp: 1"; + name = "TubeDesk.cpp: 297"; rLen = 0; - rLoc = 0; + rLoc = 12119; rType = 0; - vrLen = 0; - vrLoc = 0; + vrLen = 1239; + vrLoc = 10970; }; - 8B9D770A1F7FA48A007AB60F /* PBXTextBookmark */ = { + 8B79320C21F4B8F7006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BA05A660720730100365D66 /* TubeDesk.cpp */; - name = "TubeDesk.cpp: 1"; + name = "TubeDesk.cpp: 297"; rLen = 0; - rLoc = 0; + rLoc = 12119; rType = 0; - vrLen = 0; - vrLoc = 0; + vrLen = 1298; + vrLoc = 10911; }; 8BA05A660720730100365D66 /* TubeDesk.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {554, 4186}}"; - sepNavSelRange = "{0, 0}"; - sepNavVisRange = "{0, 0}"; + sepNavIntBoundsRect = "{{0, 0}, {691, 4147}}"; + sepNavSelRange = "{12119, 0}"; + sepNavVisRange = "{10911, 1298}"; sepNavWindowFrame = "{{508, 63}, {932, 815}}"; }; }; @@ -107,9 +117,9 @@ }; 8BC6025B073B072D006C4272 /* TubeDesk.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {554, 1859}}"; + sepNavIntBoundsRect = "{{0, 0}, {656, 1924}}"; sepNavSelRange = "{4740, 127}"; - sepNavVisRange = "{4740, 107}"; + sepNavVisRange = "{4728, 159}"; sepNavWindowFrame = "{{508, 63}, {932, 815}}"; }; }; @@ -127,16 +137,6 @@ isa = PBXCodeSenseManager; indexTemplatePath = ""; }; - 8BD8CB131DF8EDB000CC3427 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BC6025B073B072D006C4272 /* TubeDesk.h */; - name = "TubeDesk.h: 121"; - rLen = 127; - rLoc = 4740; - rType = 0; - vrLen = 107; - vrLoc = 4740; - }; 8D01CCC60486CAD60068D4B7 /* TubeDesk */ = { activeExec = 0; }; diff --git a/plugins/MacAU/TubeDesk/TubeDesk.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/TubeDesk/TubeDesk.xcodeproj/christopherjohnson.perspectivev3 index 5a5dc2b..a910f97 100755 --- a/plugins/MacAU/TubeDesk/TubeDesk.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/TubeDesk/TubeDesk.xcodeproj/christopherjohnson.perspectivev3 @@ -225,8 +225,8 @@ <array/> <key>PerspectiveWidths</key> <array> - <integer>-1</integer> - <integer>-1</integer> + <integer>920</integer> + <integer>920</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> @@ -307,7 +305,7 @@ </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> - <string>{{0, 0}, {185, 428}}</string> + <string>{{0, 0}, {185, 675}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> @@ -317,14 +315,14 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {202, 446}}</string> + <string>{{0, 0}, {202, 693}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>185</real> </array> <key>RubberWindowFrame</key> - <string>630 304 810 487 0 0 1440 878 </string> + <string>387 106 920 734 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>8B9D770A1F7FA48A007AB60F</string> + <string>8B79320C21F4B8F7006E9731</string> <key>history</key> <array> - <string>8BD8CB131DF8EDB000CC3427</string> - <string>8B9D68401F7C91F2007AB60F</string> + <string>8B79320521F4B8E5006E9731</string> + <string>8B79320721F4B8E5006E9731</string> </array> </dict> <key>SplitCount</key> @@ -370,18 +368,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {603, 13}}</string> + <string>{{0, 0}, {713, 543}}</string> <key>RubberWindowFrame</key> - <string>630 304 810 487 0 0 1440 878 </string> + <string>387 106 920 734 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>13pt</string> + <string>543pt</string> </dict> <dict> <key>Proportion</key> - <string>428pt</string> + <string>145pt</string> <key>Tabs</key> <array> <dict> @@ -395,9 +393,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 401}}</string> - <key>RubberWindowFrame</key> - <string>630 304 810 487 0 0 1440 878 </string> + <string>{{10, 27}, {713, 118}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -451,7 +447,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 31}, {603, 297}}</string> + <string>{{10, 27}, {713, 118}}</string> + <key>RubberWindowFrame</key> + <string>387 106 920 734 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -460,7 +458,7 @@ </dict> </array> <key>Proportion</key> - <string>603pt</string> + <string>713pt</string> </dict> </array> <key>Name</key> @@ -479,11 +477,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B9D770B1F7FA48A007AB60F</string> + <string>8B79320D21F4B8F7006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B9D770C1F7FA48A007AB60F</string> + <string>8B79320E21F4B8F7006E9731</string> <string>8B3ED5701DDE63FA004F9D64</string> - <string>8B9D770D1F7FA48A007AB60F</string> + <string>8B79320F21F4B8F7006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -636,7 +634,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>528458890.160869</real> + <real>569686263.00768697</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -653,11 +651,10 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8B9D770E1F7FA48A007AB60F</string> <string>/Users/christopherjohnson/Desktop/MacAU/TubeDesk/TubeDesk.xcodeproj</string> </array> <key>WindowString</key> - <string>630 304 810 487 0 0 1440 878 </string> + <string>387 106 920 734 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |