aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/Righteous4
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/Righteous4
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/Righteous4')
-rwxr-xr-xplugins/MacVST/Righteous4/Righteous4.xcodeproj/christopherjohnson.pbxuser14
-rwxr-xr-xplugins/MacVST/Righteous4/Righteous4.xcodeproj/christopherjohnson.perspectivev321
-rwxr-xr-xplugins/MacVST/Righteous4/source/Righteous4Proc.cpp56
3 files changed, 37 insertions, 54 deletions
diff --git a/plugins/MacVST/Righteous4/Righteous4.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/Righteous4/Righteous4.xcodeproj/christopherjohnson.pbxuser
index c893227..8c45194 100755
--- a/plugins/MacVST/Righteous4/Righteous4.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/Righteous4/Righteous4.xcodeproj/christopherjohnson.pbxuser
@@ -49,11 +49,11 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 548242463;
- PBXWorkspaceStateSaveDate = 548242463;
+ PBXPerProjectTemplateStateSaveDate = 569771492;
+ PBXWorkspaceStateSaveDate = 569771492;
};
perUserProjectItems = {
- 8BBFF86120AD84A2005650EF /* PBXTextBookmark */ = 8BBFF86120AD84A2005650EF /* PBXTextBookmark */;
+ 8B793F3B21F605EC006E9731 /* PBXTextBookmark */ = 8B793F3B21F605EC006E9731 /* PBXTextBookmark */;
8BBFF86220AD84A2005650EF /* PBXTextBookmark */ = 8BBFF86220AD84A2005650EF /* PBXTextBookmark */;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
@@ -62,9 +62,9 @@
};
2407DEB6089929BA00EB68BF /* Righteous4.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {740, 3198}}";
+ sepNavIntBoundsRect = "{{0, 0}, {554, 3081}}";
sepNavSelRange = "{1957, 0}";
- sepNavVisRange = "{1892, 150}";
+ sepNavVisRange = "{1892, 108}";
sepNavWindowFrame = "{{9, 39}, {895, 831}}";
};
};
@@ -106,14 +106,14 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
- 8BBFF86120AD84A2005650EF /* PBXTextBookmark */ = {
+ 8B793F3B21F605EC006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 2407DEB6089929BA00EB68BF /* Righteous4.cpp */;
name = "Righteous4.cpp: 98";
rLen = 0;
rLoc = 1957;
rType = 0;
- vrLen = 150;
+ vrLen = 108;
vrLoc = 1892;
};
8BBFF86220AD84A2005650EF /* PBXTextBookmark */ = {
diff --git a/plugins/MacVST/Righteous4/Righteous4.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/Righteous4/Righteous4.xcodeproj/christopherjohnson.perspectivev3
index 54f4b98..8e2d830 100755
--- a/plugins/MacVST/Righteous4/Righteous4.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/Righteous4/Righteous4.xcodeproj/christopherjohnson.perspectivev3
@@ -351,10 +351,10 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8BBFF86220AD84A2005650EF</string>
+ <string>8B793F3B21F605EC006E9731</string>
<key>history</key>
<array>
- <string>8BBFF86120AD84A2005650EF</string>
+ <string>8BBFF86220AD84A2005650EF</string>
</array>
</dict>
<key>SplitCount</key>
@@ -368,18 +368,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 132}}</string>
+ <string>{{0, 0}, {603, 117}}</string>
<key>RubberWindowFrame</key>
<string>595 333 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>132pt</string>
+ <string>117pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>309pt</string>
+ <string>324pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -393,7 +393,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 282}}</string>
+ <string>{{10, 27}, {603, 297}}</string>
<key>RubberWindowFrame</key>
<string>595 333 810 487 0 0 1440 878 </string>
</dict>
@@ -477,11 +477,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BBFF86320AD84A2005650EF</string>
+ <string>8B793F3C21F605EC006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8BBFF86420AD84A2005650EF</string>
+ <string>8B793F3D21F605EC006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8BBFF86520AD84A2005650EF</string>
+ <string>8B793F3E21F605EC006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -634,7 +634,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>548242594.083197</real>
+ <real>569771500.34394598</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -651,7 +651,6 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8BBFF86620AD84A2005650EF</string>
<string>/Users/christopherjohnson/Desktop/MacVST/Righteous4/Righteous4.xcodeproj</string>
</array>
<key>WindowString</key>
diff --git a/plugins/MacVST/Righteous4/source/Righteous4Proc.cpp b/plugins/MacVST/Righteous4/source/Righteous4Proc.cpp
index 7ed44cf..630360f 100755
--- a/plugins/MacVST/Righteous4/source/Righteous4Proc.cpp
+++ b/plugins/MacVST/Righteous4/source/Righteous4Proc.cpp
@@ -300,17 +300,14 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp
//output dither section
if (bitDepth == 3) {
- //noise shaping to 32-bit floating point
- float fpTemp = inputSampleL;
- fpNShapeL += (inputSampleL-fpTemp);
- inputSampleL += fpNShapeL;
- 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
} else {
//entire Naturalize section used when not on 32 bit out
@@ -515,12 +512,6 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp
*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 Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
@@ -529,11 +520,11 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
- long double fpOld = 0.618033988749894848204586; //golden ratio!
- long double fpNew = 1.0 - fpOld;
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
+ long double fpOld = 0.618033988749894848204586; //golden ratio!
+ long double fpNew = 1.0 - fpOld;
double IIRscaleback = 0.0002597;//scaleback of harmonic avg
IIRscaleback /= overallscale;
IIRscaleback = 1.0 - IIRscaleback;
@@ -816,17 +807,16 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn
//output dither section
if (bitDepth == 3) {
- //noise shaping to 32-bit floating point
- double fpTemp = inputSampleL;
- fpNShapeL += (inputSampleL-fpTemp);
- inputSampleL += fpNShapeL;
- 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 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
} else {
//entire Naturalize section used when not on 32 bit out
@@ -1031,10 +1021,4 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn
*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.
} \ No newline at end of file