aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/BussColors4
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/BussColors4
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/BussColors4')
-rwxr-xr-xplugins/MacAU/BussColors4/BussColors4.cpp25
-rwxr-xr-xplugins/MacAU/BussColors4/BussColors4.h4
-rwxr-xr-xplugins/MacAU/BussColors4/BussColors4.xcodeproj/christopherjohnson.pbxuser46
-rwxr-xr-xplugins/MacAU/BussColors4/BussColors4.xcodeproj/christopherjohnson.perspectivev329
4 files changed, 43 insertions, 61 deletions
diff --git a/plugins/MacAU/BussColors4/BussColors4.cpp b/plugins/MacAU/BussColors4/BussColors4.cpp
index 4b0c664..35f7931 100755
--- a/plugins/MacAU/BussColors4/BussColors4.cpp
+++ b/plugins/MacAU/BussColors4/BussColors4.cpp
@@ -227,9 +227,7 @@ void BussColors4::BussColors4Kernel::Reset()
control = 0;
gcount = 0;
slowdyn = 0;
- fpNShapeA = 0.0;
- fpNShapeB = 0.0;
- fpFlip = true;
+ fpNShape = 0.0;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -263,9 +261,6 @@ void BussColors4::BussColors4Kernel::Process( const Float32 *inSourceP,
Float64 gain = 0.436;
Float64 outgain = 1.0;
Float64 bridgerectifier;
- Float32 fpTemp;
- Float64 fpOld = 0.618033988749894848204586; //golden ratio!
- Float64 fpNew = 1.0 - fpOld;
int console = (int) GetParameter( kParam_One );
switch (console)
@@ -662,19 +657,11 @@ void BussColors4::BussColors4Kernel::Process( const Float32 *inSourceP,
inputSample = (inputSample * wet) + (drySample * dry);
}
- //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 = not 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/BussColors4/BussColors4.h b/plugins/MacAU/BussColors4/BussColors4.h
index 799fbc6..321760e 100755
--- a/plugins/MacAU/BussColors4/BussColors4.h
+++ b/plugins/MacAU/BussColors4/BussColors4.h
@@ -160,9 +160,7 @@ public:
Float64 control;
int gcount;
Float64 slowdyn;
- long double fpNShapeA;
- long double fpNShapeB;
- bool fpFlip;
+ long double fpNShape;
};
};
diff --git a/plugins/MacAU/BussColors4/BussColors4.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/BussColors4/BussColors4.xcodeproj/christopherjohnson.pbxuser
index 57c71c6..64acbeb 100755
--- a/plugins/MacAU/BussColors4/BussColors4.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/BussColors4/BussColors4.xcodeproj/christopherjohnson.pbxuser
@@ -49,14 +49,14 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 528421335;
- PBXWorkspaceStateSaveDate = 528421335;
+ PBXPerProjectTemplateStateSaveDate = 569590217;
+ PBXWorkspaceStateSaveDate = 569590217;
};
perUserProjectItems = {
8B48B64B1EE21C9100BCF3D0 /* PlistBookmark */ = 8B48B64B1EE21C9100BCF3D0 /* PlistBookmark */;
+ 8B79286B21F34214006E9731 /* PBXTextBookmark */ = 8B79286B21F34214006E9731 /* PBXTextBookmark */;
+ 8B79287021F3422D006E9731 /* PBXTextBookmark */ = 8B79287021F3422D006E9731 /* PBXTextBookmark */;
8B9D73031F7F11E3007AB60F /* PBXTextBookmark */ = 8B9D73031F7F11E3007AB60F /* PBXTextBookmark */;
- 8B9D73041F7F11E3007AB60F /* PBXTextBookmark */ = 8B9D73041F7F11E3007AB60F /* PBXTextBookmark */;
- 8B9D73051F7F11E3007AB60F /* PBXTextBookmark */ = 8B9D73051F7F11E3007AB60F /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
@@ -74,17 +74,7 @@
rLen = 0;
rLoc = 9223372036854775808;
};
- 8B9D73031F7F11E3007AB60F /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 8BC6025B073B072D006C4272 /* BussColors4.h */;
- name = "BussColors4.h: 157";
- rLen = 0;
- rLoc = 6374;
- rType = 0;
- vrLen = 351;
- vrLoc = 3;
- };
- 8B9D73041F7F11E3007AB60F /* PBXTextBookmark */ = {
+ 8B79286B21F34214006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A670720730100365D66 /* BussColors4.exp */;
name = "BussColors4.exp: 1";
@@ -94,7 +84,7 @@
vrLen = 18;
vrLoc = 0;
};
- 8B9D73051F7F11E3007AB60F /* PBXTextBookmark */ = {
+ 8B79287021F3422D006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A670720730100365D66 /* BussColors4.exp */;
name = "BussColors4.exp: 1";
@@ -104,17 +94,27 @@
vrLen = 18;
vrLoc = 0;
};
+ 8B9D73031F7F11E3007AB60F /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BC6025B073B072D006C4272 /* BussColors4.h */;
+ name = "BussColors4.h: 157";
+ rLen = 0;
+ rLoc = 6374;
+ rType = 0;
+ vrLen = 351;
+ vrLoc = 3;
+ };
8BA05A660720730100365D66 /* BussColors4.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {905, 9542}}";
- sepNavSelRange = "{12772, 0}";
- sepNavVisRange = "{11547, 2663}";
+ sepNavIntBoundsRect = "{{0, 0}, {905, 9672}}";
+ sepNavSelRange = "{11353, 0}";
+ sepNavVisRange = "{10026, 2482}";
sepNavWindowFrame = "{{394, 39}, {952, 839}}";
};
};
8BA05A670720730100365D66 /* BussColors4.exp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {367, 107}}";
+ sepNavIntBoundsRect = "{{0, 0}, {367, 92}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 18}";
};
@@ -129,9 +129,9 @@
};
8BC6025B073B072D006C4272 /* BussColors4.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {530, 2236}}";
- sepNavSelRange = "{6374, 0}";
- sepNavVisRange = "{3, 351}";
+ sepNavIntBoundsRect = "{{0, 0}, {905, 2340}}";
+ sepNavSelRange = "{6519, 0}";
+ sepNavVisRange = "{4823, 1798}";
sepNavWindowFrame = "{{33, 39}, {952, 839}}";
};
};
diff --git a/plugins/MacAU/BussColors4/BussColors4.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/BussColors4/BussColors4.xcodeproj/christopherjohnson.perspectivev3
index 1ccb652..c388d98 100755
--- a/plugins/MacAU/BussColors4/BussColors4.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/BussColors4/BussColors4.xcodeproj/christopherjohnson.perspectivev3
@@ -256,8 +256,6 @@
<key>Layout</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -353,12 +351,12 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B9D73051F7F11E3007AB60F</string>
+ <string>8B79287021F3422D006E9731</string>
<key>history</key>
<array>
<string>8B48B64B1EE21C9100BCF3D0</string>
<string>8B9D73031F7F11E3007AB60F</string>
- <string>8B9D73041F7F11E3007AB60F</string>
+ <string>8B79286B21F34214006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -372,18 +370,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {416, 139}}</string>
+ <string>{{0, 0}, {416, 124}}</string>
<key>RubberWindowFrame</key>
<string>541 301 726 510 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>139pt</string>
+ <string>124pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>325pt</string>
+ <string>340pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -397,9 +395,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {416, 298}}</string>
- <key>RubberWindowFrame</key>
- <string>541 301 726 510 0 0 1440 878 </string>
+ <string>{{10, 27}, {416, 313}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -453,7 +449,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {416, 399}}</string>
+ <string>{{10, 27}, {416, 313}}</string>
+ <key>RubberWindowFrame</key>
+ <string>541 301 726 510 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -481,11 +479,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B9D73061F7F11E3007AB60F</string>
+ <string>8B79287121F3422D006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B9D73071F7F11E3007AB60F</string>
+ <string>8B79287221F3422D006E9731</string>
<string>8BD7274A1D46E5A5000176F0</string>
- <string>8B9D73081F7F11E3007AB60F</string>
+ <string>8B79287321F3422D006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -658,7 +656,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>528421347.61386502</real>
+ <real>569590317.82425797</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -675,7 +673,6 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B9D73091F7F11E3007AB60F</string>
<string>/Users/christopherjohnson/Desktop/MacAU/BussColors4/BussColors4.xcodeproj</string>
</array>
<key>WindowString</key>