aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/TransDesk
diff options
context:
space:
mode:
authorChris Johnson <jinx6568@sover.net>2019-01-27 21:13:54 -0500
committerChris Johnson <jinx6568@sover.net>2019-01-27 21:13:54 -0500
commit966f2d253cd2ee6ce140ad68095a20a9d2b63052 (patch)
treeb0400d95bd06512531ade6ddf55190a58b6a5623 /plugins/MacAU/TransDesk
parent0887543349dbbec0721a1fc8b1c7deba9afefa8b (diff)
downloadairwindows-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/TransDesk')
-rwxr-xr-xplugins/MacAU/TransDesk/TransDesk.cpp27
-rwxr-xr-xplugins/MacAU/TransDesk/TransDesk.h4
-rwxr-xr-xplugins/MacAU/TransDesk/TransDesk.xcodeproj/christopherjohnson.pbxuser54
-rwxr-xr-xplugins/MacAU/TransDesk/TransDesk.xcodeproj/christopherjohnson.perspectivev349
4 files changed, 58 insertions, 76 deletions
diff --git a/plugins/MacAU/TransDesk/TransDesk.cpp b/plugins/MacAU/TransDesk/TransDesk.cpp
index 0aa57f4..f508b67 100755
--- a/plugins/MacAU/TransDesk/TransDesk.cpp
+++ b/plugins/MacAU/TransDesk/TransDesk.cpp
@@ -157,9 +157,7 @@ void TransDesk::TransDeskKernel::Reset()
lastSample = 0.0;
lastOutSample = 0.0;
lastSlew = 0.0;
- fpNShapeA = 0.0;
- fpNShapeB = 0.0;
- fpFlip = true;
+ fpNShape = 0.0;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -202,9 +200,6 @@ void TransDesk::TransDeskKernel::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;
@@ -297,21 +292,11 @@ void TransDesk::TransDeskKernel::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/TransDesk/TransDesk.h b/plugins/MacAU/TransDesk/TransDesk.h
index f73f550..7479936 100755
--- a/plugins/MacAU/TransDesk/TransDesk.h
+++ b/plugins/MacAU/TransDesk/TransDesk.h
@@ -123,9 +123,7 @@ public:
long double lastSample;
long double lastOutSample;
Float64 lastSlew;
- Float64 fpNShapeA;
- Float64 fpNShapeB;
- bool fpFlip;
+ Float64 fpNShape;
};
};
diff --git a/plugins/MacAU/TransDesk/TransDesk.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/TransDesk/TransDesk.xcodeproj/christopherjohnson.pbxuser
index 0688c58..3879aa7 100755
--- a/plugins/MacAU/TransDesk/TransDesk.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/TransDesk/TransDesk.xcodeproj/christopherjohnson.pbxuser
@@ -10,7 +10,7 @@
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
- 364,
+ 455,
20,
48,
43,
@@ -49,53 +49,53 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 528458726;
- PBXWorkspaceStateSaveDate = 528458726;
+ PBXPerProjectTemplateStateSaveDate = 569685635;
+ PBXWorkspaceStateSaveDate = 569685635;
};
perUserProjectItems = {
- 8B3ED5DC1DDE6589004F9D64 /* PBXTextBookmark */ = 8B3ED5DC1DDE6589004F9D64 /* PBXTextBookmark */;
- 8B9D680F1F7C919B007AB60F /* PBXTextBookmark */ = 8B9D680F1F7C919B007AB60F /* PBXTextBookmark */;
- 8B9D76EC1F7FA409007AB60F /* PBXTextBookmark */ = 8B9D76EC1F7FA409007AB60F /* PBXTextBookmark */;
+ 8B7931D821F4B744006E9731 /* PBXTextBookmark */ = 8B7931D821F4B744006E9731 /* PBXTextBookmark */;
+ 8B7931DA21F4B744006E9731 /* PBXTextBookmark */ = 8B7931DA21F4B744006E9731 /* PBXTextBookmark */;
+ 8B7931DF21F4B769006E9731 /* PBXTextBookmark */ = 8B7931DF21F4B769006E9731 /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
};
};
- 8B3ED5DC1DDE6589004F9D64 /* PBXTextBookmark */ = {
+ 8B7931D821F4B744006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BC6025B073B072D006C4272 /* TransDesk.h */;
name = "TransDesk.h: 126";
- rLen = 57;
- rLoc = 4907;
+ rLen = 0;
+ rLoc = 4926;
rType = 0;
- vrLen = 113;
- vrLoc = 4858;
+ vrLen = 406;
+ vrLoc = 4630;
};
- 8B9D680F1F7C919B007AB60F /* PBXTextBookmark */ = {
+ 8B7931DA21F4B744006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A660720730100365D66 /* TransDesk.cpp */;
- name = "TransDesk.cpp: 1";
+ name = "TransDesk.cpp: 297";
rLen = 0;
- rLoc = 0;
+ rLoc = 11884;
rType = 0;
- vrLen = 199;
- vrLoc = 11010;
+ vrLen = 1440;
+ vrLoc = 9447;
};
- 8B9D76EC1F7FA409007AB60F /* PBXTextBookmark */ = {
+ 8B7931DF21F4B769006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A660720730100365D66 /* TransDesk.cpp */;
- name = "TransDesk.cpp: 1";
+ name = "TransDesk.cpp: 203";
rLen = 0;
- rLoc = 0;
+ rLoc = 8371;
rType = 0;
- vrLen = 147;
- vrLoc = 11028;
+ vrLen = 1325;
+ vrLoc = 7918;
};
8BA05A660720730100365D66 /* TransDesk.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {558, 4264}}";
- sepNavSelRange = "{0, 0}";
- sepNavVisRange = "{11028, 147}";
+ sepNavIntBoundsRect = "{{0, 0}, {691, 4134}}";
+ sepNavSelRange = "{8371, 0}";
+ sepNavVisRange = "{7918, 1325}";
sepNavWindowFrame = "{{506, 58}, {932, 815}}";
};
};
@@ -117,9 +117,9 @@
};
8BC6025B073B072D006C4272 /* TransDesk.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {885, 1755}}";
- sepNavSelRange = "{4906, 0}";
- sepNavVisRange = "{3678, 1395}";
+ sepNavIntBoundsRect = "{{0, 0}, {698, 1911}}";
+ sepNavSelRange = "{4926, 0}";
+ sepNavVisRange = "{4630, 406}";
sepNavWindowFrame = "{{508, 63}, {932, 815}}";
};
};
diff --git a/plugins/MacAU/TransDesk/TransDesk.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/TransDesk/TransDesk.xcodeproj/christopherjohnson.perspectivev3
index 31d86a2..db0c5ba 100755
--- a/plugins/MacAU/TransDesk/TransDesk.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/TransDesk/TransDesk.xcodeproj/christopherjohnson.perspectivev3
@@ -225,8 +225,8 @@
<array/>
<key>PerspectiveWidths</key>
<array>
- <integer>-1</integer>
- <integer>-1</integer>
+ <integer>901</integer>
+ <integer>901</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, 676}}</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, 694}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>630 249 810 487 0 0 1440 878 </string>
+ <string>398 107 901 735 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -335,6 +333,8 @@
<key>Dock</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
@@ -352,11 +352,11 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B9D76EC1F7FA409007AB60F</string>
+ <string>8B7931DF21F4B769006E9731</string>
<key>history</key>
<array>
- <string>8B3ED5DC1DDE6589004F9D64</string>
- <string>8B9D680F1F7C919B007AB60F</string>
+ <string>8B7931D821F4B744006E9731</string>
+ <string>8B7931DA21F4B744006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -370,18 +370,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 69}}</string>
+ <string>{{0, 0}, {694, 520}}</string>
<key>RubberWindowFrame</key>
- <string>630 249 810 487 0 0 1440 878 </string>
+ <string>398 107 901 735 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>69pt</string>
+ <string>520pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>372pt</string>
+ <string>169pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -395,9 +395,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 345}}</string>
- <key>RubberWindowFrame</key>
- <string>630 249 810 487 0 0 1440 878 </string>
+ <string>{{10, 27}, {694, 142}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -451,7 +449,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 31}, {603, 297}}</string>
+ <string>{{10, 27}, {694, 142}}</string>
+ <key>RubberWindowFrame</key>
+ <string>398 107 901 735 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -460,7 +460,7 @@
</dict>
</array>
<key>Proportion</key>
- <string>603pt</string>
+ <string>694pt</string>
</dict>
</array>
<key>Name</key>
@@ -479,11 +479,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B9D76ED1F7FA409007AB60F</string>
+ <string>8B7931E021F4B769006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B9D76EE1F7FA409007AB60F</string>
+ <string>8B7931E121F4B769006E9731</string>
<string>8B3ED5581DDE63B1004F9D64</string>
- <string>8B9D76EF1F7FA409007AB60F</string>
+ <string>8B7931E221F4B769006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -636,7 +636,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>528458761.70146298</real>
+ <real>569685865.03802896</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -653,11 +653,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B9D76F01F7FA409007AB60F</string>
<string>/Users/christopherjohnson/Desktop/MacAU/TransDesk/TransDesk.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>630 249 810 487 0 0 1440 878 </string>
+ <string>398 107 901 735 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>