aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/Highpass
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/Highpass
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/Highpass')
-rwxr-xr-xplugins/MacAU/Highpass/Highpass.cpp25
-rwxr-xr-xplugins/MacAU/Highpass/Highpass.h3
-rwxr-xr-xplugins/MacAU/Highpass/Highpass.xcodeproj/christopherjohnson.pbxuser30
-rwxr-xr-xplugins/MacAU/Highpass/Highpass.xcodeproj/christopherjohnson.perspectivev339
4 files changed, 41 insertions, 56 deletions
diff --git a/plugins/MacAU/Highpass/Highpass.cpp b/plugins/MacAU/Highpass/Highpass.cpp
index 1f887f4..095a5fd 100755
--- a/plugins/MacAU/Highpass/Highpass.cpp
+++ b/plugins/MacAU/Highpass/Highpass.cpp
@@ -175,8 +175,7 @@ void Highpass::HighpassKernel::Reset()
{
iirSampleA = 0.0;
iirSampleB = 0.0;
- fpNShapeA = 0.0;
- fpNShapeB = 0.0;
+ fpNShape = 0.0;
fpFlip = true;
}
@@ -207,9 +206,6 @@ void Highpass::HighpassKernel::Process( const Float32 *inSourceP,
Float64 offset;
Float64 inputSample;
Float64 outputSample;
- Float32 fpTemp;
- Float64 fpOld = 0.618033988749894848204586; //golden ratio!
- Float64 fpNew = 1.0 - fpOld;
iirAmount += (iirAmount * tight * tight);
if (tight > 0) tight /= 1.5;
@@ -264,20 +260,13 @@ void Highpass::HighpassKernel::Process( const Float32 *inSourceP,
}
if (wet < 1.0) outputSample = (outputSample * wet) + (inputSample * dry);
-
- //noise shaping to 32-bit floating point
- if (fpFlip) {
- fpTemp = outputSample;
- fpNShapeA = (fpNShapeA*fpOld)+((outputSample-fpTemp)*fpNew);
- outputSample += fpNShapeA;
- }
- else {
- fpTemp = outputSample;
- fpNShapeB = (fpNShapeB*fpOld)+((outputSample-fpTemp)*fpNew);
- outputSample += 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 = outputSample;
sourceP += inNumChannels;
diff --git a/plugins/MacAU/Highpass/Highpass.h b/plugins/MacAU/Highpass/Highpass.h
index 05f4b8c..d29dcf9 100755
--- a/plugins/MacAU/Highpass/Highpass.h
+++ b/plugins/MacAU/Highpass/Highpass.h
@@ -136,8 +136,7 @@ public:
private:
Float64 iirSampleA;
Float64 iirSampleB;
- long double fpNShapeA;
- long double fpNShapeB;
+ long double fpNShape;
bool fpFlip;
};
};
diff --git a/plugins/MacAU/Highpass/Highpass.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Highpass/Highpass.xcodeproj/christopherjohnson.pbxuser
index 11b4400..10f000e 100755
--- a/plugins/MacAU/Highpass/Highpass.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/Highpass/Highpass.xcodeproj/christopherjohnson.pbxuser
@@ -49,15 +49,15 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 528456582;
- PBXWorkspaceStateSaveDate = 528456582;
+ PBXPerProjectTemplateStateSaveDate = 569649241;
+ PBXWorkspaceStateSaveDate = 569649241;
};
perUserProjectItems = {
8B22B1581DB190F20075D7AA /* PBXTextBookmark */ = 8B22B1581DB190F20075D7AA /* PBXTextBookmark */;
8B22B1591DB190F20075D7AA /* PBXTextBookmark */ = 8B22B1591DB190F20075D7AA /* PBXTextBookmark */;
8B22B15A1DB190F20075D7AA /* PBXTextBookmark */ = 8B22B15A1DB190F20075D7AA /* PBXTextBookmark */;
- 8B9D65321F7C8976007AB60F /* PBXTextBookmark */ = 8B9D65321F7C8976007AB60F /* PBXTextBookmark */;
- 8B9D74871F7F9B9C007AB60F /* PBXTextBookmark */ = 8B9D74871F7F9B9C007AB60F /* PBXTextBookmark */;
+ 8B792D6121F428B9006E9731 /* PBXTextBookmark */ = 8B792D6121F428B9006E9731 /* PBXTextBookmark */;
+ 8B792D6621F428CA006E9731 /* PBXTextBookmark */ = 8B792D6621F428CA006E9731 /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
@@ -93,32 +93,32 @@
vrLen = 772;
vrLoc = 5298;
};
- 8B9D65321F7C8976007AB60F /* PBXTextBookmark */ = {
+ 8B792D6121F428B9006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BC6025B073B072D006C4272 /* Highpass.h */;
name = "Highpass.h: 125";
rLen = 0;
rLoc = 5113;
rType = 0;
- vrLen = 395;
+ vrLen = 369;
vrLoc = 5287;
};
- 8B9D74871F7F9B9C007AB60F /* PBXTextBookmark */ = {
+ 8B792D6621F428CA006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BC6025B073B072D006C4272 /* Highpass.h */;
name = "Highpass.h: 125";
rLen = 0;
rLoc = 5113;
rType = 0;
- vrLen = 394;
+ vrLen = 369;
vrLoc = 5287;
};
8BA05A660720730100365D66 /* Highpass.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {964, 3770}}";
- sepNavSelRange = "{9907, 0}";
- sepNavVisRange = "{9082, 2429}";
- sepNavWindowFrame = "{{584, 39}, {801, 838}}";
+ sepNavIntBoundsRect = "{{0, 0}, {964, 3757}}";
+ sepNavSelRange = "{12047, 0}";
+ sepNavVisRange = "{9888, 2247}";
+ sepNavWindowFrame = "{{463, 37}, {801, 838}}";
};
};
8BA05A670720730100365D66 /* Highpass.exp */ = {
@@ -138,10 +138,10 @@
};
8BC6025B073B072D006C4272 /* Highpass.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {698, 2080}}";
+ sepNavIntBoundsRect = "{{0, 0}, {670, 2106}}";
sepNavSelRange = "{5113, 0}";
- sepNavVisRange = "{5287, 394}";
- sepNavWindowFrame = "{{615, 40}, {801, 838}}";
+ sepNavVisRange = "{5287, 369}";
+ sepNavWindowFrame = "{{143, 40}, {801, 838}}";
};
};
8BD3CCB8148830B20062E48C /* Source Control */ = {
diff --git a/plugins/MacAU/Highpass/Highpass.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Highpass/Highpass.xcodeproj/christopherjohnson.perspectivev3
index 49ba097..6210205 100755
--- a/plugins/MacAU/Highpass/Highpass.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/Highpass/Highpass.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>
@@ -324,7 +322,7 @@
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>626 387 810 487 0 0 1440 878 </string>
+ <string>369 385 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -352,13 +350,13 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B9D74871F7F9B9C007AB60F</string>
+ <string>8B792D6621F428CA006E9731</string>
<key>history</key>
<array>
<string>8B22B1581DB190F20075D7AA</string>
<string>8B22B1591DB190F20075D7AA</string>
<string>8B22B15A1DB190F20075D7AA</string>
- <string>8B9D65321F7C8976007AB60F</string>
+ <string>8B792D6121F428B9006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -372,18 +370,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 264}}</string>
+ <string>{{0, 0}, {603, 256}}</string>
<key>RubberWindowFrame</key>
- <string>626 387 810 487 0 0 1440 878 </string>
+ <string>369 385 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>264pt</string>
+ <string>256pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>177pt</string>
+ <string>185pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -397,9 +395,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 150}}</string>
- <key>RubberWindowFrame</key>
- <string>626 387 810 487 0 0 1440 878 </string>
+ <string>{{10, 27}, {603, 158}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -453,7 +449,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 328}}</string>
+ <string>{{10, 27}, {603, 158}}</string>
+ <key>RubberWindowFrame</key>
+ <string>369 385 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -481,11 +479,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B9D74881F7F9B9C007AB60F</string>
+ <string>8B792D6721F428CA006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B9D74891F7F9B9C007AB60F</string>
+ <string>8B792D6821F428CA006E9731</string>
<string>8BC032A31D66648E0039F36E</string>
- <string>8B9D748A1F7F9B9C007AB60F</string>
+ <string>8B792D6921F428CA006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -638,7 +636,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>528456604.44275099</real>
+ <real>569649354.665344</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -655,11 +653,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B9D748B1F7F9B9C007AB60F</string>
<string>/Users/christopherjohnson/Desktop/MacAU/Highpass/Highpass.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>626 387 810 487 0 0 1440 878 </string>
+ <string>369 385 810 487 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>