aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/Console5DarkCh
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/Console5DarkCh
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/Console5DarkCh')
-rwxr-xr-xplugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/christopherjohnson.pbxuser8
-rwxr-xr-xplugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/christopherjohnson.perspectivev318
-rwxr-xr-xplugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/project.pbxproj4
-rwxr-xr-xplugins/MacVST/Console5DarkCh/source/Console5DarkCh.cpp7
-rwxr-xr-xplugins/MacVST/Console5DarkCh/source/Console5DarkCh.h7
-rwxr-xr-xplugins/MacVST/Console5DarkCh/source/Console5DarkChProc.cpp62
6 files changed, 37 insertions, 69 deletions
diff --git a/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/christopherjohnson.pbxuser
index 22f68fb..a2f82e3 100755
--- a/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/christopherjohnson.pbxuser
@@ -2,7 +2,7 @@
{
089C1669FE841209C02AAC07 /* Project object */ = {
activeBuildConfigurationName = Release;
- activeTarget = 8D01CCC60486CAD60068D4B7 /* Console5DarkCh */;
+ activeTarget = 8D01CCC60486CAD60068D4B7 /* AudioUnit */;
codeSenseManager = 8B02375F1D42B1C400E1E8C8 /* Code sense */;
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
@@ -49,8 +49,8 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 537050480;
- PBXWorkspaceStateSaveDate = 537050480;
+ PBXPerProjectTemplateStateSaveDate = 569734052;
+ PBXWorkspaceStateSaveDate = 569734052;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
@@ -102,7 +102,7 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
- 8D01CCC60486CAD60068D4B7 /* Console5DarkCh */ = {
+ 8D01CCC60486CAD60068D4B7 /* AudioUnit */ = {
activeExec = 0;
};
}
diff --git a/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/christopherjohnson.perspectivev3
index 023b57c..ccf0ad5 100755
--- a/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/christopherjohnson.perspectivev3
@@ -323,7 +323,7 @@
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>634 254 810 487 0 0 1440 878 </string>
+ <string>630 254 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -362,7 +362,7 @@
<key>Frame</key>
<string>{{0, 0}, {603, 0}}</string>
<key>RubberWindowFrame</key>
- <string>634 254 810 487 0 0 1440 878 </string>
+ <string>630 254 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
@@ -387,7 +387,7 @@
<key>Frame</key>
<string>{{10, 27}, {603, 414}}</string>
<key>RubberWindowFrame</key>
- <string>634 254 810 487 0 0 1440 878 </string>
+ <string>630 254 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -469,11 +469,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B4D275E2002BF6F0051360A</string>
+ <string>8B7936D021F573AD006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B4D275F2002BF6F0051360A</string>
+ <string>8B7936D121F573AD006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8B4D27602002BF6F0051360A</string>
+ <string>8B7936D221F573AD006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -626,7 +626,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>537050991.40073204</real>
+ <real>569734061.13556397</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -643,10 +643,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>/Users/christopherjohnson/Desktop/Console5DarkCh/Console5DarkCh.xcodeproj</string>
+ <string>/Users/christopherjohnson/Desktop/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>634 254 810 487 0 0 1440 878 </string>
+ <string>630 254 810 487 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>
diff --git a/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/project.pbxproj b/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/project.pbxproj
index 5cebff5..3fc2cb2 100755
--- a/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/project.pbxproj
+++ b/plugins/MacVST/Console5DarkCh/Console5DarkCh.xcodeproj/project.pbxproj
@@ -1894,7 +1894,7 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
- 8D01CCC60486CAD60068D4B7 /* Console5DarkCh */ = {
+ 8D01CCC60486CAD60068D4B7 /* AudioUnit */ = {
isa = PBXNativeTarget;
buildConfigurationList = 24BEAAED08919AE700E695F9 /* Build configuration list for PBXNativeTarget "Console5DarkCh" */;
buildPhases = (
@@ -1947,7 +1947,7 @@
);
projectRoot = "";
targets = (
- 8D01CCC60486CAD60068D4B7 /* Console5DarkCh */,
+ 8D01CCC60486CAD60068D4B7 /* AudioUnit */,
);
};
/* End PBXProject section */
diff --git a/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.cpp b/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.cpp
index 0d613a9..350a6b3 100755
--- a/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.cpp
+++ b/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.cpp
@@ -22,11 +22,8 @@ Console5DarkCh::Console5DarkCh(audioMasterCallback audioMaster) :
gainchase = -90.0;
settingchase = -90.0;
chasespeed = 350.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/Console5DarkCh/source/Console5DarkCh.h b/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.h
index 558e4f7..3265f5c 100755
--- a/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.h
+++ b/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.h
@@ -61,11 +61,8 @@ private:
double gainchase;
double settingchase;
double chasespeed;
- 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/Console5DarkCh/source/Console5DarkChProc.cpp b/plugins/MacVST/Console5DarkCh/source/Console5DarkChProc.cpp
index e17ff88c..ba3a842 100755
--- a/plugins/MacVST/Console5DarkCh/source/Console5DarkChProc.cpp
+++ b/plugins/MacVST/Console5DarkCh/source/Console5DarkChProc.cpp
@@ -17,9 +17,6 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
- float fpTemp;
- long double fpOld = 0.618033988749894848204586; //golden ratio!
- long double fpNew = 1.0 - fpOld;
double inputgain = A;
double differenceL;
@@ -152,25 +149,14 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32
inputSampleR = sin(inputSampleR);
//amplitude aspect
- //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;
@@ -192,9 +178,6 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
- double fpTemp;
- long double fpOld = 0.618033988749894848204586; //golden ratio!
- long double fpNew = 1.0 - fpOld;
double inputgain = A;
double differenceL;
@@ -327,25 +310,16 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V
inputSampleR = sin(inputSampleR);
//amplitude aspect
- //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;