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/Distance | |
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/Distance')
-rwxr-xr-x | plugins/MacAU/Distance/Distance.cpp | 26 | ||||
-rwxr-xr-x | plugins/MacAU/Distance/Distance.exp | 2 | ||||
-rwxr-xr-x | plugins/MacAU/Distance/Distance.h | 5 | ||||
-rwxr-xr-x | plugins/MacAU/Distance/Distance.xcodeproj/christopherjohnson.pbxuser | 64 | ||||
-rwxr-xr-x | plugins/MacAU/Distance/Distance.xcodeproj/christopherjohnson.perspectivev3 | 36 |
5 files changed, 62 insertions, 71 deletions
diff --git a/plugins/MacAU/Distance/Distance.cpp b/plugins/MacAU/Distance/Distance.cpp index 72c9e27..35c0a22 100755 --- a/plugins/MacAU/Distance/Distance.cpp +++ b/plugins/MacAU/Distance/Distance.cpp @@ -169,9 +169,7 @@ void Distance::DistanceKernel::Reset() { thirdresult = prevresult = lastclamp = clamp = change = last = 0.0; //just an example - fpNShapeA = 0.0; - fpNShapeB = 0.0; - fpFlip = true; + fpNShape = 0.0; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -204,10 +202,6 @@ void Distance::DistanceKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Two ); Float64 dry = 1.0-wet; Float64 bridgerectifier; - - Float32 fpTemp; - Float64 fpOld = 0.618033988749894848204586; //golden ratio! - Float64 fpNew = 1.0 - fpOld; Float64 inputSample; Float64 drySample; @@ -262,19 +256,11 @@ void Distance::DistanceKernel::Process( const Float32 *inSourceP, if (wet < 1.0) inputSample = (drySample * dry)+(inputSample*wet); - //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/Distance/Distance.exp b/plugins/MacAU/Distance/Distance.exp index d74c02c..f4b0e52 100755 --- a/plugins/MacAU/Distance/Distance.exp +++ b/plugins/MacAU/Distance/Distance.exp @@ -1 +1 @@ -_DistanceEntry
\ No newline at end of file +_DistanceEntry diff --git a/plugins/MacAU/Distance/Distance.h b/plugins/MacAU/Distance/Distance.h index e1c5af3..cade7a5 100755 --- a/plugins/MacAU/Distance/Distance.h +++ b/plugins/MacAU/Distance/Distance.h @@ -137,10 +137,7 @@ public: Float64 thirdresult; Float64 prevresult; Float64 last; - Float64 fpNShapeA; - Float64 fpNShapeB; - bool fpFlip; - + long double fpNShape; }; }; diff --git a/plugins/MacAU/Distance/Distance.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Distance/Distance.xcodeproj/christopherjohnson.pbxuser index bb0c98b..1979f1e 100755 --- a/plugins/MacAU/Distance/Distance.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/Distance/Distance.xcodeproj/christopherjohnson.pbxuser @@ -49,54 +49,62 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 547638606; - PBXWorkspaceStateSaveDate = 547638606; + PBXPerProjectTemplateStateSaveDate = 569598091; + PBXWorkspaceStateSaveDate = 569598091; }; perUserProjectItems = { + 8B792AB521F360EC006E9731 /* PBXTextBookmark */ = 8B792AB521F360EC006E9731 /* PBXTextBookmark */; + 8B792ABB21F36103006E9731 /* PBXTextBookmark */ = 8B792ABB21F36103006E9731 /* PBXTextBookmark */; 8B904CF820A44C4B008CBAD8 /* PBXTextBookmark */ = 8B904CF820A44C4B008CBAD8 /* PBXTextBookmark */; - 8B904D1020A44D87008CBAD8 /* PBXTextBookmark */ = 8B904D1020A44D87008CBAD8 /* PBXTextBookmark */; - 8B904D1120A44D87008CBAD8 /* PBXTextBookmark */ = 8B904D1120A44D87008CBAD8 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; - 8B904CF820A44C4B008CBAD8 /* PBXTextBookmark */ = { + 8B792AB521F360EC006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; - fRef = 8BC6025B073B072D006C4272 /* Distance.h */; - name = "Distance.h: 134"; + fRef = 8BA05A660720730100365D66 /* Distance.cpp */; + name = "Distance.cpp: 255"; rLen = 0; - rLoc = 5367; + rLoc = 11375; rType = 0; - vrLen = 50; - vrLoc = 5335; + vrLen = 0; + vrLoc = 0; }; - 8B904D1020A44D87008CBAD8 /* PBXTextBookmark */ = { + 8B792ABB21F36103006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BA05A660720730100365D66 /* Distance.cpp */; - name = "Distance.cpp: 261"; + name = "Distance.cpp: 255"; rLen = 0; - rLoc = 11520; + rLoc = 11375; rType = 0; - vrLen = 97; - vrLoc = 10123; + vrLen = 0; + vrLoc = 0; }; - 8B904D1120A44D87008CBAD8 /* PBXTextBookmark */ = { + 8B904CF820A44C4B008CBAD8 /* PBXTextBookmark */ = { isa = PBXTextBookmark; - fRef = 8BA05A660720730100365D66 /* Distance.cpp */; - name = "Distance.cpp: 261"; + fRef = 8BC6025B073B072D006C4272 /* Distance.h */; + name = "Distance.h: 134"; rLen = 0; - rLoc = 11520; + rLoc = 5367; rType = 0; - vrLen = 97; - vrLoc = 10123; + vrLen = 50; + vrLoc = 5335; }; 8BA05A660720730100365D66 /* Distance.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {554, 3783}}"; - sepNavSelRange = "{11520, 0}"; - sepNavVisRange = "{10123, 97}"; - sepNavWindowFrame = "{{492, 53}, {948, 825}}"; + sepNavIntBoundsRect = "{{0, 0}, {554, 3705}}"; + sepNavSelRange = "{11375, 0}"; + sepNavVisRange = "{0, 0}"; + sepNavWindowFrame = "{{394, 53}, {948, 825}}"; + }; + }; + 8BA05A670720730100365D66 /* Distance.exp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1253, 694}}"; + sepNavSelRange = "{15, 0}"; + sepNavVisRange = "{0, 15}"; + sepNavWindowFrame = "{{15, 51}, {1300, 822}}"; }; }; 8BA05A690720730100365D66 /* DistanceVersion.h */ = { @@ -109,9 +117,9 @@ }; 8BC6025B073B072D006C4272 /* Distance.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1098, 1950}}"; - sepNavSelRange = "{5367, 0}"; - sepNavVisRange = "{2035, 1667}"; + sepNavIntBoundsRect = "{{0, 0}, {1098, 1937}}"; + sepNavSelRange = "{5487, 0}"; + sepNavVisRange = "{4077, 1522}"; sepNavWindowFrame = "{{295, 66}, {1145, 812}}"; }; }; diff --git a/plugins/MacAU/Distance/Distance.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Distance/Distance.xcodeproj/christopherjohnson.perspectivev3 index d80f812..2054453 100755 --- a/plugins/MacAU/Distance/Distance.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/Distance/Distance.xcodeproj/christopherjohnson.perspectivev3 @@ -300,7 +300,7 @@ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> - <integer>4</integer> + <integer>5</integer> <integer>2</integer> <integer>1</integer> <integer>0</integer> @@ -324,7 +324,7 @@ <real>185</real> </array> <key>RubberWindowFrame</key> - <string>630 345 810 487 0 0 1440 878 </string> + <string>493 340 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -352,11 +352,11 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B904D1120A44D87008CBAD8</string> + <string>8B792ABB21F36103006E9731</string> <key>history</key> <array> <string>8B904CF820A44C4B008CBAD8</string> - <string>8B904D1020A44D87008CBAD8</string> + <string>8B792AB521F360EC006E9731</string> </array> </dict> <key>SplitCount</key> @@ -370,18 +370,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {603, 51}}</string> + <string>{{0, 0}, {603, 32}}</string> <key>RubberWindowFrame</key> - <string>630 345 810 487 0 0 1440 878 </string> + <string>493 340 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>51pt</string> + <string>32pt</string> </dict> <dict> <key>Proportion</key> - <string>390pt</string> + <string>409pt</string> <key>Tabs</key> <array> <dict> @@ -395,9 +395,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 363}}</string> - <key>RubberWindowFrame</key> - <string>630 345 810 487 0 0 1440 878 </string> + <string>{{10, 27}, {603, 382}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -451,7 +449,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 282}}</string> + <string>{{10, 27}, {603, 382}}</string> + <key>RubberWindowFrame</key> + <string>493 340 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -479,11 +479,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B904D1220A44D87008CBAD8</string> + <string>8B792ABC21F36103006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B904D1320A44D87008CBAD8</string> + <string>8B792ABD21F36103006E9731</string> <string>8BC5212E1DB3E2E500E72CD6</string> - <string>8B904D1420A44D87008CBAD8</string> + <string>8B792ABE21F36103006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -636,7 +636,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>547638663.51005495</real> + <real>569598211.72343302</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -653,11 +653,11 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8B904D1520A44D87008CBAD8</string> + <string>8B792ABF21F36103006E9731</string> <string>/Users/christopherjohnson/Desktop/MacAU/Distance/Distance.xcodeproj</string> </array> <key>WindowString</key> - <string>630 345 810 487 0 0 1440 878 </string> + <string>493 340 810 487 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |