aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/BassKit
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/BassKit
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/BassKit')
-rwxr-xr-xplugins/MacVST/BassKit/BassKit.xcodeproj/christopherjohnson.pbxuser38
-rwxr-xr-xplugins/MacVST/BassKit/BassKit.xcodeproj/christopherjohnson.perspectivev364
-rwxr-xr-xplugins/MacVST/BassKit/source/BassKitProc.cpp54
3 files changed, 37 insertions, 119 deletions
diff --git a/plugins/MacVST/BassKit/BassKit.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/BassKit/BassKit.xcodeproj/christopherjohnson.pbxuser
index 7a8a384..71471a7 100755
--- a/plugins/MacVST/BassKit/BassKit.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/BassKit/BassKit.xcodeproj/christopherjohnson.pbxuser
@@ -49,14 +49,12 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 561849688;
- PBXWorkspaceStateSaveDate = 561849688;
+ PBXPerProjectTemplateStateSaveDate = 569718226;
+ PBXWorkspaceStateSaveDate = 569718226;
};
perUserProjectItems = {
- 8B15DC872178931A007AD769 /* PBXTextBookmark */ = 8B15DC872178931A007AD769 /* PBXTextBookmark */;
- 8B15DC8A2178931A007AD769 /* PBXTextBookmark */ = 8B15DC8A2178931A007AD769 /* PBXTextBookmark */;
+ 8B79342421F535E6006E9731 /* PBXTextBookmark */ = 8B79342421F535E6006E9731 /* PBXTextBookmark */;
8BC3BC31217D257A0043A8B7 /* PBXTextBookmark */ = 8BC3BC31217D257A0043A8B7 /* PBXTextBookmark */;
- 8BC3BC35217D257A0043A8B7 /* PBXTextBookmark */ = 8BC3BC35217D257A0043A8B7 /* PBXTextBookmark */;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
@@ -80,7 +78,7 @@
};
24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {838, 19877}}";
+ sepNavIntBoundsRect = "{{0, 0}, {838, 19864}}";
sepNavSelRange = "{10616, 0}";
sepNavVisRange = "{10459, 280}";
sepNavWindowFrame = "{{15, 42}, {895, 831}}";
@@ -88,9 +86,9 @@
};
24D8286F09A914000093AEF8 /* BassKitProc.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {901, 6097}}";
+ sepNavIntBoundsRect = "{{0, 0}, {901, 5759}}";
sepNavSelRange = "{3023, 0}";
- sepNavVisRange = "{1492, 2701}";
+ sepNavVisRange = "{16984, 1948}";
sepNavWindowFrame = "{{41, 39}, {895, 831}}";
};
};
@@ -108,26 +106,16 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
- 8B15DC872178931A007AD769 /* PBXTextBookmark */ = {
+ 8B79342421F535E6006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */;
name = "audioeffectx.cpp: 307";
rLen = 0;
rLoc = 10616;
rType = 0;
- vrLen = 399;
+ vrLen = 280;
vrLoc = 10459;
};
- 8B15DC8A2178931A007AD769 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 24D8286F09A914000093AEF8 /* BassKitProc.cpp */;
- name = "BassKitProc.cpp: 259";
- rLen = 0;
- rLoc = 10702;
- rType = 0;
- vrLen = 1721;
- vrLoc = 9607;
- };
8BC3BC31217D257A0043A8B7 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */;
@@ -138,16 +126,6 @@
vrLen = 280;
vrLoc = 10459;
};
- 8BC3BC35217D257A0043A8B7 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 24D8286F09A914000093AEF8 /* BassKitProc.cpp */;
- name = "BassKitProc.cpp: 91";
- rLen = 0;
- rLoc = 3023;
- rType = 0;
- vrLen = 2701;
- vrLoc = 1492;
- };
8D01CCC60486CAD60068D4B7 /* BassKit */ = {
activeExec = 0;
};
diff --git a/plugins/MacVST/BassKit/BassKit.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/BassKit/BassKit.xcodeproj/christopherjohnson.perspectivev3
index f720cd0..4925ffa 100755
--- a/plugins/MacVST/BassKit/BassKit.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/BassKit/BassKit.xcodeproj/christopherjohnson.perspectivev3
@@ -222,48 +222,7 @@
</dict>
</array>
<key>OpenEditors</key>
- <array>
- <dict>
- <key>Content</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>8B15DC882178931A007AD769</string>
- <key>PBXProjectModuleLabel</key>
- <string>BassKitProc.cpp</string>
- <key>PBXSplitModuleInNavigatorKey</key>
- <dict>
- <key>Split0</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>8B15DC892178931A007AD769</string>
- <key>PBXProjectModuleLabel</key>
- <string>BassKitProc.cpp</string>
- <key>_historyCapacity</key>
- <integer>0</integer>
- <key>bookmark</key>
- <string>8BC3BC35217D257A0043A8B7</string>
- <key>history</key>
- <array>
- <string>8B15DC8A2178931A007AD769</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}, {895, 734}}</string>
- <key>PBXModuleWindowStatusBarHidden2</key>
- <false/>
- <key>RubberWindowFrame</key>
- <string>41 95 895 775 0 0 1440 878 </string>
- </dict>
- </dict>
- </array>
+ <array/>
<key>PerspectiveWidths</key>
<array>
<integer>810</integer>
@@ -392,10 +351,10 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8BC3BC31217D257A0043A8B7</string>
+ <string>8B79342421F535E6006E9731</string>
<key>history</key>
<array>
- <string>8B15DC872178931A007AD769</string>
+ <string>8BC3BC31217D257A0043A8B7</string>
</array>
</dict>
<key>SplitCount</key>
@@ -409,18 +368,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 117}}</string>
+ <string>{{0, 0}, {603, 102}}</string>
<key>RubberWindowFrame</key>
<string>103 354 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>117pt</string>
+ <string>102pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>324pt</string>
+ <string>339pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -434,7 +393,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 297}}</string>
+ <string>{{10, 27}, {603, 312}}</string>
<key>RubberWindowFrame</key>
<string>103 354 810 487 0 0 1440 878 </string>
</dict>
@@ -518,11 +477,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BC3BC32217D257A0043A8B7</string>
+ <string>8B79342521F535E6006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8BC3BC33217D257A0043A8B7</string>
+ <string>8B79342621F535E6006E9731</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8BC3BC34217D257A0043A8B7</string>
+ <string>8B79342721F535E6006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -675,7 +634,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>561849722.95006502</real>
+ <real>569718246.60174298</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -693,7 +652,6 @@
<key>WindowOrderList</key>
<array>
<string>/Users/christopherjohnson/Desktop/MacVST/BassKit/BassKit.xcodeproj</string>
- <string>8B15DC882178931A007AD769</string>
</array>
<key>WindowString</key>
<string>103 354 810 487 0 0 1440 878 </string>
diff --git a/plugins/MacVST/BassKit/source/BassKitProc.cpp b/plugins/MacVST/BassKit/source/BassKitProc.cpp
index df3310e..9199c82 100755
--- a/plugins/MacVST/BassKit/source/BassKitProc.cpp
+++ b/plugins/MacVST/BassKit/source/BassKitProc.cpp
@@ -204,18 +204,14 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF
bflip++;
if (bflip < 1 || bflip > 3) bflip = 1;
- //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;
@@ -225,12 +221,6 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF
*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 BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
@@ -430,18 +420,16 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32
bflip++;
if (bflip < 1 || bflip > 3) bflip = 1;
- //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;
@@ -451,10 +439,4 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32
*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.
}