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/Distance2 | |
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/Distance2')
3 files changed, 51 insertions, 55 deletions
diff --git a/plugins/MacAU/Distance2/Distance2.cpp b/plugins/MacAU/Distance2/Distance2.cpp index d9101d7..ddafb82 100755 --- a/plugins/MacAU/Distance2/Distance2.cpp +++ b/plugins/MacAU/Distance2/Distance2.cpp @@ -359,23 +359,15 @@ void Distance2::Distance2Kernel::Process( const Float32 *inSourceP, } //Dry/Wet control, defaults to the last slider - //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/Distance2/Distance2.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Distance2/Distance2.xcodeproj/christopherjohnson.pbxuser index 3d24615..6b4a4a7 100755 --- a/plugins/MacAU/Distance2/Distance2.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/Distance2/Distance2.xcodeproj/christopherjohnson.pbxuser @@ -49,20 +49,40 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 547768382; - PBXWorkspaceStateSaveDate = 547768382; + PBXPerProjectTemplateStateSaveDate = 569598233; + PBXWorkspaceStateSaveDate = 569598233; }; perUserProjectItems = { + 8B792ACD21F3615C006E9731 /* PBXTextBookmark */ = 8B792ACD21F3615C006E9731 /* PBXTextBookmark */; + 8B792AD221F3616C006E9731 /* PBXTextBookmark */ = 8B792AD221F3616C006E9731 /* PBXTextBookmark */; 8B7E3D4220A64FFD00482CB5 /* PBXTextBookmark */ = 8B7E3D4220A64FFD00482CB5 /* PBXTextBookmark */; 8B7E3D4320A64FFD00482CB5 /* PBXTextBookmark */ = 8B7E3D4320A64FFD00482CB5 /* PBXTextBookmark */; - 8B7E3D4420A64FFD00482CB5 /* PBXBookmark */ = 8B7E3D4420A64FFD00482CB5 /* PBXBookmark */; - 8B7E3D4520A64FFD00482CB5 /* PBXTextBookmark */ = 8B7E3D4520A64FFD00482CB5 /* PBXTextBookmark */; 8B904DA120A465EC008CBAD8 /* PlistBookmark */ = 8B904DA120A465EC008CBAD8 /* PlistBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; + 8B792ACD21F3615C006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* Distance2.cpp */; + name = "Distance2.cpp: 176"; + rLen = 0; + rLoc = 8084; + rType = 0; + vrLen = 420; + vrLoc = 10855; + }; + 8B792AD221F3616C006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* Distance2.cpp */; + name = "Distance2.cpp: 176"; + rLen = 0; + rLoc = 8084; + rType = 0; + vrLen = 420; + vrLoc = 10855; + }; 8B7E3D4220A64FFD00482CB5 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BA05A690720730100365D66 /* Distance2Version.h */; @@ -83,20 +103,6 @@ vrLen = 375; vrLoc = 2714; }; - 8B7E3D4420A64FFD00482CB5 /* PBXBookmark */ = { - isa = PBXBookmark; - fRef = 8BA05A660720730100365D66 /* Distance2.cpp */; - }; - 8B7E3D4520A64FFD00482CB5 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BA05A660720730100365D66 /* Distance2.cpp */; - name = "Distance2.cpp: 176"; - rLen = 0; - rLoc = 8084; - rType = 0; - vrLen = 476; - vrLoc = 10855; - }; 8B904DA120A465EC008CBAD8 /* PlistBookmark */ = { isa = PlistBookmark; fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */; @@ -111,10 +117,10 @@ }; 8BA05A660720730100365D66 /* Distance2.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {642, 4979}}"; + sepNavIntBoundsRect = "{{0, 0}, {572, 4875}}"; sepNavSelRange = "{8084, 0}"; - sepNavVisRange = "{10855, 476}"; - sepNavWindowFrame = "{{561, 47}, {877, 831}}"; + sepNavVisRange = "{10855, 420}"; + sepNavWindowFrame = "{{432, 47}, {877, 831}}"; }; }; 8BA05A670720730100365D66 /* Distance2.exp */ = { @@ -135,10 +141,10 @@ }; 8BC6025B073B072D006C4272 /* Distance2.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {824, 2210}}"; + sepNavIntBoundsRect = "{{0, 0}, {894, 2223}}"; sepNavSelRange = "{2966, 0}"; - sepNavVisRange = "{2714, 375}"; - sepNavWindowFrame = "{{786, 47}, {877, 831}}"; + sepNavVisRange = "{4877, 1321}"; + sepNavWindowFrame = "{{563, 47}, {877, 831}}"; }; }; 8BD3CCB8148830B20062E48C /* Source Control */ = { diff --git a/plugins/MacAU/Distance2/Distance2.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Distance2/Distance2.xcodeproj/christopherjohnson.perspectivev3 index 5d06e6f..deed33a 100755 --- a/plugins/MacAU/Distance2/Distance2.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/Distance2/Distance2.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>576 144 841 654 0 0 1440 878 </string> + <string>487 174 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -354,13 +352,13 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B7E3D4520A64FFD00482CB5</string> + <string>8B792AD221F3616C006E9731</string> <key>history</key> <array> <string>8B904DA120A465EC008CBAD8</string> <string>8B7E3D4220A64FFD00482CB5</string> <string>8B7E3D4320A64FFD00482CB5</string> - <string>8B7E3D4420A64FFD00482CB5</string> + <string>8B792ACD21F3615C006E9731</string> </array> </dict> <key>SplitCount</key> @@ -374,18 +372,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {531, 202}}</string> + <string>{{0, 0}, {531, 188}}</string> <key>RubberWindowFrame</key> - <string>576 144 841 654 0 0 1440 878 </string> + <string>487 174 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>202pt</string> + <string>188pt</string> </dict> <dict> <key>Proportion</key> - <string>406pt</string> + <string>420pt</string> <key>Tabs</key> <array> <dict> @@ -399,9 +397,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 379}}</string> - <key>RubberWindowFrame</key> - <string>576 144 841 654 0 0 1440 878 </string> + <string>{{10, 27}, {531, 393}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -455,7 +451,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {531, 339}}</string> + <string>{{10, 27}, {531, 393}}</string> + <key>RubberWindowFrame</key> + <string>487 174 841 654 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -483,11 +481,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B7E3D4620A64FFD00482CB5</string> + <string>8B792AD321F3616C006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B7E3D4720A64FFD00482CB5</string> + <string>8B792AD421F3616C006E9731</string> <string>8BD7274A1D46E5A5000176F0</string> - <string>8B7E3D4820A64FFD00482CB5</string> + <string>8B792AD521F3616C006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -660,7 +658,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>547770365.68357301</real> + <real>569598316.742221</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -680,7 +678,7 @@ <string>/Users/christopherjohnson/Desktop/MacAU/Distance2/Distance2.xcodeproj</string> </array> <key>WindowString</key> - <string>576 144 841 654 0 0 1440 878 </string> + <string>487 174 841 654 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |