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/uLawEncode | |
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/uLawEncode')
3 files changed, 75 insertions, 64 deletions
diff --git a/plugins/MacAU/uLawEncode/uLawEncode.cpp b/plugins/MacAU/uLawEncode/uLawEncode.cpp index 60e0bb1..9c663fb 100755 --- a/plugins/MacAU/uLawEncode/uLawEncode.cpp +++ b/plugins/MacAU/uLawEncode/uLawEncode.cpp @@ -229,23 +229,15 @@ void uLawEncode::uLawEncodeKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //noise shaping to 32-bit floating point - Float32 fpTemp = inputSample; - fpNShape += (inputSample-fpTemp); - inputSample += fpNShape; - //for deeper space and warmth, we try a non-oscillating noise shaping - //that is kind of ruthless: it will forever retain the rounding errors - //except we'll dial it back a hair at the end of every buffer processed - //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; destP += inNumChannels; } - fpNShape *= 0.999999; - //we will just delicately dial back the FP noise shaping, not even every sample - //this is a good place to put subtle 'no runaway' calculations, though bear in mind - //that it will be called more often when you use shorter sample buffers in the DAW. - //So, very low latency operation will call these calculations more often. } diff --git a/plugins/MacAU/uLawEncode/uLawEncode.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/uLawEncode/uLawEncode.xcodeproj/christopherjohnson.pbxuser index 79aef9a..3d079b0 100755 --- a/plugins/MacAU/uLawEncode/uLawEncode.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/uLawEncode/uLawEncode.xcodeproj/christopherjohnson.pbxuser @@ -10,7 +10,7 @@ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, - 292, + 444, 20, 48, 43, @@ -49,18 +49,20 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 561229885; - PBXWorkspaceStateSaveDate = 561229885; + PBXPerProjectTemplateStateSaveDate = 569686467; + PBXWorkspaceStateSaveDate = 569686467; }; perUserProjectItems = { - 8B27203D2173B23100396442 /* PlistBookmark */ = 8B27203D2173B23100396442 /* PlistBookmark */; - 8BE627102159750A00E4E476 /* PlistBookmark */ = 8BE627102159750A00E4E476 /* PlistBookmark */; + 8B79323121F4B9E7006E9731 /* PlistBookmark */ = 8B79323121F4B9E7006E9731 /* PlistBookmark */; + 8B79323221F4B9E7006E9731 /* PBXTextBookmark */ = 8B79323221F4B9E7006E9731 /* PBXTextBookmark */; + 8B79323421F4B9E7006E9731 /* PBXTextBookmark */ = 8B79323421F4B9E7006E9731 /* PBXTextBookmark */; + 8B79323921F4BA03006E9731 /* PBXTextBookmark */ = 8B79323921F4BA03006E9731 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; - 8B27203D2173B23100396442 /* PlistBookmark */ = { + 8B79323121F4B9E7006E9731 /* PlistBookmark */ = { isa = PlistBookmark; fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */; fallbackIsa = PBXBookmark; @@ -72,11 +74,41 @@ rLen = 0; rLoc = 9223372036854775807; }; + 8B79323221F4B9E7006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BC6025B073B072D006C4272 /* uLawEncode.h */; + name = "uLawEncode.h: 50"; + rLen = 1; + rLoc = 2740; + rType = 0; + vrLen = 1139; + vrLoc = 4128; + }; + 8B79323421F4B9E7006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* uLawEncode.cpp */; + name = "uLawEncode.cpp: 242"; + rLen = 0; + rLoc = 10181; + rType = 0; + vrLen = 1133; + vrLoc = 9051; + }; + 8B79323921F4BA03006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* uLawEncode.cpp */; + name = "uLawEncode.cpp: 242"; + rLen = 0; + rLoc = 10181; + rType = 0; + vrLen = 1159; + vrLoc = 9025; + }; 8BA05A660720730100365D66 /* uLawEncode.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {824, 3276}}"; - sepNavSelRange = "{9497, 258}"; - sepNavVisRange = "{8738, 1941}"; + sepNavIntBoundsRect = "{{0, 0}, {670, 3406}}"; + sepNavSelRange = "{10181, 0}"; + sepNavVisRange = "{9025, 1159}"; sepNavWindowFrame = "{{684, 45}, {816, 833}}"; }; }; @@ -92,7 +124,7 @@ uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {894, 1781}}"; sepNavSelRange = "{2740, 1}"; - sepNavVisRange = "{1993, 1589}"; + sepNavVisRange = "{4128, 1139}"; sepNavWindowFrame = "{{732, 67}, {890, 810}}"; }; }; @@ -110,18 +142,6 @@ isa = PBXCodeSenseManager; indexTemplatePath = ""; }; - 8BE627102159750A00E4E476 /* PlistBookmark */ = { - isa = PlistBookmark; - fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */; - fallbackIsa = PBXBookmark; - isK = 0; - kPath = ( - CFBundleName, - ); - name = /Users/christopherjohnson/Desktop/MacAU/uLawEncode/Info.plist; - rLen = 0; - rLoc = 9223372036854775808; - }; 8D01CCC60486CAD60068D4B7 /* uLawEncode */ = { activeExec = 0; }; diff --git a/plugins/MacAU/uLawEncode/uLawEncode.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/uLawEncode/uLawEncode.xcodeproj/christopherjohnson.perspectivev3 index 75813d1..663d11c 100755 --- a/plugins/MacAU/uLawEncode/uLawEncode.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/uLawEncode/uLawEncode.xcodeproj/christopherjohnson.perspectivev3 @@ -225,8 +225,8 @@ <array/> <key>PerspectiveWidths</key> <array> - <integer>841</integer> - <integer>841</integer> + <integer>899</integer> + <integer>899</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> @@ -282,7 +280,7 @@ <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> - <real>288</real> + <real>194</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> @@ -309,7 +307,7 @@ </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> - <string>{{0, 0}, {288, 595}}</string> + <string>{{0, 0}, {194, 656}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> @@ -319,19 +317,19 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {305, 613}}</string> + <string>{{0, 0}, {211, 674}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> - <real>288</real> + <real>194</real> </array> <key>RubberWindowFrame</key> - <string>637 204 841 654 0 0 1440 878 </string> + <string>406 163 899 715 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> - <string>305pt</string> + <string>211pt</string> </dict> <dict> <key>Dock</key> @@ -342,7 +340,7 @@ <key>PBXProjectModuleGUID</key> <string>8BD7274A1D46E5A5000176F0</string> <key>PBXProjectModuleLabel</key> - <string>Info.plist</string> + <string>uLawEncode.cpp</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> @@ -350,14 +348,16 @@ <key>PBXProjectModuleGUID</key> <string>8BD7274B1D46E5A5000176F0</string> <key>PBXProjectModuleLabel</key> - <string>Info.plist</string> + <string>uLawEncode.cpp</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B27203D2173B23100396442</string> + <string>8B79323921F4BA03006E9731</string> <key>history</key> <array> - <string>8BE627102159750A00E4E476</string> + <string>8B79323121F4B9E7006E9731</string> + <string>8B79323221F4B9E7006E9731</string> + <string>8B79323421F4B9E7006E9731</string> </array> </dict> <key>SplitCount</key> @@ -371,18 +371,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {531, 202}}</string> + <string>{{0, 0}, {683, 549}}</string> <key>RubberWindowFrame</key> - <string>637 204 841 654 0 0 1440 878 </string> + <string>406 163 899 715 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>202pt</string> + <string>549pt</string> </dict> <dict> <key>Proportion</key> - <string>406pt</string> + <string>120pt</string> <key>Tabs</key> <array> <dict> @@ -396,9 +396,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 379}}</string> - <key>RubberWindowFrame</key> - <string>637 204 841 654 0 0 1440 878 </string> + <string>{{10, 27}, {683, 93}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -452,7 +450,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 339}}</string> + <string>{{10, 27}, {683, 93}}</string> + <key>RubberWindowFrame</key> + <string>406 163 899 715 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -461,7 +461,7 @@ </dict> </array> <key>Proportion</key> - <string>531pt</string> + <string>683pt</string> </dict> </array> <key>Name</key> @@ -480,11 +480,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B27203E2173B23100396442</string> + <string>8B79323A21F4BA03006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B27203F2173B23100396442</string> + <string>8B79323B21F4BA03006E9731</string> <string>8BD7274A1D46E5A5000176F0</string> - <string>8B2720402173B23100396442</string> + <string>8B79323C21F4BA03006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -657,7 +657,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>561230385.17758596</real> + <real>569686531.54984498</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -674,11 +674,10 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8B2720412173B23100396442</string> <string>/Users/christopherjohnson/Desktop/MacAU/uLawEncode/uLawEncode.xcodeproj</string> </array> <key>WindowString</key> - <string>637 204 841 654 0 0 1440 878 </string> + <string>406 163 899 715 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |