diff options
author | Chris Johnson <jinx6568@sover.net> | 2019-01-27 21:13:54 -0500 |
---|---|---|
committer | Chris Johnson <jinx6568@sover.net> | 2019-01-27 21:13:54 -0500 |
commit | 966f2d253cd2ee6ce140ad68095a20a9d2b63052 (patch) | |
tree | b0400d95bd06512531ade6ddf55190a58b6a5623 /plugins/MacVST/AQuickVoiceClip | |
parent | 0887543349dbbec0721a1fc8b1c7deba9afefa8b (diff) | |
download | airwindows-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/AQuickVoiceClip')
5 files changed, 36 insertions, 71 deletions
diff --git a/plugins/MacVST/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.pbxuser index 9ff059e..56e51e7 100755 --- a/plugins/MacVST/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacVST/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.pbxuser @@ -49,11 +49,11 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 528459055; - PBXWorkspaceStateSaveDate = 528459055; + PBXPerProjectTemplateStateSaveDate = 569707744; + PBXWorkspaceStateSaveDate = 569707744; }; perUserProjectItems = { - 8B1949391F0F1A0500C5FAB9 /* PBXTextBookmark */ = 8B1949391F0F1A0500C5FAB9 /* PBXTextBookmark */; + 8B79338421F50CE8006E9731 /* PBXTextBookmark */ = 8B79338421F50CE8006E9731 /* PBXTextBookmark */; 8B9D774E1F7FA54A007AB60F /* PBXTextBookmark */ = 8B9D774E1F7FA54A007AB60F /* PBXTextBookmark */; }; sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */; @@ -70,7 +70,7 @@ }; 245463B80991757100464AD3 /* AQuickVoiceClip.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {554, 1976}}"; + sepNavIntBoundsRect = "{{0, 0}, {554, 1690}}"; sepNavSelRange = "{3742, 0}"; sepNavVisRange = "{0, 0}"; sepNavWindowFrame = "{{514, 47}, {895, 831}}"; @@ -106,7 +106,7 @@ isa = PBXCodeSenseManager; indexTemplatePath = ""; }; - 8B1949391F0F1A0500C5FAB9 /* PBXTextBookmark */ = { + 8B79338421F50CE8006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 245463B80991757100464AD3 /* AQuickVoiceClip.h */; name = "AQuickVoiceClip.h: 117"; diff --git a/plugins/MacVST/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.perspectivev3 index 57c47dc..ce95340 100755 --- a/plugins/MacVST/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacVST/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.perspectivev3 @@ -256,8 +256,6 @@ <key>Layout</key> <array> <dict> - <key>BecomeActive</key> - <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> @@ -351,10 +349,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B9D774E1F7FA54A007AB60F</string> + <string>8B79338421F50CE8006E9731</string> <key>history</key> <array> - <string>8B1949391F0F1A0500C5FAB9</string> + <string>8B9D774E1F7FA54A007AB60F</string> </array> </dict> <key>SplitCount</key> @@ -394,8 +392,6 @@ <dict> <key>Frame</key> <string>{{10, 27}, {603, 414}}</string> - <key>RubberWindowFrame</key> - <string>384 225 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -449,7 +445,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 401}}</string> + <string>{{10, 27}, {603, 414}}</string> + <key>RubberWindowFrame</key> + <string>384 225 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -477,11 +475,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B9D774F1F7FA54A007AB60F</string> + <string>8B79338521F50CE8006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B9D77501F7FA54A007AB60F</string> + <string>8B79338621F50CE8006E9731</string> <string>8B0237581D42B1C400E1E8C8</string> - <string>8B9D77511F7FA54A007AB60F</string> + <string>8B79338721F50CE8006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -634,7 +632,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>528459082.86255097</real> + <real>569707752.54956698</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -651,7 +649,6 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8B9D77521F7FA54A007AB60F</string> <string>/Users/christopherjohnson/Desktop/MacVST/AQuickVoiceClip/AQuickVoiceClip.xcodeproj</string> </array> <key>WindowString</key> diff --git a/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp index 9b5ea81..9b84221 100755 --- a/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp +++ b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp @@ -57,11 +57,8 @@ AQuickVoiceClip::AQuickVoiceClip(audioMasterCallback audioMaster) : ataK4 = 0.886; //remainder of interpolated dry, adds up to 1.0 ataK5 = 0.431; //subtract this much prev. diff sample, brightens. 0.431 becomes flat - 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/AQuickVoiceClip/source/AQuickVoiceClip.h b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.h index dc8f5fa..40cfab2 100755 --- a/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.h +++ b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.h @@ -115,11 +115,8 @@ private: double RiirSampleD; 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/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp index 69dc283..cc282b6 100755 --- a/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp +++ b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp @@ -41,9 +41,6 @@ void AQuickVoiceClip::processReplacing(float **inputs, float **outputs, VstInt32 double RoutputSample; double RdrySample; - float fpTemp; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; long double inputSampleL; long double inputSampleR; @@ -410,25 +407,14 @@ void AQuickVoiceClip::processReplacing(float **inputs, float **outputs, VstInt32 if (LlpDepth < 0.0) LlpDepth = 0.0; if (RlpDepth < 0.0) RlpDepth = 0.0; - //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 inputSampleL *= (1.0-LmaxRecent); inputSampleR *= (1.0-RmaxRecent); @@ -487,9 +473,6 @@ void AQuickVoiceClip::processDoubleReplacing(double **inputs, double **outputs, double RoutputSample; double RdrySample; - double fpTemp; //this is different from singlereplacing - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; long double inputSampleL; long double inputSampleR; @@ -856,25 +839,16 @@ void AQuickVoiceClip::processDoubleReplacing(double **inputs, double **outputs, if (LlpDepth < 0.0) LlpDepth = 0.0; if (RlpDepth < 0.0) RlpDepth = 0.0; - //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 inputSampleL *= (1.0-LmaxRecent); inputSampleR *= (1.0-RmaxRecent); |