diff options
Diffstat (limited to 'plugins/MacVST/Hermepass')
5 files changed, 60 insertions, 87 deletions
diff --git a/plugins/MacVST/Hermepass/Hermepass.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/Hermepass/Hermepass.xcodeproj/christopherjohnson.pbxuser index 46149d5..7c8d8e8 100755 --- a/plugins/MacVST/Hermepass/Hermepass.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacVST/Hermepass/Hermepass.xcodeproj/christopherjohnson.pbxuser @@ -49,12 +49,12 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 528460642; - PBXWorkspaceStateSaveDate = 528460642; + PBXPerProjectTemplateStateSaveDate = 569767979; + PBXWorkspaceStateSaveDate = 569767979; }; perUserProjectItems = { - 8B9D6CBE1F7EE9E7007AB60F /* PBXTextBookmark */ = 8B9D6CBE1F7EE9E7007AB60F /* PBXTextBookmark */; - 8B9D7A8F1F7FAB72007AB60F /* PBXTextBookmark */ = 8B9D7A8F1F7FAB72007AB60F /* PBXTextBookmark */; + 8B793B7321F5F897006E9731 /* PBXTextBookmark */ = 8B793B7321F5F897006E9731 /* PBXTextBookmark */; + 8B793B7821F5F8CF006E9731 /* PBXTextBookmark */ = 8B793B7821F5F8CF006E9731 /* PBXTextBookmark */; }; sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */; userBuildSettings = { @@ -62,23 +62,23 @@ }; 2407DEB6089929BA00EB68BF /* Hermepass.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {848, 1950}}"; - sepNavSelRange = "{469, 0}"; - sepNavVisRange = "{2904, 2073}"; + sepNavIntBoundsRect = "{{0, 0}, {848, 1963}}"; + sepNavSelRange = "{713, 0}"; + sepNavVisRange = "{0, 1657}"; sepNavWindowFrame = "{{12, 47}, {895, 831}}"; }; }; 245463B80991757100464AD3 /* Hermepass.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {866, 1131}}"; - sepNavSelRange = "{3408, 0}"; - sepNavVisRange = "{654, 2864}"; + sepNavIntBoundsRect = "{{0, 0}, {866, 1092}}"; + sepNavSelRange = "{3416, 0}"; + sepNavVisRange = "{619, 2845}"; sepNavWindowFrame = "{{20, 47}, {895, 831}}"; }; }; 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {747, 19864}}"; + sepNavIntBoundsRect = "{{0, 0}, {747, 19877}}"; sepNavSelRange = "{10616, 0}"; sepNavVisRange = "{0, 0}"; sepNavWindowFrame = "{{15, 42}, {895, 831}}"; @@ -106,17 +106,17 @@ isa = PBXCodeSenseManager; indexTemplatePath = ""; }; - 8B9D6CBE1F7EE9E7007AB60F /* PBXTextBookmark */ = { + 8B793B7321F5F897006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */; name = "audioeffectx.cpp: 307"; rLen = 0; rLoc = 10616; rType = 0; - vrLen = 123; - vrLoc = 10613; + vrLen = 0; + vrLoc = 0; }; - 8B9D7A8F1F7FAB72007AB60F /* PBXTextBookmark */ = { + 8B793B7821F5F8CF006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */; name = "audioeffectx.cpp: 307"; diff --git a/plugins/MacVST/Hermepass/Hermepass.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/Hermepass/Hermepass.xcodeproj/christopherjohnson.perspectivev3 index 48045b3..5ca3881 100755 --- a/plugins/MacVST/Hermepass/Hermepass.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacVST/Hermepass/Hermepass.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>303 293 810 487 0 0 1440 878 </string> + <string>278 293 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -351,10 +351,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B9D7A8F1F7FAB72007AB60F</string> + <string>8B793B7821F5F8CF006E9731</string> <key>history</key> <array> - <string>8B9D6CBE1F7EE9E7007AB60F</string> + <string>8B793B7321F5F897006E9731</string> </array> </dict> <key>SplitCount</key> @@ -368,18 +368,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {603, 32}}</string> + <string>{{0, 0}, {603, 13}}</string> <key>RubberWindowFrame</key> - <string>303 293 810 487 0 0 1440 878 </string> + <string>278 293 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>32pt</string> + <string>13pt</string> </dict> <dict> <key>Proportion</key> - <string>409pt</string> + <string>428pt</string> <key>Tabs</key> <array> <dict> @@ -393,9 +393,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 382}}</string> - <key>RubberWindowFrame</key> - <string>303 293 810 487 0 0 1440 878 </string> + <string>{{10, 27}, {603, 401}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -449,7 +447,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 345}}</string> + <string>{{10, 27}, {603, 401}}</string> + <key>RubberWindowFrame</key> + <string>278 293 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -477,11 +477,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B9D7A901F7FAB72007AB60F</string> + <string>8B793B7921F5F8CF006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B9D7A911F7FAB72007AB60F</string> + <string>8B793B7A21F5F8CF006E9731</string> <string>8B0237581D42B1C400E1E8C8</string> - <string>8B9D7A921F7FAB72007AB60F</string> + <string>8B793B7B21F5F8CF006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -634,7 +634,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>528460658.10219902</real> + <real>569768143.68088698</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -651,11 +651,10 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8B9D7A931F7FAB72007AB60F</string> <string>/Users/christopherjohnson/Desktop/MacVST/Hermepass/Hermepass.xcodeproj</string> </array> <key>WindowString</key> - <string>303 293 810 487 0 0 1440 878 </string> + <string>278 293 810 487 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> diff --git a/plugins/MacVST/Hermepass/source/Hermepass.cpp b/plugins/MacVST/Hermepass/source/Hermepass.cpp index 3bfb1aa..4e4a532 100755 --- a/plugins/MacVST/Hermepass/source/Hermepass.cpp +++ b/plugins/MacVST/Hermepass/source/Hermepass.cpp @@ -32,12 +32,9 @@ Hermepass::Hermepass(audioMasterCallback audioMaster) : iirFR = 0.0; iirGR = 0.0; iirHR = 0.0; - - 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/Hermepass/source/Hermepass.h b/plugins/MacVST/Hermepass/source/Hermepass.h index 4f29497..1000bb9 100755 --- a/plugins/MacVST/Hermepass/source/Hermepass.h +++ b/plugins/MacVST/Hermepass/source/Hermepass.h @@ -53,11 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeLA; - long double fpNShapeLB; - long double fpNShapeRA; - long double fpNShapeRB; - bool fpFlip; + long double fpNShapeL; + long double fpNShapeR; //default stuff double iirAL; double iirBL; //first stage is the flipping one, for lowest slope. It is always engaged, and is the highest one @@ -76,7 +73,7 @@ private: double iirFR; //our slope control will have a pow() on it so that the high orders are way to the right side double iirGR; double iirHR; //seven poles max, and the final pole is always at 20hz directly. - + bool fpFlip; float A; diff --git a/plugins/MacVST/Hermepass/source/HermepassProc.cpp b/plugins/MacVST/Hermepass/source/HermepassProc.cpp index 01b35aa..fddffe3 100755 --- a/plugins/MacVST/Hermepass/source/HermepassProc.cpp +++ b/plugins/MacVST/Hermepass/source/HermepassProc.cpp @@ -17,10 +17,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - float fpTemp; long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - + long double fpNew = 1.0 - fpOld; double rangescale = 0.1 / overallscale; double cutoff = pow(A,3); @@ -175,26 +173,17 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR -= correction; //end R channel - - //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; @@ -216,10 +205,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - double fpTemp; //this is different from singlereplacing long double fpOld = 0.618033988749894848204586; //golden ratio! long double fpNew = 1.0 - fpOld; - double rangescale = 0.1 / overallscale; double cutoff = pow(A,3); @@ -374,26 +361,19 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR -= correction; //end R channel - - //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; |