aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/NCSeventeen
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/NCSeventeen
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/NCSeventeen')
-rwxr-xr-xplugins/MacVST/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.pbxuser48
-rwxr-xr-xplugins/MacVST/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.perspectivev364
-rwxr-xr-xplugins/MacVST/NCSeventeen/source/NCSeventeen.cpp7
-rwxr-xr-xplugins/MacVST/NCSeventeen/source/NCSeventeen.h7
-rwxr-xr-xplugins/MacVST/NCSeventeen/source/NCSeventeenProc.cpp62
5 files changed, 49 insertions, 139 deletions
diff --git a/plugins/MacVST/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.pbxuser
index 33122fe..b951dba 100755
--- a/plugins/MacVST/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.pbxuser
@@ -49,16 +49,14 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 531745203;
- PBXWorkspaceStateSaveDate = 531745203;
+ PBXPerProjectTemplateStateSaveDate = 569770459;
+ PBXWorkspaceStateSaveDate = 569770459;
};
perUserProjectItems = {
8B6692F41FB1C728007B3434 /* PBXTextBookmark */ = 8B6692F41FB1C728007B3434 /* PBXTextBookmark */;
- 8B6692F61FB1C728007B3434 /* PBXTextBookmark */ = 8B6692F61FB1C728007B3434 /* PBXTextBookmark */;
8B67C7A21FA3B4CC008C64D6 /* PBXTextBookmark */ = 8B67C7A21FA3B4CC008C64D6 /* PBXTextBookmark */;
- 8BE0C0611FB1C9B7000B2082 /* PBXBookmark */ = 8BE0C0611FB1C9B7000B2082 /* PBXBookmark */;
+ 8B793CFA21F601E6006E9731 /* PBXTextBookmark */ = 8B793CFA21F601E6006E9731 /* PBXTextBookmark */;
8BE0C0701FB1C9E6000B2082 /* PBXTextBookmark */ = 8BE0C0701FB1C9E6000B2082 /* PBXTextBookmark */;
- 8BE0C0761FB1C9E6000B2082 /* PBXTextBookmark */ = 8BE0C0761FB1C9E6000B2082 /* PBXTextBookmark */;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
@@ -74,9 +72,9 @@
};
245463B80991757100464AD3 /* NCSeventeen.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {859, 1092}}";
+ sepNavIntBoundsRect = "{{0, 0}, {817, 1105}}";
sepNavSelRange = "{2660, 0}";
- sepNavVisRange = "{2280, 147}";
+ sepNavVisRange = "{2320, 107}";
sepNavWindowFrame = "{{20, 47}, {895, 831}}";
};
};
@@ -90,9 +88,9 @@
};
24D8286F09A914000093AEF8 /* NCSeventeenProc.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1250, 9984}}";
+ sepNavIntBoundsRect = "{{0, 0}, {1250, 9802}}";
sepNavSelRange = "{1603, 0}";
- sepNavVisRange = "{15480, 1916}";
+ sepNavVisRange = "{15441, 2003}";
sepNavWindowFrame = "{{13, 39}, {1297, 839}}";
};
};
@@ -120,16 +118,6 @@
vrLen = 159;
vrLoc = 16026;
};
- 8B6692F61FB1C728007B3434 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 245463B80991757100464AD3 /* NCSeventeen.h */;
- name = "NCSeventeen.h: 69";
- rLen = 0;
- rLoc = 2660;
- rType = 0;
- vrLen = 258;
- vrLoc = 2169;
- };
8B67C7A21FA3B4CC008C64D6 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */;
@@ -140,29 +128,25 @@
vrLen = 399;
vrLoc = 10459;
};
- 8BE0C0611FB1C9B7000B2082 /* PBXBookmark */ = {
- isa = PBXBookmark;
- fRef = 24D8286F09A914000093AEF8 /* NCSeventeenProc.cpp */;
- };
- 8BE0C0701FB1C9E6000B2082 /* PBXTextBookmark */ = {
+ 8B793CFA21F601E6006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 245463B80991757100464AD3 /* NCSeventeen.h */;
name = "NCSeventeen.h: 69";
rLen = 0;
rLoc = 2660;
rType = 0;
- vrLen = 147;
- vrLoc = 2280;
+ vrLen = 107;
+ vrLoc = 2320;
};
- 8BE0C0761FB1C9E6000B2082 /* PBXTextBookmark */ = {
+ 8BE0C0701FB1C9E6000B2082 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
- fRef = 24D8286F09A914000093AEF8 /* NCSeventeenProc.cpp */;
- name = "NCSeventeenProc.cpp: 58";
+ fRef = 245463B80991757100464AD3 /* NCSeventeen.h */;
+ name = "NCSeventeen.h: 69";
rLen = 0;
- rLoc = 1603;
+ rLoc = 2660;
rType = 0;
- vrLen = 1916;
- vrLoc = 15480;
+ vrLen = 147;
+ vrLoc = 2280;
};
8D01CCC60486CAD60068D4B7 /* NCSeventeen */ = {
activeExec = 0;
diff --git a/plugins/MacVST/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.perspectivev3
index 3b7ecb3..89e1157 100755
--- a/plugins/MacVST/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.perspectivev3
@@ -222,48 +222,7 @@
</dict>
</array>
<key>OpenEditors</key>
- <array>
- <dict>
- <key>Content</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>8BE0C0741FB1C9E6000B2082</string>
- <key>PBXProjectModuleLabel</key>
- <string>NCSeventeenProc.cpp</string>
- <key>PBXSplitModuleInNavigatorKey</key>
- <dict>
- <key>Split0</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>8BE0C0751FB1C9E6000B2082</string>
- <key>PBXProjectModuleLabel</key>
- <string>NCSeventeenProc.cpp</string>
- <key>_historyCapacity</key>
- <integer>0</integer>
- <key>bookmark</key>
- <string>8BE0C0761FB1C9E6000B2082</string>
- <key>history</key>
- <array>
- <string>8BE0C0611FB1C9B7000B2082</string>
- </array>
- </dict>
- <key>SplitCount</key>
- <string>1</string>
- </dict>
- <key>StatusBarVisibility</key>
- <true/>
- </dict>
- <key>Geometry</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 20}, {1297, 742}}</string>
- <key>PBXModuleWindowStatusBarHidden2</key>
- <false/>
- <key>RubberWindowFrame</key>
- <string>13 95 1297 783 0 0 1440 878 </string>
- </dict>
- </dict>
- </array>
+ <array/>
<key>PerspectiveWidths</key>
<array>
<integer>810</integer>
@@ -392,12 +351,12 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8BE0C0701FB1C9E6000B2082</string>
+ <string>8B793CFA21F601E6006E9731</string>
<key>history</key>
<array>
<string>8B67C7A21FA3B4CC008C64D6</string>
<string>8B6692F41FB1C728007B3434</string>
- <string>8B6692F61FB1C728007B3434</string>
+ <string>8BE0C0701FB1C9E6000B2082</string>
</array>
</dict>
<key>SplitCount</key>
@@ -411,18 +370,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 102}}</string>
+ <string>{{0, 0}, {603, 86}}</string>
<key>RubberWindowFrame</key>
<string>249 231 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>102pt</string>
+ <string>86pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>339pt</string>
+ <string>355pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -436,7 +395,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 312}}</string>
+ <string>{{10, 27}, {603, 328}}</string>
<key>RubberWindowFrame</key>
<string>249 231 810 487 0 0 1440 878 </string>
</dict>
@@ -520,11 +479,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BE0C0711FB1C9E6000B2082</string>
+ <string>8B793CFB21F601E6006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8BE0C0721FB1C9E6000B2082</string>
+ <string>8B793CFC21F601E6006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8BE0C0731FB1C9E6000B2082</string>
+ <string>8B793CFD21F601E6006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -677,7 +636,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>531745254.79790598</real>
+ <real>569770470.40799499</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -695,7 +654,6 @@
<key>WindowOrderList</key>
<array>
<string>/Users/christopherjohnson/Desktop/MacVST/NCSeventeen/NCSeventeen.xcodeproj</string>
- <string>8BE0C0741FB1C9E6000B2082</string>
</array>
<key>WindowString</key>
<string>249 231 810 487 0 0 1440 878 </string>
diff --git a/plugins/MacVST/NCSeventeen/source/NCSeventeen.cpp b/plugins/MacVST/NCSeventeen/source/NCSeventeen.cpp
index 9bc129a..409f983 100755
--- a/plugins/MacVST/NCSeventeen/source/NCSeventeen.cpp
+++ b/plugins/MacVST/NCSeventeen/source/NCSeventeen.cpp
@@ -31,11 +31,8 @@ NCSeventeen::NCSeventeen(audioMasterCallback audioMaster) :
flip = false;
- 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/NCSeventeen/source/NCSeventeen.h b/plugins/MacVST/NCSeventeen/source/NCSeventeen.h
index 01179e9..b3ecd94 100755
--- a/plugins/MacVST/NCSeventeen/source/NCSeventeen.h
+++ b/plugins/MacVST/NCSeventeen/source/NCSeventeen.h
@@ -70,11 +70,8 @@ private:
bool flip;
- 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/NCSeventeen/source/NCSeventeenProc.cpp b/plugins/MacVST/NCSeventeen/source/NCSeventeenProc.cpp
index b2f2aa1..e124cb5 100755
--- a/plugins/MacVST/NCSeventeen/source/NCSeventeenProc.cpp
+++ b/plugins/MacVST/NCSeventeen/source/NCSeventeenProc.cpp
@@ -19,9 +19,6 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam
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 IIRscaleback = 0.0004716;
double bassScaleback = 0.0002364;
@@ -347,25 +344,14 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam
if (inputSampleR < -0.95) inputSampleR = -0.95;
//iron bar
- //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;
@@ -389,9 +375,6 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI
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 IIRscaleback = 0.0004716;
double bassScaleback = 0.0002364;
@@ -716,25 +699,16 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI
if (inputSampleR < -0.95) inputSampleR = -0.95;
//iron bar
- //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;