aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/AtmosphereChannel
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/AtmosphereChannel
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/AtmosphereChannel')
-rwxr-xr-xplugins/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.pbxuser64
-rwxr-xr-xplugins/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.perspectivev342
-rwxr-xr-xplugins/MacVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp56
3 files changed, 84 insertions, 78 deletions
diff --git a/plugins/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.pbxuser
index f90657e..2f73690 100755
--- a/plugins/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.pbxuser
@@ -49,12 +49,14 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 546562888;
- PBXWorkspaceStateSaveDate = 546562888;
+ PBXPerProjectTemplateStateSaveDate = 569718117;
+ PBXWorkspaceStateSaveDate = 569718117;
};
perUserProjectItems = {
- 8BC5CF292093F3420058B257 /* PBXTextBookmark */ = 8BC5CF292093F3420058B257 /* PBXTextBookmark */;
- 8BC5CF5A2093F4C50058B257 /* PBXTextBookmark */ = 8BC5CF5A2093F4C50058B257 /* PBXTextBookmark */;
+ 8B7933C421F5356E006E9731 /* PBXTextBookmark */ = 8B7933C421F5356E006E9731 /* PBXTextBookmark */;
+ 8B904B70209D2FF5008CBAD8 /* PBXTextBookmark */ = 8B904B70209D2FF5008CBAD8 /* PBXTextBookmark */;
+ 8B904BB3209D3409008CBAD8 /* PBXTextBookmark */ = 8B904BB3209D3409008CBAD8 /* PBXTextBookmark */;
+ 8BFBE952209D206700E1438C /* PBXTextBookmark */ = 8BFBE952209D206700E1438C /* PBXTextBookmark */;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
@@ -62,17 +64,17 @@
};
2407DEB6089929BA00EB68BF /* AtmosphereChannel.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {754, 1716}}";
+ sepNavIntBoundsRect = "{{0, 0}, {754, 1976}}";
sepNavSelRange = "{4879, 0}";
- sepNavVisRange = "{2108, 329}";
+ sepNavVisRange = "{2134, 303}";
sepNavWindowFrame = "{{291, 47}, {895, 831}}";
};
};
245463B80991757100464AD3 /* AtmosphereChannel.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {866, 1391}}";
+ sepNavIntBoundsRect = "{{0, 0}, {817, 1378}}";
sepNavSelRange = "{2886, 0}";
- sepNavVisRange = "{0, 2464}";
+ sepNavVisRange = "{2348, 116}";
sepNavWindowFrame = "{{20, 47}, {895, 831}}";
};
};
@@ -86,10 +88,10 @@
};
24D8286F09A914000093AEF8 /* AtmosphereChannelProc.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {848, 7046}}";
- sepNavSelRange = "{10357, 9646}";
- sepNavVisRange = "{9730, 1796}";
- sepNavWindowFrame = "{{570, 47}, {895, 831}}";
+ sepNavIntBoundsRect = "{{0, 0}, {747, 6825}}";
+ sepNavSelRange = "{9679, 0}";
+ sepNavVisRange = "{9613, 109}";
+ sepNavWindowFrame = "{{545, 45}, {895, 831}}";
};
};
8B02375E1D42B1C400E1E8C8 /* Source Control */ = {
@@ -106,25 +108,45 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
- 8BC5CF292093F3420058B257 /* PBXTextBookmark */ = {
+ 8B7933C421F5356E006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
- fRef = 2407DEB6089929BA00EB68BF /* AtmosphereChannel.cpp */;
- name = "AtmosphereChannel.cpp: 146";
+ fRef = 24D8286F09A914000093AEF8 /* AtmosphereChannelProc.cpp */;
+ name = "AtmosphereChannelProc.cpp: 266";
rLen = 0;
- rLoc = 4879;
+ rLoc = 9679;
+ rType = 0;
+ vrLen = 109;
+ vrLoc = 9613;
+ };
+ 8B904B70209D2FF5008CBAD8 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 245463B80991757100464AD3 /* AtmosphereChannel.h */;
+ name = "AtmosphereChannel.h: 73";
+ rLen = 0;
+ rLoc = 2886;
+ rType = 0;
+ vrLen = 116;
+ vrLoc = 2348;
+ };
+ 8B904BB3209D3409008CBAD8 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 24D8286F09A914000093AEF8 /* AtmosphereChannelProc.cpp */;
+ name = "AtmosphereChannelProc.cpp: 262";
+ rLen = 0;
+ rLoc = 9679;
rType = 0;
- vrLen = 329;
- vrLoc = 2108;
+ vrLen = 52;
+ vrLoc = 9647;
};
- 8BC5CF5A2093F4C50058B257 /* PBXTextBookmark */ = {
+ 8BFBE952209D206700E1438C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 2407DEB6089929BA00EB68BF /* AtmosphereChannel.cpp */;
name = "AtmosphereChannel.cpp: 146";
rLen = 0;
rLoc = 4879;
rType = 0;
- vrLen = 329;
- vrLoc = 2108;
+ vrLen = 303;
+ vrLoc = 2134;
};
8D01CCC60486CAD60068D4B7 /* AtmosphereChannel */ = {
activeExec = 0;
diff --git a/plugins/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.perspectivev3
index 3cbeff8..75a73d9 100755
--- a/plugins/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj/christopherjohnson.perspectivev3
@@ -256,6 +256,8 @@
<key>Layout</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -298,7 +300,7 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>7</integer>
+ <integer>6</integer>
<integer>4</integer>
<integer>0</integer>
</array>
@@ -321,7 +323,7 @@
<real>185</real>
</array>
<key>RubberWindowFrame</key>
- <string>17 313 810 487 0 0 1440 878 </string>
+ <string>630 297 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -337,7 +339,7 @@
<key>PBXProjectModuleGUID</key>
<string>8B0237581D42B1C400E1E8C8</string>
<key>PBXProjectModuleLabel</key>
- <string>AtmosphereChannel.cpp</string>
+ <string>AtmosphereChannelProc.cpp</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -345,14 +347,16 @@
<key>PBXProjectModuleGUID</key>
<string>8B0237591D42B1C400E1E8C8</string>
<key>PBXProjectModuleLabel</key>
- <string>AtmosphereChannel.cpp</string>
+ <string>AtmosphereChannelProc.cpp</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8BC5CF5A2093F4C50058B257</string>
+ <string>8B7933C421F5356E006E9731</string>
<key>history</key>
<array>
- <string>8BC5CF292093F3420058B257</string>
+ <string>8BFBE952209D206700E1438C</string>
+ <string>8B904B70209D2FF5008CBAD8</string>
+ <string>8B904BB3209D3409008CBAD8</string>
</array>
</dict>
<key>SplitCount</key>
@@ -366,18 +370,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 117}}</string>
+ <string>{{0, 0}, {603, 51}}</string>
<key>RubberWindowFrame</key>
- <string>17 313 810 487 0 0 1440 878 </string>
+ <string>630 297 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>117pt</string>
+ <string>51pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>324pt</string>
+ <string>390pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -391,7 +395,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 297}}</string>
+ <string>{{10, 27}, {603, 363}}</string>
+ <key>RubberWindowFrame</key>
+ <string>630 297 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -446,8 +452,6 @@
<dict>
<key>Frame</key>
<string>{{10, 27}, {603, 297}}</string>
- <key>RubberWindowFrame</key>
- <string>17 313 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -475,11 +479,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BC5CECB2093E3520058B257</string>
+ <string>8B7933C521F5356E006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8BC5CECC2093E3520058B257</string>
+ <string>8B7933C621F5356E006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8BC5CECD2093E3520058B257</string>
+ <string>8B7933C721F5356E006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -632,7 +636,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>546567365.81376398</real>
+ <real>569718126.81761706</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -649,10 +653,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>/Users/christopherjohnson/Desktop/AtmosphereChannel/AtmosphereChannel.xcodeproj</string>
+ <string>/Users/christopherjohnson/Desktop/MacVST/AtmosphereChannel/AtmosphereChannel.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>17 313 810 487 0 0 1440 878 </string>
+ <string>630 297 810 487 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>
diff --git a/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp b/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp
index 97038e8..bbdf44c 100755
--- a/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp
+++ b/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp
@@ -13,7 +13,6 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
- float fpTemp;
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
@@ -245,18 +244,14 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt
lastSampleAR = drySampleR;
//store the raw R input sample again for use next time
- //noise shaping to 32-bit floating point
- 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;
@@ -266,12 +261,6 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt
*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 AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
@@ -280,7 +269,6 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
- double fpTemp;
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
@@ -512,18 +500,16 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs
lastSampleAR = drySampleR;
//store the raw R input sample again for use next time
- //noise shaping to 64-bit floating point
- 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;
@@ -533,10 +519,4 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs
*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