aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/PurestEcho
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/MacVST/PurestEcho
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/MacVST/PurestEcho')
-rwxr-xr-xplugins/MacVST/PurestEcho/PurestEcho.xcodeproj/christopherjohnson.pbxuser8
-rwxr-xr-xplugins/MacVST/PurestEcho/PurestEcho.xcodeproj/christopherjohnson.perspectivev317
-rwxr-xr-xplugins/MacVST/PurestEcho/PurestEcho.xcodeproj/project.pbxproj4
-rwxr-xr-xplugins/MacVST/PurestEcho/source/PurestEcho.cpp7
-rwxr-xr-xplugins/MacVST/PurestEcho/source/PurestEcho.h7
-rwxr-xr-xplugins/MacVST/PurestEcho/source/PurestEchoProc.cpp62
6 files changed, 36 insertions, 69 deletions
diff --git a/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/christopherjohnson.pbxuser
index fcc45c3..87fae12 100755
--- a/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/christopherjohnson.pbxuser
@@ -2,7 +2,7 @@
{
089C1669FE841209C02AAC07 /* Project object */ = {
activeBuildConfigurationName = Release;
- activeTarget = 8D01CCC60486CAD60068D4B7 /* AudioUnit */;
+ activeTarget = 8D01CCC60486CAD60068D4B7 /* PurestEcho */;
codeSenseManager = 8B02375F1D42B1C400E1E8C8 /* Code sense */;
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
@@ -49,8 +49,8 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 528461666;
- PBXWorkspaceStateSaveDate = 528461666;
+ PBXPerProjectTemplateStateSaveDate = 569771267;
+ PBXWorkspaceStateSaveDate = 569771267;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
@@ -102,7 +102,7 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
- 8D01CCC60486CAD60068D4B7 /* AudioUnit */ = {
+ 8D01CCC60486CAD60068D4B7 /* PurestEcho */ = {
activeExec = 0;
};
}
diff --git a/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/christopherjohnson.perspectivev3
index f80d304..a80a475 100755
--- a/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/christopherjohnson.perspectivev3
@@ -360,18 +360,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 13}}</string>
+ <string>{{0, 0}, {603, 0}}</string>
<key>RubberWindowFrame</key>
<string>612 265 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>
@@ -385,7 +385,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 401}}</string>
+ <string>{{10, 27}, {603, 414}}</string>
<key>RubberWindowFrame</key>
<string>612 265 810 487 0 0 1440 878 </string>
</dict>
@@ -469,11 +469,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B9D7D2C1F7FAF74007AB60F</string>
+ <string>8B793EC621F6054B006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B9D7D2D1F7FAF74007AB60F</string>
+ <string>8B793EC721F6054B006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8B9D7D2E1F7FAF74007AB60F</string>
+ <string>8B793EC821F6054B006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -626,7 +626,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>528461684.32955098</real>
+ <real>569771339.31522799</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -643,7 +643,6 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B9D7D2F1F7FAF74007AB60F</string>
<string>/Users/christopherjohnson/Desktop/MacVST/PurestEcho/PurestEcho.xcodeproj</string>
</array>
<key>WindowString</key>
diff --git a/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/project.pbxproj b/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/project.pbxproj
index 02231e4..43171c9 100755
--- a/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/project.pbxproj
+++ b/plugins/MacVST/PurestEcho/PurestEcho.xcodeproj/project.pbxproj
@@ -1894,7 +1894,7 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
- 8D01CCC60486CAD60068D4B7 /* AudioUnit */ = {
+ 8D01CCC60486CAD60068D4B7 /* PurestEcho */ = {
isa = PBXNativeTarget;
buildConfigurationList = 24BEAAED08919AE700E695F9 /* Build configuration list for PBXNativeTarget "PurestEcho" */;
buildPhases = (
@@ -1947,7 +1947,7 @@
);
projectRoot = "";
targets = (
- 8D01CCC60486CAD60068D4B7 /* AudioUnit */,
+ 8D01CCC60486CAD60068D4B7 /* PurestEcho */,
);
};
/* End PBXProject section */
diff --git a/plugins/MacVST/PurestEcho/source/PurestEcho.cpp b/plugins/MacVST/PurestEcho/source/PurestEcho.cpp
index 6b8c302..6bcaa3f 100755
--- a/plugins/MacVST/PurestEcho/source/PurestEcho.cpp
+++ b/plugins/MacVST/PurestEcho/source/PurestEcho.cpp
@@ -19,11 +19,8 @@ PurestEcho::PurestEcho(audioMasterCallback audioMaster) :
E = 0.0;
for(int count = 0; count < totalsamples-1; count++) {dL[count] = 0;dR[count] = 0;}
gcount = 0;
- fpNShapeLA = 0.0;
- fpNShapeLB = 0.0;
- fpNShapeRA = 0.0;
- fpNShapeRB = 0.0;
- fpFlip = true;
+ fpNShapeL = 0.0;
+ fpNShapeR = 0.0;
//this is reset: values being initialized only once. Startup values, whatever they are.
_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
diff --git a/plugins/MacVST/PurestEcho/source/PurestEcho.h b/plugins/MacVST/PurestEcho/source/PurestEcho.h
index a298dd2..870e158 100755
--- a/plugins/MacVST/PurestEcho/source/PurestEcho.h
+++ b/plugins/MacVST/PurestEcho/source/PurestEcho.h
@@ -62,11 +62,8 @@ private:
int gcount;
- long double fpNShapeLA;
- long double fpNShapeLB;
- long double fpNShapeRA;
- long double fpNShapeRB;
- bool fpFlip;
+ long double fpNShapeL;
+ long double fpNShapeR;
//default stuff
float A;
diff --git a/plugins/MacVST/PurestEcho/source/PurestEchoProc.cpp b/plugins/MacVST/PurestEcho/source/PurestEchoProc.cpp
index 77e4b2f..e8e141c 100755
--- a/plugins/MacVST/PurestEcho/source/PurestEchoProc.cpp
+++ b/plugins/MacVST/PurestEcho/source/PurestEchoProc.cpp
@@ -76,9 +76,6 @@ void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 samp
double delaysBufferL;
double delaysBufferR;
- float fpTemp;
- long double fpOld = 0.618033988749894848204586; //golden ratio!
- long double fpNew = 1.0 - fpOld;
long double inputSampleL;
long double inputSampleR;
@@ -177,25 +174,14 @@ void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 samp
gcount--;
- //noise shaping to 32-bit floating point
- if (fpFlip) {
- fpTemp = inputSampleL;
- fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeLA;
- fpTemp = inputSampleR;
- fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeRA;
- }
- else {
- fpTemp = inputSampleL;
- fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeLB;
- fpTemp = inputSampleR;
- fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeRB;
- }
- fpFlip = !fpFlip;
- //end noise shaping on 32 bit output
+ //stereo 32 bit dither, made small and tidy.
+ int expon; frexpf((float)inputSampleL, &expon);
+ long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62);
+ inputSampleL += (dither-fpNShapeL); fpNShapeL = dither;
+ frexpf((float)inputSampleR, &expon);
+ dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62);
+ inputSampleR += (dither-fpNShapeR); fpNShapeR = dither;
+ //end 32 bit dither
*out1 = inputSampleL;
*out2 = inputSampleR;
@@ -276,9 +262,6 @@ void PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstIn
double delaysBufferL;
double delaysBufferR;
- double fpTemp; //this is different from singlereplacing
- long double fpOld = 0.618033988749894848204586; //golden ratio!
- long double fpNew = 1.0 - fpOld;
long double inputSampleL;
long double inputSampleR;
@@ -377,25 +360,16 @@ void PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstIn
gcount--;
- //noise shaping to 64-bit floating point
- if (fpFlip) {
- fpTemp = inputSampleL;
- fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeLA;
- fpTemp = inputSampleR;
- fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeRA;
- }
- else {
- fpTemp = inputSampleL;
- fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew);
- inputSampleL += fpNShapeLB;
- fpTemp = inputSampleR;
- fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew);
- inputSampleR += fpNShapeRB;
- }
- fpFlip = !fpFlip;
- //end noise shaping on 64 bit output
+ //stereo 64 bit dither, made small and tidy.
+ int expon; frexp((double)inputSampleL, &expon);
+ long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62);
+ dither /= 536870912.0; //needs this to scale to 64 bit zone
+ inputSampleL += (dither-fpNShapeL); fpNShapeL = dither;
+ frexp((double)inputSampleR, &expon);
+ dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62);
+ dither /= 536870912.0; //needs this to scale to 64 bit zone
+ inputSampleR += (dither-fpNShapeR); fpNShapeR = dither;
+ //end 64 bit dither
*out1 = inputSampleL;
*out2 = inputSampleR;