aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/PurestDrive
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/PurestDrive
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/PurestDrive')
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestDrive/PurestDrive.cpp25
-rwxr-xr-xplugins/MacAU/PurestDrive/PurestDrive.h4
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson (Christopher-Johnsons-MacBook-Pro-2's conflicted copy 2015-05-07).mode1v30
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson (Christopher-Johnsons-MacBook-Pro-2's conflicted copy 2015-05-07).pbxuser0
-rwxr-xr-xplugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson.pbxuser42
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson.perspectivev379
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/project.pbxproj0
7 files changed, 95 insertions, 55 deletions
diff --git a/plugins/MacAU/PurestDrive/PurestDrive.cpp b/plugins/MacAU/PurestDrive/PurestDrive.cpp
index fe73631..7f6d0a0 100644..100755
--- a/plugins/MacAU/PurestDrive/PurestDrive.cpp
+++ b/plugins/MacAU/PurestDrive/PurestDrive.cpp
@@ -159,9 +159,7 @@ ComponentResult PurestDrive::Initialize()
void PurestDrive::PurestDriveKernel::Reset()
{
previousSample = 0.0;
- fpNShapeA = 0.0;
- fpNShapeB = 0.0;
- fpFlip = true;
+ fpNShape = 0.0;
}
@@ -182,9 +180,6 @@ void PurestDrive::PurestDriveKernel::Process( const Float32 *inSourceP,
long double inputSample;
long double drySample;
Float64 apply;
- Float32 fpTemp;
- long double fpOld = 0.618033988749894848204586; //golden ratio!
- long double fpNew = 1.0 - fpOld;
while (nSampleFrames-- > 0) {
inputSample = *sourceP;
@@ -227,19 +222,11 @@ void PurestDrive::PurestDriveKernel::Process( const Float32 *inSourceP,
previousSample = sin(drySample);
//apply the sine while storing previous sample
- //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/PurestDrive/PurestDrive.h b/plugins/MacAU/PurestDrive/PurestDrive.h
index 5f5aaa0..54809d8 100755
--- a/plugins/MacAU/PurestDrive/PurestDrive.h
+++ b/plugins/MacAU/PurestDrive/PurestDrive.h
@@ -126,9 +126,7 @@ public:
private:
double previousSample;
- long double fpNShapeA;
- long double fpNShapeB;
- bool fpFlip;
+ long double fpNShape;
};
};
diff --git a/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson (Christopher-Johnsons-MacBook-Pro-2's conflicted copy 2015-05-07).mode1v3 b/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson (Christopher-Johnsons-MacBook-Pro-2's conflicted copy 2015-05-07).mode1v3
index 75a6c26..75a6c26 100644..100755
--- a/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson (Christopher-Johnsons-MacBook-Pro-2's conflicted copy 2015-05-07).mode1v3
+++ b/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson (Christopher-Johnsons-MacBook-Pro-2's conflicted copy 2015-05-07).mode1v3
diff --git a/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson (Christopher-Johnsons-MacBook-Pro-2's conflicted copy 2015-05-07).pbxuser b/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson (Christopher-Johnsons-MacBook-Pro-2's conflicted copy 2015-05-07).pbxuser
index a5bba60..a5bba60 100644..100755
--- a/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson (Christopher-Johnsons-MacBook-Pro-2's conflicted copy 2015-05-07).pbxuser
+++ b/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson (Christopher-Johnsons-MacBook-Pro-2's conflicted copy 2015-05-07).pbxuser
diff --git a/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson.pbxuser
index 197baf6..f2badd1 100755
--- a/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson.pbxuser
@@ -49,13 +49,15 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 538686890;
- PBXWorkspaceStateSaveDate = 538686890;
+ PBXPerProjectTemplateStateSaveDate = 569585875;
+ PBXWorkspaceStateSaveDate = 569585875;
};
perUserProjectItems = {
8B4E546B201BAC8800B5DC2A /* PBXTextBookmark */ = 8B4E546B201BAC8800B5DC2A /* PBXTextBookmark */;
- 8B4E54A2201BB36200B5DC2A /* PBXTextBookmark */ = 8B4E54A2201BB36200B5DC2A /* PBXTextBookmark */;
8B4E54E4201BB69000B5DC2A /* PBXTextBookmark */ = 8B4E54E4201BB69000B5DC2A /* PBXTextBookmark */;
+ 8B79268621F330ED006E9731 /* PBXBookmark */ = 8B79268621F330ED006E9731 /* PBXBookmark */;
+ 8B79268F21F33157006E9731 /* PBXTextBookmark */ = 8B79268F21F33157006E9731 /* PBXTextBookmark */;
+ 8B79269521F33157006E9731 /* PBXTextBookmark */ = 8B79269521F33157006E9731 /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
@@ -66,12 +68,12 @@
fRef = 8BA05A660720730100365D66 /* PurestDrive.cpp */;
name = "PurestDrive.cpp: 243";
rLen = 0;
- rLoc = 10597;
+ rLoc = 10326;
rType = 0;
vrLen = 174;
vrLoc = 8595;
};
- 8B4E54A2201BB36200B5DC2A /* PBXTextBookmark */ = {
+ 8B4E54E4201BB69000B5DC2A /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A690720730100365D66 /* PurestDriveVersion.h */;
name = "PurestDriveVersion.h: 55";
@@ -81,7 +83,11 @@
vrLen = 0;
vrLoc = 0;
};
- 8B4E54E4201BB69000B5DC2A /* PBXTextBookmark */ = {
+ 8B79268621F330ED006E9731 /* PBXBookmark */ = {
+ isa = PBXBookmark;
+ fRef = 8BA05A660720730100365D66 /* PurestDrive.cpp */;
+ };
+ 8B79268F21F33157006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A690720730100365D66 /* PurestDriveVersion.h */;
name = "PurestDriveVersion.h: 55";
@@ -91,12 +97,22 @@
vrLen = 0;
vrLoc = 0;
};
+ 8B79269521F33157006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* PurestDrive.cpp */;
+ name = "PurestDrive.cpp: 230";
+ rLen = 0;
+ rLoc = 10324;
+ rType = 0;
+ vrLen = 2327;
+ vrLoc = 8156;
+ };
8BA05A660720730100365D66 /* PurestDrive.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {934, 3419}}";
- sepNavSelRange = "{9713, 510}";
- sepNavVisRange = "{7324, 2454}";
- sepNavWindowFrame = "{{459, 58}, {981, 816}}";
+ sepNavIntBoundsRect = "{{0, 0}, {934, 3263}}";
+ sepNavSelRange = "{10324, 0}";
+ sepNavVisRange = "{8156, 2327}";
+ sepNavWindowFrame = "{{255, 47}, {981, 816}}";
};
};
8BA05A670720730100365D66 /* PurestDrive.exp */ = {
@@ -124,9 +140,9 @@
};
8BC6025B073B072D006C4272 /* PurestDrive.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {934, 1794}}";
- sepNavSelRange = "{5101, 0}";
- sepNavVisRange = "{438, 2642}";
+ sepNavIntBoundsRect = "{{0, 0}, {934, 1768}}";
+ sepNavSelRange = "{5140, 0}";
+ sepNavVisRange = "{3607, 1646}";
sepNavWindowFrame = "{{459, 62}, {981, 816}}";
};
};
diff --git a/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson.perspectivev3
index dea99d5..c9284f3 100644..100755
--- a/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/christopherjohnson.perspectivev3
@@ -222,7 +222,48 @@
</dict>
</array>
<key>OpenEditors</key>
- <array/>
+ <array>
+ <dict>
+ <key>Content</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>8B79269321F33157006E9731</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>PurestDrive.cpp</string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>8B79269421F33157006E9731</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>PurestDrive.cpp</string>
+ <key>_historyCapacity</key>
+ <integer>0</integer>
+ <key>bookmark</key>
+ <string>8B79269521F33157006E9731</string>
+ <key>history</key>
+ <array>
+ <string>8B79268621F330ED006E9731</string>
+ </array>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <true/>
+ </dict>
+ <key>Geometry</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 20}, {981, 719}}</string>
+ <key>PBXModuleWindowStatusBarHidden2</key>
+ <false/>
+ <key>RubberWindowFrame</key>
+ <string>255 103 981 760 0 0 1440 878 </string>
+ </dict>
+ </dict>
+ </array>
<key>PerspectiveWidths</key>
<array>
<integer>810</integer>
@@ -323,7 +364,7 @@
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>630 344 810 487 0 0 1440 878 </string>
+ <string>466 344 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -351,11 +392,11 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B4E54E4201BB69000B5DC2A</string>
+ <string>8B79268F21F33157006E9731</string>
<key>history</key>
<array>
<string>8B4E546B201BAC8800B5DC2A</string>
- <string>8B4E54A2201BB36200B5DC2A</string>
+ <string>8B4E54E4201BB69000B5DC2A</string>
</array>
</dict>
<key>SplitCount</key>
@@ -369,23 +410,21 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 13}}</string>
+ <string>{{0, 0}, {603, 0}}</string>
<key>RubberWindowFrame</key>
- <string>630 344 810 487 0 0 1440 878 </string>
+ <string>466 344 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>13pt</string>
+ <string>0pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>428pt</string>
+ <string>441pt</string>
<key>Tabs</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
@@ -396,9 +435,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 401}}</string>
- <key>RubberWindowFrame</key>
- <string>630 344 810 487 0 0 1440 878 </string>
+ <string>{{10, 27}, {603, 414}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -452,7 +489,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 328}}</string>
+ <string>{{10, 27}, {603, 414}}</string>
+ <key>RubberWindowFrame</key>
+ <string>466 344 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -480,11 +519,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B4E54E5201BB69000B5DC2A</string>
+ <string>8B79269021F33157006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B4E54E6201BB69000B5DC2A</string>
+ <string>8B79269121F33157006E9731</string>
<string>8B08D48D1C9DE5FB007CAA65</string>
- <string>8B4E54E7201BB69000B5DC2A</string>
+ <string>8B79269221F33157006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -637,7 +676,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>538687120.62552202</real>
+ <real>569586007.10360599</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -654,11 +693,11 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B4E54E8201BB69000B5DC2A</string>
+ <string>8B79269321F33157006E9731</string>
<string>/Users/christopherjohnson/Desktop/MacAU/PurestDrive/PurestDrive.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>630 344 810 487 0 0 1440 878 </string>
+ <string>466 344 810 487 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>
diff --git a/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/project.pbxproj b/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/project.pbxproj
index 0d9763c..0d9763c 100644..100755
--- a/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/project.pbxproj
+++ b/plugins/MacAU/PurestDrive/PurestDrive.xcodeproj/project.pbxproj