aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/Pop
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/Pop
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/Pop')
-rwxr-xr-xplugins/MacVST/Pop/Pop.xcodeproj/christopherjohnson.pbxuser8
-rwxr-xr-xplugins/MacVST/Pop/Pop.xcodeproj/christopherjohnson.perspectivev311
-rwxr-xr-xplugins/MacVST/Pop/Pop.xcodeproj/project.pbxproj4
-rwxr-xr-xplugins/MacVST/Pop/source/PopProc.cpp54
4 files changed, 29 insertions, 48 deletions
diff --git a/plugins/MacVST/Pop/Pop.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/Pop/Pop.xcodeproj/christopherjohnson.pbxuser
index 899cc09..f19a7b1 100755
--- a/plugins/MacVST/Pop/Pop.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/Pop/Pop.xcodeproj/christopherjohnson.pbxuser
@@ -2,7 +2,7 @@
{
089C1669FE841209C02AAC07 /* Project object */ = {
activeBuildConfigurationName = Release;
- activeTarget = 8D01CCC60486CAD60068D4B7 /* Pop */;
+ activeTarget = 8D01CCC60486CAD60068D4B7 /* AudioUnit */;
codeSenseManager = 8B02375F1D42B1C400E1E8C8 /* Code sense */;
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
@@ -49,8 +49,8 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 557537791;
- PBXWorkspaceStateSaveDate = 557537791;
+ PBXPerProjectTemplateStateSaveDate = 569770952;
+ PBXWorkspaceStateSaveDate = 569770952;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
@@ -102,7 +102,7 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
- 8D01CCC60486CAD60068D4B7 /* Pop */ = {
+ 8D01CCC60486CAD60068D4B7 /* AudioUnit */ = {
activeExec = 0;
};
}
diff --git a/plugins/MacVST/Pop/Pop.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/Pop/Pop.xcodeproj/christopherjohnson.perspectivev3
index 85b0e48..58d4d71 100755
--- a/plugins/MacVST/Pop/Pop.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/Pop/Pop.xcodeproj/christopherjohnson.perspectivev3
@@ -469,11 +469,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B6DBAC4213B60BA00E44739</string>
+ <string>8B793DFA21F603D1006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B6DBAC5213B60BA00E44739</string>
+ <string>8B793DFB21F603D1006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8B6DBAC6213B60BA00E44739</string>
+ <string>8B793DFC21F603D1006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -626,7 +626,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>557539514.49375904</real>
+ <real>569770961.06224799</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -643,8 +643,7 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B6DBAC7213B60BA00E44739</string>
- <string>/Users/christopherjohnson/Desktop/Pop/Pop.xcodeproj</string>
+ <string>/Users/christopherjohnson/Desktop/MacVST/Pop/Pop.xcodeproj</string>
</array>
<key>WindowString</key>
<string>181 239 810 487 0 0 1440 878 </string>
diff --git a/plugins/MacVST/Pop/Pop.xcodeproj/project.pbxproj b/plugins/MacVST/Pop/Pop.xcodeproj/project.pbxproj
index a8ba4b6..1a2bcdf 100755
--- a/plugins/MacVST/Pop/Pop.xcodeproj/project.pbxproj
+++ b/plugins/MacVST/Pop/Pop.xcodeproj/project.pbxproj
@@ -1894,7 +1894,7 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
- 8D01CCC60486CAD60068D4B7 /* Pop */ = {
+ 8D01CCC60486CAD60068D4B7 /* AudioUnit */ = {
isa = PBXNativeTarget;
buildConfigurationList = 24BEAAED08919AE700E695F9 /* Build configuration list for PBXNativeTarget "Pop" */;
buildPhases = (
@@ -1947,7 +1947,7 @@
);
projectRoot = "";
targets = (
- 8D01CCC60486CAD60068D4B7 /* Pop */,
+ 8D01CCC60486CAD60068D4B7 /* AudioUnit */,
);
};
/* End PBXProject section */
diff --git a/plugins/MacVST/Pop/source/PopProc.cpp b/plugins/MacVST/Pop/source/PopProc.cpp
index ae7dd4d..baa9420 100755
--- a/plugins/MacVST/Pop/source/PopProc.cpp
+++ b/plugins/MacVST/Pop/source/PopProc.cpp
@@ -268,18 +268,14 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame
inputSampleR = (drySampleR*(1.0-wet))+(inputSampleR*wet);
}
- //noise shaping to 32-bit floating point
- float fpTemp = inputSampleL;
- fpNShapeL += (inputSampleL-fpTemp);
- inputSampleL += fpNShapeL;
- //if this confuses you look at the wordlength for fpTemp :)
- fpTemp = inputSampleR;
- fpNShapeR += (inputSampleR-fpTemp);
- inputSampleR += fpNShapeR;
- //for deeper space and warmth, we try a non-oscillating noise shaping
- //that is kind of ruthless: it will forever retain the rounding errors
- //except we'll dial it back a hair at the end of every buffer processed
- //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;
@@ -289,12 +285,6 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame
*out1++;
*out2++;
}
- fpNShapeL *= 0.999999;
- fpNShapeR *= 0.999999;
- //we will just delicately dial back the FP noise shaping, not even every sample
- //this is a good place to put subtle 'no runaway' calculations, though bear in mind
- //that it will be called more often when you use shorter sample buffers in the DAW.
- //So, very low latency operation will call these calculations more often.
}
void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
@@ -558,18 +548,16 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam
inputSampleR = (drySampleR*(1.0-wet))+(inputSampleR*wet);
}
- //noise shaping to 64-bit floating point
- double fpTemp = inputSampleL;
- fpNShapeL += (inputSampleL-fpTemp);
- inputSampleL += fpNShapeL;
- //if this confuses you look at the wordlength for fpTemp :)
- fpTemp = inputSampleR;
- fpNShapeR += (inputSampleR-fpTemp);
- inputSampleR += fpNShapeR;
- //for deeper space and warmth, we try a non-oscillating noise shaping
- //that is kind of ruthless: it will forever retain the rounding errors
- //except we'll dial it back a hair at the end of every buffer processed
- //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;
@@ -579,10 +567,4 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam
*out1++;
*out2++;
}
- fpNShapeL *= 0.999999;
- fpNShapeR *= 0.999999;
- //we will just delicately dial back the FP noise shaping, not even every sample
- //this is a good place to put subtle 'no runaway' calculations, though bear in mind
- //that it will be called more often when you use shorter sample buffers in the DAW.
- //So, very low latency operation will call these calculations more often.
}