aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/Drive
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/Drive
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/Drive')
-rwxr-xr-xplugins/MacAU/Drive/Drive.cpp26
-rwxr-xr-xplugins/MacAU/Drive/Drive.exp2
-rwxr-xr-xplugins/MacAU/Drive/Drive.h3
-rwxr-xr-xplugins/MacAU/Drive/Drive.xcodeproj/christopherjohnson.pbxuser68
-rwxr-xr-xplugins/MacAU/Drive/Drive.xcodeproj/christopherjohnson.perspectivev341
5 files changed, 67 insertions, 73 deletions
diff --git a/plugins/MacAU/Drive/Drive.cpp b/plugins/MacAU/Drive/Drive.cpp
index 179d9ae..ab3c0bc 100755
--- a/plugins/MacAU/Drive/Drive.cpp
+++ b/plugins/MacAU/Drive/Drive.cpp
@@ -184,8 +184,7 @@ void Drive::DriveKernel::Reset()
{
iirSampleA = 0.0;
iirSampleB = 0.0;
- fpNShapeA = 0.0;
- fpNShapeB = 0.0;
+ fpNShape = 0.0;
fpFlip = true;
}
@@ -220,10 +219,6 @@ void Drive::DriveKernel::Process( const Float32 *inSourceP,
Float64 glitch = 0.60;
Float64 out;
- Float32 fpTemp;
- Float64 fpOld = 0.618033988749894848204586; //golden ratio!
- Float64 fpNew = 1.0 - fpOld;
-
while (nSampleFrames-- > 0) {
inputSample = *sourceP;
if (inputSample<1.2e-38 && -inputSample<1.2e-38) {
@@ -282,20 +277,13 @@ void Drive::DriveKernel::Process( const Float32 *inSourceP,
if (wet < 1.0) inputSample = (drySample * dry)+(inputSample*wet);
//nice little output stage template: if we have another scale of floating point
//number, we really don't want to meaninglessly multiply that by 1.0.
-
- //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;
diff --git a/plugins/MacAU/Drive/Drive.exp b/plugins/MacAU/Drive/Drive.exp
index f23aad0..caa6fe9 100755
--- a/plugins/MacAU/Drive/Drive.exp
+++ b/plugins/MacAU/Drive/Drive.exp
@@ -1 +1 @@
-_DriveEntry \ No newline at end of file
+_DriveEntry
diff --git a/plugins/MacAU/Drive/Drive.h b/plugins/MacAU/Drive/Drive.h
index 83be2b2..0e4af2a 100755
--- a/plugins/MacAU/Drive/Drive.h
+++ b/plugins/MacAU/Drive/Drive.h
@@ -139,8 +139,7 @@ public:
private:
Float64 iirSampleA;
Float64 iirSampleB;
- Float64 fpNShapeA;
- Float64 fpNShapeB;
+ long double fpNShape;
bool fpFlip;
};
};
diff --git a/plugins/MacAU/Drive/Drive.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Drive/Drive.xcodeproj/christopherjohnson.pbxuser
index 948474f..8cd024d 100755
--- a/plugins/MacAU/Drive/Drive.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/Drive/Drive.xcodeproj/christopherjohnson.pbxuser
@@ -49,13 +49,13 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 559395484;
- PBXWorkspaceStateSaveDate = 559395484;
+ PBXPerProjectTemplateStateSaveDate = 569599476;
+ PBXWorkspaceStateSaveDate = 569599476;
};
perUserProjectItems = {
8B3D790A1DB4057D00247AD5 /* PBXTextBookmark */ = 8B3D790A1DB4057D00247AD5 /* PBXTextBookmark */;
- 8BE626152157B2BF00E4E476 /* PBXTextBookmark */ = 8BE626152157B2BF00E4E476 /* PBXTextBookmark */;
- 8BE626162157B2BF00E4E476 /* PBXTextBookmark */ = 8BE626162157B2BF00E4E476 /* PBXTextBookmark */;
+ 8B792B2A21F36661006E9731 /* PBXTextBookmark */ = 8B792B2A21F36661006E9731 /* PBXTextBookmark */;
+ 8B792B3021F36679006E9731 /* PBXTextBookmark */ = 8B792B3021F36679006E9731 /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
@@ -71,12 +71,40 @@
vrLen = 59;
vrLoc = 0;
};
+ 8B792B2A21F36661006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* Drive.cpp */;
+ name = "Drive.cpp: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 64;
+ vrLoc = 0;
+ };
+ 8B792B3021F36679006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* Drive.cpp */;
+ name = "Drive.cpp: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 64;
+ vrLoc = 0;
+ };
8BA05A660720730100365D66 /* Drive.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {803, 4056}}";
+ sepNavIntBoundsRect = "{{0, 0}, {803, 3991}}";
sepNavSelRange = "{0, 0}";
- sepNavVisRange = "{0, 127}";
- sepNavWindowFrame = "{{537, 59}, {895, 819}}";
+ sepNavVisRange = "{0, 64}";
+ sepNavWindowFrame = "{{423, 59}, {895, 819}}";
+ };
+ };
+ 8BA05A670720730100365D66 /* Drive.exp */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1253, 694}}";
+ sepNavSelRange = "{12, 0}";
+ sepNavVisRange = "{0, 12}";
+ sepNavWindowFrame = "{{15, 51}, {1300, 822}}";
};
};
8BA05A690720730100365D66 /* DriveVersion.h */ = {
@@ -89,9 +117,9 @@
};
8BC6025B073B072D006C4272 /* Drive.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {856, 1963}}";
- sepNavSelRange = "{5553, 57}";
- sepNavVisRange = "{4498, 1221}";
+ sepNavIntBoundsRect = "{{0, 0}, {856, 2184}}";
+ sepNavSelRange = "{5576, 0}";
+ sepNavVisRange = "{4496, 1205}";
sepNavWindowFrame = "{{517, 162}, {903, 692}}";
};
};
@@ -109,26 +137,6 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
- 8BE626152157B2BF00E4E476 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 8BA05A660720730100365D66 /* Drive.cpp */;
- name = "Drive.cpp: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 127;
- vrLoc = 0;
- };
- 8BE626162157B2BF00E4E476 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 8BA05A660720730100365D66 /* Drive.cpp */;
- name = "Drive.cpp: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 127;
- vrLoc = 0;
- };
8D01CCC60486CAD60068D4B7 /* Drive */ = {
activeExec = 0;
};
diff --git a/plugins/MacAU/Drive/Drive.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Drive/Drive.xcodeproj/christopherjohnson.perspectivev3
index 09b8cfc..a684ee9 100755
--- a/plugins/MacAU/Drive/Drive.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/Drive/Drive.xcodeproj/christopherjohnson.perspectivev3
@@ -225,8 +225,8 @@
<array/>
<key>PerspectiveWidths</key>
<array>
- <integer>-1</integer>
- <integer>-1</integer>
+ <integer>810</integer>
+ <integer>810</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>
@@ -300,7 +298,7 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>4</integer>
+ <integer>5</integer>
<integer>2</integer>
<integer>1</integer>
<integer>0</integer>
@@ -324,7 +322,7 @@
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>624 381 810 487 0 0 1440 878 </string>
+ <string>511 370 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -352,11 +350,11 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8BE626162157B2BF00E4E476</string>
+ <string>8B792B3021F36679006E9731</string>
<key>history</key>
<array>
<string>8B3D790A1DB4057D00247AD5</string>
- <string>8BE626152157B2BF00E4E476</string>
+ <string>8B792B2A21F36661006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -370,18 +368,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 132}}</string>
+ <string>{{0, 0}, {603, 117}}</string>
<key>RubberWindowFrame</key>
- <string>624 381 810 487 0 0 1440 878 </string>
+ <string>511 370 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>132pt</string>
+ <string>117pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>309pt</string>
+ <string>324pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -395,9 +393,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 282}}</string>
- <key>RubberWindowFrame</key>
- <string>624 381 810 487 0 0 1440 878 </string>
+ <string>{{10, 27}, {603, 297}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -451,7 +447,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 31}, {603, 297}}</string>
+ <string>{{10, 27}, {603, 297}}</string>
+ <key>RubberWindowFrame</key>
+ <string>511 370 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -479,11 +477,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BE626172157B2BF00E4E476</string>
+ <string>8B792B3121F36679006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8BE626182157B2BF00E4E476</string>
+ <string>8B792B3221F36679006E9731</string>
<string>8BE3FFB51DAAD42E00A5AAF5</string>
- <string>8BE626192157B2BF00E4E476</string>
+ <string>8B792B3321F36679006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -636,7 +634,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>559395519.27228796</real>
+ <real>569599609.11398804</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -653,10 +651,11 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
+ <string>8B792B3421F36679006E9731</string>
<string>/Users/christopherjohnson/Desktop/MacAU/Drive/Drive.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>624 381 810 487 0 0 1440 878 </string>
+ <string>511 370 810 487 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>