aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/Channel6
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/Channel6
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/Channel6')
-rwxr-xr-xplugins/MacVST/Channel6/Channel6.xcodeproj/christopherjohnson.pbxuser43
-rwxr-xr-xplugins/MacVST/Channel6/Channel6.xcodeproj/christopherjohnson.perspectivev336
-rwxr-xr-xplugins/MacVST/Channel6/source/Channel6Proc.cpp54
3 files changed, 63 insertions, 70 deletions
diff --git a/plugins/MacVST/Channel6/Channel6.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/Channel6/Channel6.xcodeproj/christopherjohnson.pbxuser
index 4f94aef..ca06db1 100755
--- a/plugins/MacVST/Channel6/Channel6.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/Channel6/Channel6.xcodeproj/christopherjohnson.pbxuser
@@ -49,13 +49,14 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 553996149;
- PBXWorkspaceStateSaveDate = 553996149;
+ PBXPerProjectTemplateStateSaveDate = 569801998;
+ PBXWorkspaceStateSaveDate = 569801998;
};
perUserProjectItems = {
8BBD195D21054F810015A233 /* PBXTextBookmark */ = 8BBD195D21054F810015A233 /* PBXTextBookmark */;
- 8BBD195E21054F810015A233 /* PBXBookmark */ = 8BBD195E21054F810015A233 /* PBXBookmark */;
- 8BBD195F21054F810015A233 /* PBXTextBookmark */ = 8BBD195F21054F810015A233 /* PBXTextBookmark */;
+ 8BEF857021F67D4F00FEF113 /* PBXTextBookmark */ = 8BEF857021F67D4F00FEF113 /* PBXTextBookmark */;
+ 8BEF857121F67D4F00FEF113 /* PBXBookmark */ = 8BEF857121F67D4F00FEF113 /* PBXBookmark */;
+ 8BEF857221F67D4F00FEF113 /* PBXTextBookmark */ = 8BEF857221F67D4F00FEF113 /* PBXTextBookmark */;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
@@ -63,9 +64,9 @@
};
2407DEB6089929BA00EB68BF /* Channel6.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {848, 2197}}";
+ sepNavIntBoundsRect = "{{0, 0}, {740, 2106}}";
sepNavSelRange = "{663, 0}";
- sepNavVisRange = "{0, 1975}";
+ sepNavVisRange = "{5547, 903}";
sepNavWindowFrame = "{{12, 47}, {895, 831}}";
};
};
@@ -87,9 +88,9 @@
};
24D8286F09A914000093AEF8 /* Channel6Proc.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {712, 3939}}";
+ sepNavIntBoundsRect = "{{0, 0}, {712, 3510}}";
sepNavSelRange = "{9237, 0}";
- sepNavVisRange = "{1490, 318}";
+ sepNavVisRange = "{1588, 1022}";
sepNavWindowFrame = "{{4, 47}, {895, 831}}";
};
};
@@ -117,19 +118,29 @@
vrLen = 280;
vrLoc = 10459;
};
- 8BBD195E21054F810015A233 /* PBXBookmark */ = {
- isa = PBXBookmark;
- fRef = 24D8286F09A914000093AEF8 /* Channel6Proc.cpp */;
- };
- 8BBD195F21054F810015A233 /* PBXTextBookmark */ = {
+ 8BEF857021F67D4F00FEF113 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 24D8286F09A914000093AEF8 /* Channel6Proc.cpp */;
- name = "Channel6Proc.cpp: 267";
+ name = "Channel6Proc.cpp: 265";
rLen = 0;
rLoc = 9237;
rType = 0;
- vrLen = 318;
- vrLoc = 1490;
+ vrLen = 1022;
+ vrLoc = 1588;
+ };
+ 8BEF857121F67D4F00FEF113 /* PBXBookmark */ = {
+ isa = PBXBookmark;
+ fRef = 2407DEB6089929BA00EB68BF /* Channel6.cpp */;
+ };
+ 8BEF857221F67D4F00FEF113 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 2407DEB6089929BA00EB68BF /* Channel6.cpp */;
+ name = "Channel6.cpp: 26";
+ rLen = 0;
+ rLoc = 663;
+ rType = 0;
+ vrLen = 903;
+ vrLoc = 5547;
};
8D01CCC60486CAD60068D4B7 /* Channel6 */ = {
activeExec = 0;
diff --git a/plugins/MacVST/Channel6/Channel6.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/Channel6/Channel6.xcodeproj/christopherjohnson.perspectivev3
index 9dbd71c..e269302 100755
--- a/plugins/MacVST/Channel6/Channel6.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/Channel6/Channel6.xcodeproj/christopherjohnson.perspectivev3
@@ -300,7 +300,7 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>6</integer>
+ <integer>5</integer>
<integer>4</integer>
<integer>0</integer>
</array>
@@ -323,7 +323,7 @@
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>18 291 810 487 0 0 1440 878 </string>
+ <string>475 316 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -339,7 +339,7 @@
<key>PBXProjectModuleGUID</key>
<string>8B0237581D42B1C400E1E8C8</string>
<key>PBXProjectModuleLabel</key>
- <string>Channel6Proc.cpp</string>
+ <string>Channel6.cpp</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -347,15 +347,16 @@
<key>PBXProjectModuleGUID</key>
<string>8B0237591D42B1C400E1E8C8</string>
<key>PBXProjectModuleLabel</key>
- <string>Channel6Proc.cpp</string>
+ <string>Channel6.cpp</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8BBD195F21054F810015A233</string>
+ <string>8BEF857221F67D4F00FEF113</string>
<key>history</key>
<array>
<string>8BBD195D21054F810015A233</string>
- <string>8BBD195E21054F810015A233</string>
+ <string>8BEF857021F67D4F00FEF113</string>
+ <string>8BEF857121F67D4F00FEF113</string>
</array>
</dict>
<key>SplitCount</key>
@@ -369,18 +370,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 117}}</string>
+ <string>{{0, 0}, {603, 353}}</string>
<key>RubberWindowFrame</key>
- <string>18 291 810 487 0 0 1440 878 </string>
+ <string>475 316 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>117pt</string>
+ <string>353pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>324pt</string>
+ <string>88pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -394,9 +395,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 297}}</string>
+ <string>{{10, 27}, {603, 61}}</string>
<key>RubberWindowFrame</key>
- <string>18 291 810 487 0 0 1440 878 </string>
+ <string>475 316 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -478,11 +479,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BBD196021054F810015A233</string>
+ <string>8BEF857321F67D4F00FEF113</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8BBD196121054F810015A233</string>
+ <string>8BEF857421F67D4F00FEF113</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8BBD196221054F810015A233</string>
+ <string>8BEF857521F67D4F00FEF113</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -635,7 +636,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>553996161.14167202</real>
+ <real>569802063.73693204</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -652,11 +653,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8BBD196321054F810015A233</string>
<string>/Users/christopherjohnson/Desktop/MacVST/Channel6/Channel6.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>18 291 810 487 0 0 1440 878 </string>
+ <string>475 316 810 487 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>
diff --git a/plugins/MacVST/Channel6/source/Channel6Proc.cpp b/plugins/MacVST/Channel6/source/Channel6Proc.cpp
index d206851..9f16b2a 100755
--- a/plugins/MacVST/Channel6/source/Channel6Proc.cpp
+++ b/plugins/MacVST/Channel6/source/Channel6Proc.cpp
@@ -121,18 +121,14 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample
inputSampleR *= output;
}
- //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;
@@ -142,12 +138,6 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample
*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 Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
@@ -264,18 +254,16 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3
inputSampleR *= output;
}
- //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;
@@ -285,10 +273,4 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3
*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.
}