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/SlewOnly | |
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/SlewOnly')
5 files changed, 88 insertions, 59 deletions
diff --git a/plugins/MacAU/SlewOnly/SlewOnly.cpp b/plugins/MacAU/SlewOnly/SlewOnly.cpp index a29bf57..1cd7a74 100755 --- a/plugins/MacAU/SlewOnly/SlewOnly.cpp +++ b/plugins/MacAU/SlewOnly/SlewOnly.cpp @@ -151,6 +151,7 @@ ComponentResult SlewOnly::Initialize() void SlewOnly::SlewOnlyKernel::Reset() { lastSample = 0.0; + fpNShape = 0.0; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -201,6 +202,13 @@ void SlewOnly::SlewOnlyKernel::Process( const Float32 *inSourceP, lastSample = inputSample; if (outputSample > 1.0) outputSample = 1.0; if (outputSample < -1.0) outputSample = -1.0; + + //32 bit dither, made small and tidy. + int expon; frexpf((Float32)outputSample, &expon); + long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + outputSample += (dither-fpNShape); fpNShape = dither; + //end 32 bit dither + *destP = outputSample; sourceP += inNumChannels; destP += inNumChannels; } diff --git a/plugins/MacAU/SlewOnly/SlewOnly.exp b/plugins/MacAU/SlewOnly/SlewOnly.exp index b3b34fe..af27a2b 100755 --- a/plugins/MacAU/SlewOnly/SlewOnly.exp +++ b/plugins/MacAU/SlewOnly/SlewOnly.exp @@ -1 +1 @@ -_SlewOnlyEntry
\ No newline at end of file +_SlewOnlyEntry diff --git a/plugins/MacAU/SlewOnly/SlewOnly.h b/plugins/MacAU/SlewOnly/SlewOnly.h index 39c3835..8b31092 100755 --- a/plugins/MacAU/SlewOnly/SlewOnly.h +++ b/plugins/MacAU/SlewOnly/SlewOnly.h @@ -122,6 +122,7 @@ public: private: Float64 lastSample; + long double fpNShape; }; }; diff --git a/plugins/MacAU/SlewOnly/SlewOnly.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/SlewOnly/SlewOnly.xcodeproj/christopherjohnson.pbxuser index 1d4d6bd..2ef6ab9 100755 --- a/plugins/MacAU/SlewOnly/SlewOnly.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/SlewOnly/SlewOnly.xcodeproj/christopherjohnson.pbxuser @@ -10,7 +10,7 @@ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, - 364, + 449, 20, 48, 43, @@ -49,68 +49,87 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 528458003; - PBXWorkspaceStateSaveDate = 528458003; + PBXPerProjectTemplateStateSaveDate = 569679830; + PBXWorkspaceStateSaveDate = 569679830; }; perUserProjectItems = { - 8B37E0391D70A73000DB4EC7 /* PBXTextBookmark */ = 8B37E0391D70A73000DB4EC7 /* PBXTextBookmark */; - 8B9D671D1F7C8F37007AB60F /* PBXTextBookmark */ = 8B9D671D1F7C8F37007AB60F /* PBXTextBookmark */; - 8B9D76191F7FA162007AB60F /* PBXTextBookmark */ = 8B9D76191F7FA162007AB60F /* PBXTextBookmark */; + 8B79302E21F4A032006E9731 /* PBXTextBookmark */ = 8B79302E21F4A032006E9731 /* PBXTextBookmark */; + 8B79302F21F4A032006E9731 /* PBXTextBookmark */ = 8B79302F21F4A032006E9731 /* PBXTextBookmark */; + 8B79303121F4A032006E9731 /* PBXTextBookmark */ = 8B79303121F4A032006E9731 /* PBXTextBookmark */; + 8B79303B21F4A0A3006E9731 /* PBXTextBookmark */ = 8B79303B21F4A0A3006E9731 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; - 8B37E0391D70A73000DB4EC7 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BA05A660720730100365D66 /* SlewOnly.cpp */; - name = "SlewOnly.cpp: 153"; - rLen = 19; - rLoc = 6827; - rType = 0; - vrLen = 380; - vrLoc = 6692; - }; - 8B9D671D1F7C8F37007AB60F /* PBXTextBookmark */ = { + 8B79302E21F4A032006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BA05A690720730100365D66 /* SlewOnlyVersion.h */; name = "SlewOnlyVersion.h: 1"; rLen = 0; rLoc = 0; rType = 0; - vrLen = 281; + vrLen = 171; vrLoc = 3098; }; - 8B9D76191F7FA162007AB60F /* PBXTextBookmark */ = { + 8B79302F21F4A032006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; - fRef = 8BA05A690720730100365D66 /* SlewOnlyVersion.h */; - name = "SlewOnlyVersion.h: 1"; + fRef = 8BC6025B073B072D006C4272 /* SlewOnly.h */; + name = "SlewOnly.h: 125"; rLen = 0; - rLoc = 0; + rLoc = 4852; rType = 0; - vrLen = 208; - vrLoc = 3098; + vrLen = 1128; + vrLoc = 3828; + }; + 8B79303121F4A032006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* SlewOnly.cpp */; + name = "SlewOnly.cpp: 209"; + rLen = 0; + rLoc = 9458; + rType = 0; + vrLen = 1694; + vrLoc = 7914; + }; + 8B79303B21F4A0A3006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* SlewOnly.cpp */; + name = "SlewOnly.cpp: 209"; + rLen = 0; + rLoc = 9458; + rType = 0; + vrLen = 1782; + vrLoc = 7826; }; 8BA05A660720730100365D66 /* SlewOnly.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {974, 2821}}"; - sepNavSelRange = "{9074, 0}"; - sepNavVisRange = "{6942, 2391}"; + sepNavIntBoundsRect = "{{0, 0}, {691, 2847}}"; + sepNavSelRange = "{9458, 0}"; + sepNavVisRange = "{7826, 1782}"; sepNavWindowFrame = "{{331, 78}, {1021, 800}}"; }; }; + 8BA05A670720730100365D66 /* SlewOnly.exp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1253, 694}}"; + sepNavSelRange = "{15, 0}"; + sepNavVisRange = "{0, 15}"; + sepNavWindowFrame = "{{15, 51}, {1300, 822}}"; + }; + }; 8BA05A690720730100365D66 /* SlewOnlyVersion.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {754, 1014}}"; + sepNavIntBoundsRect = "{{0, 0}, {754, 988}}"; sepNavSelRange = "{0, 0}"; - sepNavVisRange = "{3098, 208}"; + sepNavVisRange = "{3098, 171}"; }; }; 8BC6025B073B072D006C4272 /* SlewOnly.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {974, 1703}}"; - sepNavSelRange = "{4807, 22}"; - sepNavVisRange = "{3392, 1546}"; + sepNavIntBoundsRect = "{{0, 0}, {824, 1872}}"; + sepNavSelRange = "{4852, 0}"; + sepNavVisRange = "{3828, 1128}"; sepNavWindowFrame = "{{379, 78}, {1021, 800}}"; }; }; diff --git a/plugins/MacAU/SlewOnly/SlewOnly.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/SlewOnly/SlewOnly.xcodeproj/christopherjohnson.perspectivev3 index b4c32b3..6f61421 100755 --- a/plugins/MacAU/SlewOnly/SlewOnly.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/SlewOnly/SlewOnly.xcodeproj/christopherjohnson.perspectivev3 @@ -225,8 +225,8 @@ <array/> <key>PerspectiveWidths</key> <array> - <integer>-1</integer> - <integer>-1</integer> + <integer>895</integer> + <integer>895</integer> </array> <key>Perspectives</key> <array> @@ -300,14 +300,14 @@ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> - <integer>4</integer> + <integer>5</integer> <integer>2</integer> <integer>1</integer> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> - <string>{{0, 0}, {185, 428}}</string> + <string>{{0, 0}, {185, 656}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> @@ -317,14 +317,14 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {202, 446}}</string> + <string>{{0, 0}, {202, 674}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>185</real> </array> <key>RubberWindowFrame</key> - <string>587 314 810 487 0 0 1440 878 </string> + <string>417 141 895 715 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -340,7 +340,7 @@ <key>PBXProjectModuleGUID</key> <string>8B37E0371D70A73000DB4EC7</string> <key>PBXProjectModuleLabel</key> - <string>SlewOnlyVersion.h</string> + <string>SlewOnly.cpp</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> @@ -348,15 +348,16 @@ <key>PBXProjectModuleGUID</key> <string>8B37E0381D70A73000DB4EC7</string> <key>PBXProjectModuleLabel</key> - <string>SlewOnlyVersion.h</string> + <string>SlewOnly.cpp</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B9D76191F7FA162007AB60F</string> + <string>8B79303B21F4A0A3006E9731</string> <key>history</key> <array> - <string>8B37E0391D70A73000DB4EC7</string> - <string>8B9D671D1F7C8F37007AB60F</string> + <string>8B79302E21F4A032006E9731</string> + <string>8B79302F21F4A032006E9731</string> + <string>8B79303121F4A032006E9731</string> </array> </dict> <key>SplitCount</key> @@ -370,18 +371,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {603, 86}}</string> + <string>{{0, 0}, {688, 543}}</string> <key>RubberWindowFrame</key> - <string>587 314 810 487 0 0 1440 878 </string> + <string>417 141 895 715 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>86pt</string> + <string>543pt</string> </dict> <dict> <key>Proportion</key> - <string>355pt</string> + <string>126pt</string> <key>Tabs</key> <array> <dict> @@ -395,9 +396,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 328}}</string> - <key>RubberWindowFrame</key> - <string>587 314 810 487 0 0 1440 878 </string> + <string>{{10, 27}, {688, 99}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -451,7 +450,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 31}, {603, 297}}</string> + <string>{{10, 27}, {688, 99}}</string> + <key>RubberWindowFrame</key> + <string>417 141 895 715 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -460,7 +461,7 @@ </dict> </array> <key>Proportion</key> - <string>603pt</string> + <string>688pt</string> </dict> </array> <key>Name</key> @@ -479,11 +480,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B9D761A1F7FA162007AB60F</string> + <string>8B79303C21F4A0A3006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B9D761B1F7FA162007AB60F</string> + <string>8B79303D21F4A0A3006E9731</string> <string>8B37E0371D70A73000DB4EC7</string> - <string>8B9D761C1F7FA162007AB60F</string> + <string>8B79303E21F4A0A3006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -636,7 +637,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>528458082.578906</real> + <real>569680035.79594803</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -653,11 +654,11 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8B9D761D1F7FA162007AB60F</string> + <string>8B79303F21F4A0A3006E9731</string> <string>/Users/christopherjohnson/Desktop/MacAU/SlewOnly/SlewOnly.xcodeproj</string> </array> <key>WindowString</key> - <string>587 314 810 487 0 0 1440 878 </string> + <string>417 141 895 715 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |