aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/Fracture
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/Fracture
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/Fracture')
-rwxr-xr-xplugins/MacAU/Fracture/Fracture.cpp28
-rwxr-xr-xplugins/MacAU/Fracture/Fracture.exp2
-rwxr-xr-xplugins/MacAU/Fracture/Fracture.h4
-rwxr-xr-xplugins/MacAU/Fracture/Fracture.xcodeproj/christopherjohnson.pbxuser50
-rwxr-xr-xplugins/MacAU/Fracture/Fracture.xcodeproj/christopherjohnson.perspectivev347
5 files changed, 77 insertions, 54 deletions
diff --git a/plugins/MacAU/Fracture/Fracture.cpp b/plugins/MacAU/Fracture/Fracture.cpp
index f6a7186..4818270 100755
--- a/plugins/MacAU/Fracture/Fracture.cpp
+++ b/plugins/MacAU/Fracture/Fracture.cpp
@@ -182,9 +182,7 @@ ComponentResult Fracture::Initialize()
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void Fracture::FractureKernel::Reset()
{
- fpNShapeA = 0.0;
- fpNShapeB = 0.0;
- fpFlip = true;
+ fpNShape = 0.0;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -211,11 +209,7 @@ void Fracture::FractureKernel::Process( const Float32 *inSourceP,
Float64 wet = GetParameter( kParam_Four );
Float64 dry = 1.0-wet;
Float64 bridgerectifier;
- density = density * fabs(density);
- Float32 fpTemp;
- Float64 fpOld = 0.618033988749894848204586; //golden ratio!
- Float64 fpNew = 1.0 - fpOld;
-
+ density = density * fabs(density);
while (nSampleFrames-- > 0) {
inputSample = *sourceP;
@@ -261,19 +255,11 @@ void Fracture::FractureKernel::Process( const Float32 *inSourceP,
inputSample = (drySample * dry)+(inputSample*wet);
//that simple.
- //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/Fracture/Fracture.exp b/plugins/MacAU/Fracture/Fracture.exp
index b485428..9eb17a5 100755
--- a/plugins/MacAU/Fracture/Fracture.exp
+++ b/plugins/MacAU/Fracture/Fracture.exp
@@ -1 +1 @@
-_FractureEntry \ No newline at end of file
+_FractureEntry
diff --git a/plugins/MacAU/Fracture/Fracture.h b/plugins/MacAU/Fracture/Fracture.h
index aa9a6f5..1dccb92 100755
--- a/plugins/MacAU/Fracture/Fracture.h
+++ b/plugins/MacAU/Fracture/Fracture.h
@@ -134,9 +134,7 @@ public:
virtual void Reset();
private:
- Float64 fpNShapeA;
- Float64 fpNShapeB;
- bool fpFlip;
+ long double fpNShape;
};
};
diff --git a/plugins/MacAU/Fracture/Fracture.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Fracture/Fracture.xcodeproj/christopherjohnson.pbxuser
index 9e2cdb2..4efb520 100755
--- a/plugins/MacAU/Fracture/Fracture.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/Fracture/Fracture.xcodeproj/christopherjohnson.pbxuser
@@ -49,19 +49,51 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 528456201;
- PBXWorkspaceStateSaveDate = 528456201;
+ PBXPerProjectTemplateStateSaveDate = 569645423;
+ PBXWorkspaceStateSaveDate = 569645423;
+ };
+ perUserProjectItems = {
+ 8B792C5521F41A58006E9731 /* PBXTextBookmark */ = 8B792C5521F41A58006E9731 /* PBXTextBookmark */;
+ 8B792C5B21F41AB6006E9731 /* PBXTextBookmark */ = 8B792C5B21F41AB6006E9731 /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
};
};
+ 8B792C5521F41A58006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* Fracture.cpp */;
+ name = "Fracture.cpp: 248";
+ rLen = 0;
+ rLoc = 11543;
+ rType = 0;
+ vrLen = 312;
+ vrLoc = 11562;
+ };
+ 8B792C5B21F41AB6006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* Fracture.cpp */;
+ name = "Fracture.cpp: 248";
+ rLen = 0;
+ rLoc = 11543;
+ rType = 0;
+ vrLen = 312;
+ vrLoc = 11562;
+ };
8BA05A660720730100365D66 /* Fracture.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {964, 3913}}";
- sepNavSelRange = "{11687, 0}";
- sepNavVisRange = "{9717, 2345}";
- sepNavWindowFrame = "{{517, 41}, {923, 837}}";
+ sepNavIntBoundsRect = "{{0, 0}, {621, 3718}}";
+ sepNavSelRange = "{11543, 0}";
+ sepNavVisRange = "{11562, 312}";
+ sepNavWindowFrame = "{{365, 41}, {923, 837}}";
+ };
+ };
+ 8BA05A670720730100365D66 /* Fracture.exp */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1253, 694}}";
+ sepNavSelRange = "{15, 0}";
+ sepNavVisRange = "{0, 15}";
+ sepNavWindowFrame = "{{15, 51}, {1300, 822}}";
};
};
8BA05A690720730100365D66 /* FractureVersion.h */ = {
@@ -74,9 +106,9 @@
};
8BC6025B073B072D006C4272 /* Fracture.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {922, 1846}}";
- sepNavSelRange = "{5434, 0}";
- sepNavVisRange = "{3891, 1652}";
+ sepNavIntBoundsRect = "{{0, 0}, {922, 1859}}";
+ sepNavSelRange = "{5401, 0}";
+ sepNavVisRange = "{3843, 1667}";
sepNavWindowFrame = "{{517, 39}, {923, 837}}";
};
};
diff --git a/plugins/MacAU/Fracture/Fracture.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Fracture/Fracture.xcodeproj/christopherjohnson.perspectivev3
index 46cfa67..a5f791e 100755
--- a/plugins/MacAU/Fracture/Fracture.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/Fracture/Fracture.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>
@@ -300,7 +300,7 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>4</integer>
+ <integer>5</integer>
<integer>2</integer>
<integer>1</integer>
<integer>0</integer>
@@ -324,7 +324,7 @@
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>362 267 810 487 0 0 1440 878 </string>
+ <string>431 299 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -340,7 +340,7 @@
<key>PBXProjectModuleGUID</key>
<string>8B9CE5211DFF96EB00A5DC6F</string>
<key>PBXProjectModuleLabel</key>
- <string></string>
+ <string>Fracture.cpp</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -348,7 +348,15 @@
<key>PBXProjectModuleGUID</key>
<string>8B9CE5221DFF96EB00A5DC6F</string>
<key>PBXProjectModuleLabel</key>
- <string></string>
+ <string>Fracture.cpp</string>
+ <key>_historyCapacity</key>
+ <integer>0</integer>
+ <key>bookmark</key>
+ <string>8B792C5B21F41AB6006E9731</string>
+ <key>history</key>
+ <array>
+ <string>8B792C5521F41A58006E9731</string>
+ </array>
</dict>
<key>SplitCount</key>
<string>1</string>
@@ -361,18 +369,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 0}}</string>
+ <string>{{0, 0}, {603, 132}}</string>
<key>RubberWindowFrame</key>
- <string>362 267 810 487 0 0 1440 878 </string>
+ <string>431 299 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>0pt</string>
+ <string>132pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>441pt</string>
+ <string>309pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -386,9 +394,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 414}}</string>
- <key>RubberWindowFrame</key>
- <string>362 267 810 487 0 0 1440 878 </string>
+ <string>{{10, 27}, {603, 282}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -442,7 +448,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 414}}</string>
+ <string>{{10, 27}, {603, 282}}</string>
+ <key>RubberWindowFrame</key>
+ <string>431 299 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -470,11 +478,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B9D742C1F7F9A57007AB60F</string>
+ <string>8B792C5C21F41AB6006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B9D742D1F7F9A57007AB60F</string>
+ <string>8B792C5D21F41AB6006E9731</string>
<string>8B9CE5211DFF96EB00A5DC6F</string>
- <string>8B9D742E1F7F9A57007AB60F</string>
+ <string>8B792C5E21F41AB6006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -627,7 +635,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>528456279.90402597</real>
+ <real>569645750.04603803</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -644,11 +652,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B9D742F1F7F9A57007AB60F</string>
<string>/Users/christopherjohnson/Desktop/MacAU/Fracture/Fracture.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>362 267 810 487 0 0 1440 878 </string>
+ <string>431 299 810 487 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>