aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/Hermepass
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/Hermepass
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/Hermepass')
-rwxr-xr-xplugins/MacAU/Hermepass/Hermepass.cpp25
-rwxr-xr-xplugins/MacAU/Hermepass/Hermepass.h3
-rwxr-xr-xplugins/MacAU/Hermepass/Hermepass.xcodeproj/christopherjohnson.pbxuser30
-rwxr-xr-xplugins/MacAU/Hermepass/Hermepass.xcodeproj/christopherjohnson.perspectivev352
4 files changed, 50 insertions, 60 deletions
diff --git a/plugins/MacAU/Hermepass/Hermepass.cpp b/plugins/MacAU/Hermepass/Hermepass.cpp
index 8c8da5d..c969719 100755
--- a/plugins/MacAU/Hermepass/Hermepass.cpp
+++ b/plugins/MacAU/Hermepass/Hermepass.cpp
@@ -174,8 +174,7 @@ void Hermepass::HermepassKernel::Reset()
iirF = 0.0;
iirG = 0.0;
iirH = 0.0;
- fpNShapeA = 0.0;
- fpNShapeB = 0.0;
+ fpNShape = 0.0;
fpFlip = true;
}
@@ -194,10 +193,9 @@ void Hermepass::HermepassKernel::Process( const Float32 *inSourceP,
long double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= GetSampleRate();
- Float32 fpTemp;
long double fpOld = 0.618033988749894848204586; //golden ratio!
long double fpNew = 1.0 - fpOld;
-
+
Float64 rangescale = 0.1 / overallscale;
Float64 cutoff = pow(GetParameter( kParam_One ),3);
@@ -301,20 +299,13 @@ void Hermepass::HermepassKernel::Process( const Float32 *inSourceP,
//with everything an array value. However, this makes just as much sense for this few poles.
inputSample -= correction;
-
- //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/Hermepass/Hermepass.h b/plugins/MacAU/Hermepass/Hermepass.h
index 24cfb07..3483edc 100755
--- a/plugins/MacAU/Hermepass/Hermepass.h
+++ b/plugins/MacAU/Hermepass/Hermepass.h
@@ -139,8 +139,7 @@ public:
Float64 iirH; //seven poles max, and the final pole is always at 20hz directly.
- long double fpNShapeA;
- long double fpNShapeB;
+ long double fpNShape;
bool fpFlip;
};
};
diff --git a/plugins/MacAU/Hermepass/Hermepass.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Hermepass/Hermepass.xcodeproj/christopherjohnson.pbxuser
index b85e0a0..7dff583 100755
--- a/plugins/MacAU/Hermepass/Hermepass.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/Hermepass/Hermepass.xcodeproj/christopherjohnson.pbxuser
@@ -3,6 +3,8 @@
089C1669FE841209C02AAC07 /* Project object */ = {
activeBuildConfigurationName = Release;
activeTarget = 8D01CCC60486CAD60068D4B7 /* Hermepass */;
+ breakpoints = (
+ );
codeSenseManager = 8BD3CCB9148830B20062E48C /* Code sense */;
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
@@ -49,18 +51,18 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 528456409;
- PBXWorkspaceStateSaveDate = 528456409;
+ PBXPerProjectTemplateStateSaveDate = 569648641;
+ PBXWorkspaceStateSaveDate = 569648641;
};
perUserProjectItems = {
- 8B9D64FF1F7C889C007AB60F /* PlistBookmark */ = 8B9D64FF1F7C889C007AB60F /* PlistBookmark */;
- 8B9D74581F7F9AF1007AB60F /* PlistBookmark */ = 8B9D74581F7F9AF1007AB60F /* PlistBookmark */;
+ 8B792D0521F4265D006E9731 /* PlistBookmark */ = 8B792D0521F4265D006E9731 /* PlistBookmark */;
+ 8B792D1021F42698006E9731 /* PlistBookmark */ = 8B792D1021F42698006E9731 /* PlistBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
};
};
- 8B9D64FF1F7C889C007AB60F /* PlistBookmark */ = {
+ 8B792D0521F4265D006E9731 /* PlistBookmark */ = {
isa = PlistBookmark;
fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */;
fallbackIsa = PBXBookmark;
@@ -70,9 +72,9 @@
);
name = /Users/christopherjohnson/Desktop/MacAU/Hermepass/Info.plist;
rLen = 0;
- rLoc = 9223372036854775808;
+ rLoc = 9223372036854775807;
};
- 8B9D74581F7F9AF1007AB60F /* PlistBookmark */ = {
+ 8B792D1021F42698006E9731 /* PlistBookmark */ = {
isa = PlistBookmark;
fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */;
fallbackIsa = PBXBookmark;
@@ -86,10 +88,10 @@
};
8BA05A660720730100365D66 /* Hermepass.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1006, 4407}}";
- sepNavSelRange = "{10576, 0}";
- sepNavVisRange = "{9818, 2810}";
- sepNavWindowFrame = "{{387, 39}, {1053, 839}}";
+ sepNavIntBoundsRect = "{{0, 0}, {1006, 4342}}";
+ sepNavSelRange = "{8578, 0}";
+ sepNavVisRange = "{7759, 2039}";
+ sepNavWindowFrame = "{{235, 39}, {1053, 839}}";
};
};
8BA05A690720730100365D66 /* HermepassVersion.h */ = {
@@ -102,9 +104,9 @@
};
8BC6025B073B072D006C4272 /* Hermepass.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1006, 1833}}";
- sepNavSelRange = "{1818, 0}";
- sepNavVisRange = "{651, 2568}";
+ sepNavIntBoundsRect = "{{0, 0}, {1006, 1937}}";
+ sepNavSelRange = "{5697, 0}";
+ sepNavVisRange = "{4041, 1775}";
sepNavWindowFrame = "{{387, 39}, {1053, 839}}";
};
};
diff --git a/plugins/MacAU/Hermepass/Hermepass.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Hermepass/Hermepass.xcodeproj/christopherjohnson.perspectivev3
index a56662d..db59c0b 100755
--- a/plugins/MacAU/Hermepass/Hermepass.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/Hermepass/Hermepass.xcodeproj/christopherjohnson.perspectivev3
@@ -256,8 +256,6 @@
<key>Layout</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -325,7 +323,7 @@
<real>288</real>
</array>
<key>RubberWindowFrame</key>
- <string>599 176 841 654 0 0 1440 878 </string>
+ <string>471 176 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -353,10 +351,10 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B9D74581F7F9AF1007AB60F</string>
+ <string>8B792D1021F42698006E9731</string>
<key>history</key>
<array>
- <string>8B9D64FF1F7C889C007AB60F</string>
+ <string>8B792D0521F4265D006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -370,18 +368,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {531, 202}}</string>
+ <string>{{0, 0}, {531, 188}}</string>
<key>RubberWindowFrame</key>
- <string>599 176 841 654 0 0 1440 878 </string>
+ <string>471 176 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>
@@ -395,9 +393,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 379}}</string>
- <key>RubberWindowFrame</key>
- <string>599 176 841 654 0 0 1440 878 </string>
+ <string>{{10, 27}, {531, 393}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -451,7 +447,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 315}}</string>
+ <string>{{10, 27}, {531, 393}}</string>
+ <key>RubberWindowFrame</key>
+ <string>471 176 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -479,11 +477,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B9D74591F7F9AF1007AB60F</string>
+ <string>8B792D1121F42698006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B9D745A1F7F9AF1007AB60F</string>
+ <string>8B792D1221F42698006E9731</string>
<string>8BD7274A1D46E5A5000176F0</string>
- <string>8B9D745B1F7F9AF1007AB60F</string>
+ <string>8B792D1321F42698006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -534,12 +532,12 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {810, 0}}</string>
+ <string>{{0, 0}, {424, 270}}</string>
</dict>
<key>Module</key>
<string>PBXDebugCLIModule</string>
<key>Proportion</key>
- <string>0pt</string>
+ <string>270pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
@@ -632,14 +630,14 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BD727EC1D46ECF1000176F0</string>
+ <string>8B792D1421F42698006E9731</string>
<string>1CCC7628064C1048000F2A68</string>
<string>1CCC7629064C1048000F2A68</string>
- <string>8BD727ED1D46ECF1000176F0</string>
- <string>8BD727EE1D46ECF1000176F0</string>
- <string>8BD727EF1D46ECF1000176F0</string>
- <string>8BD727F01D46ECF1000176F0</string>
- <string>8BD727E71D46ECD9000176F0</string>
+ <string>8B792D1521F42698006E9731</string>
+ <string>8B792D1621F42698006E9731</string>
+ <string>8B792D1721F42698006E9731</string>
+ <string>8B792D1821F42698006E9731</string>
+ <string>8B792D1921F42698006E9731</string>
</array>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
@@ -656,7 +654,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>528456433.21989697</real>
+ <real>569648792.66830301</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -673,11 +671,11 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B9D745C1F7F9AF1007AB60F</string>
+ <string>8B792D1A21F42698006E9731</string>
<string>/Users/christopherjohnson/Desktop/MacAU/Hermepass/Hermepass.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>599 176 841 654 0 0 1440 878 </string>
+ <string>471 176 841 654 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>