diff options
author | Chris Johnson <jinx6568@sover.net> | 2019-02-19 08:35:31 -0500 |
---|---|---|
committer | Chris Johnson <jinx6568@sover.net> | 2019-02-19 08:35:31 -0500 |
commit | 83f022409ae017f4ac947430b4ec185f0196badc (patch) | |
tree | 0695ba5bdb872cd72356a62c280fbef490c5aac4 /plugins/MacVST | |
parent | e5da517d26576cbae2f3bc64fc0b9733a5555815 (diff) | |
download | airwindows-lv2-port-83f022409ae017f4ac947430b4ec185f0196badc.tar.gz airwindows-lv2-port-83f022409ae017f4ac947430b4ec185f0196badc.tar.bz2 airwindows-lv2-port-83f022409ae017f4ac947430b4ec185f0196badc.zip |
DitherFloat update
Diffstat (limited to 'plugins/MacVST')
5 files changed, 129 insertions, 63 deletions
diff --git a/plugins/MacVST/DitherFloat/DitherFloat.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/DitherFloat/DitherFloat.xcodeproj/christopherjohnson.pbxuser index 1fc2619..e742ecf 100755 --- a/plugins/MacVST/DitherFloat/DitherFloat.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacVST/DitherFloat/DitherFloat.xcodeproj/christopherjohnson.pbxuser @@ -49,12 +49,15 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 569801710; - PBXWorkspaceStateSaveDate = 569801710; + PBXPerProjectTemplateStateSaveDate = 572274028; + PBXWorkspaceStateSaveDate = 572274028; }; perUserProjectItems = { - 8BEF85B121F6801400FEF113 /* XCBuildMessageTextBookmark */ = 8BEF85B121F6801400FEF113 /* XCBuildMessageTextBookmark */; - 8BEF85B621F6802400FEF113 /* PBXTextBookmark */ = 8BEF85B621F6802400FEF113 /* PBXTextBookmark */; + 8B6F22ED221C35E90084A947 /* PBXBookmark */ = 8B6F22ED221C35E90084A947 /* PBXBookmark */; + 8B6F22F6221C37910084A947 /* PBXTextBookmark */ = 8B6F22F6221C37910084A947 /* PBXTextBookmark */; + 8B6F22F7221C37910084A947 /* XCBuildMessageTextBookmark */ = 8B6F22F7221C37910084A947 /* XCBuildMessageTextBookmark */; + 8B6F22F8221C37910084A947 /* PBXTextBookmark */ = 8B6F22F8221C37910084A947 /* PBXTextBookmark */; + 8B6F22FB221C37910084A947 /* PBXTextBookmark */ = 8B6F22FB221C37910084A947 /* PBXTextBookmark */; }; sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */; userBuildSettings = { @@ -62,34 +65,34 @@ }; 2407DEB6089929BA00EB68BF /* DitherFloat.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {848, 1664}}"; - sepNavSelRange = "{3601, 0}"; - sepNavVisRange = "{2649, 2103}"; + sepNavIntBoundsRect = "{{0, 0}, {848, 1651}}"; + sepNavSelRange = "{496, 0}"; + sepNavVisRange = "{0, 2132}"; sepNavWindowFrame = "{{166, 47}, {895, 831}}"; }; }; 245463B80991757100464AD3 /* DitherFloat.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {866, 845}}"; - sepNavSelRange = "{2508, 0}"; - sepNavVisRange = "{292, 2228}"; - sepNavWindowFrame = "{{20, 47}, {895, 831}}"; + sepNavIntBoundsRect = "{{0, 0}, {866, 832}}"; + sepNavSelRange = "{2416, 0}"; + sepNavVisRange = "{268, 2219}"; + sepNavWindowFrame = "{{471, 47}, {895, 831}}"; }; }; 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {859, 20267}}"; + sepNavIntBoundsRect = "{{0, 0}, {838, 19760}}"; sepNavSelRange = "{10616, 0}"; - sepNavVisRange = "{9653, 2414}"; + sepNavVisRange = "{10459, 280}"; sepNavWindowFrame = "{{15, 42}, {895, 831}}"; }; }; 24D8286F09A914000093AEF8 /* DitherFloatProc.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {649, 2652}}"; - sepNavSelRange = "{569, 0}"; - sepNavVisRange = "{451, 169}"; - sepNavWindowFrame = "{{68, 47}, {895, 831}}"; + sepNavIntBoundsRect = "{{0, 0}, {848, 2431}}"; + sepNavSelRange = "{5133, 0}"; + sepNavVisRange = "{0, 1576}"; + sepNavWindowFrame = "{{64, 47}, {895, 831}}"; }; }; 8B02375E1D42B1C400E1E8C8 /* Source Control */ = { @@ -106,24 +109,48 @@ isa = PBXCodeSenseManager; indexTemplatePath = ""; }; - 8BEF85B121F6801400FEF113 /* XCBuildMessageTextBookmark */ = { + 8B6F22ED221C35E90084A947 /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = 24D8286F09A914000093AEF8 /* DitherFloatProc.cpp */; + }; + 8B6F22F6221C37910084A947 /* PBXTextBookmark */ = { isa = PBXTextBookmark; - comments = "Unused variable 'blend'"; fRef = 24D8286F09A914000093AEF8 /* DitherFloatProc.cpp */; + name = "DitherFloatProc.cpp: 22"; + rLen = 0; + rLoc = 569; + rType = 0; + vrLen = 139; + vrLoc = 479; + }; + 8B6F22F7221C37910084A947 /* XCBuildMessageTextBookmark */ = { + isa = PBXTextBookmark; + comments = "Deprecated conversion from string constant to 'char*'"; + fRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */; fallbackIsa = XCBuildMessageTextBookmark; rLen = 1; - rLoc = 21; + rLoc = 306; rType = 1; }; - 8BEF85B621F6802400FEF113 /* PBXTextBookmark */ = { + 8B6F22F8221C37910084A947 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */; + name = "audioeffectx.cpp: 307"; + rLen = 0; + rLoc = 10616; + rType = 0; + vrLen = 280; + vrLoc = 10459; + }; + 8B6F22FB221C37910084A947 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 24D8286F09A914000093AEF8 /* DitherFloatProc.cpp */; - name = "DitherFloatProc.cpp: 22"; + name = "DitherFloatProc.cpp: 164"; rLen = 0; - rLoc = 569; + rLoc = 5133; rType = 0; - vrLen = 169; - vrLoc = 451; + vrLen = 1576; + vrLoc = 0; }; 8D01CCC60486CAD60068D4B7 /* DitherFloat */ = { activeExec = 0; diff --git a/plugins/MacVST/DitherFloat/DitherFloat.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/DitherFloat/DitherFloat.xcodeproj/christopherjohnson.perspectivev3 index 3612d29..d671f7c 100755 --- a/plugins/MacVST/DitherFloat/DitherFloat.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacVST/DitherFloat/DitherFloat.xcodeproj/christopherjohnson.perspectivev3 @@ -222,7 +222,48 @@ </dict> </array> <key>OpenEditors</key> - <array/> + <array> + <dict> + <key>Content</key> + <dict> + <key>PBXProjectModuleGUID</key> + <string>8B6F22F9221C37910084A947</string> + <key>PBXProjectModuleLabel</key> + <string>DitherFloatProc.cpp</string> + <key>PBXSplitModuleInNavigatorKey</key> + <dict> + <key>Split0</key> + <dict> + <key>PBXProjectModuleGUID</key> + <string>8B6F22FA221C37910084A947</string> + <key>PBXProjectModuleLabel</key> + <string>DitherFloatProc.cpp</string> + <key>_historyCapacity</key> + <integer>0</integer> + <key>bookmark</key> + <string>8B6F22FB221C37910084A947</string> + <key>history</key> + <array> + <string>8B6F22ED221C35E90084A947</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>64 103 895 775 0 0 1440 878 </string> + </dict> + </dict> + </array> <key>PerspectiveWidths</key> <array> <integer>810</integer> @@ -321,7 +362,7 @@ <real>185</real> </array> <key>RubberWindowFrame</key> - <string>291 285 810 487 0 0 1440 878 </string> + <string>121 270 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -337,7 +378,7 @@ <key>PBXProjectModuleGUID</key> <string>8B0237581D42B1C400E1E8C8</string> <key>PBXProjectModuleLabel</key> - <string>DitherFloatProc.cpp</string> + <string>audioeffectx.cpp</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> @@ -345,14 +386,15 @@ <key>PBXProjectModuleGUID</key> <string>8B0237591D42B1C400E1E8C8</string> <key>PBXProjectModuleLabel</key> - <string>DitherFloatProc.cpp</string> + <string>audioeffectx.cpp</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8BEF85B621F6802400FEF113</string> + <string>8B6F22F8221C37910084A947</string> <key>history</key> <array> - <string>8BEF85B121F6801400FEF113</string> + <string>8B6F22F6221C37910084A947</string> + <string>8B6F22F7221C37910084A947</string> </array> </dict> <key>SplitCount</key> @@ -366,18 +408,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {603, 132}}</string> + <string>{{0, 0}, {603, 117}}</string> <key>RubberWindowFrame</key> - <string>291 285 810 487 0 0 1440 878 </string> + <string>121 270 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>132pt</string> + <string>117pt</string> </dict> <dict> <key>Proportion</key> - <string>309pt</string> + <string>324pt</string> <key>Tabs</key> <array> <dict> @@ -391,7 +433,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 414}}</string> + <string>{{10, 27}, {603, 297}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -445,9 +487,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 282}}</string> + <string>{{10, 27}, {603, 297}}</string> <key>RubberWindowFrame</key> - <string>291 285 810 487 0 0 1440 878 </string> + <string>121 270 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -475,11 +517,11 @@ </array> <key>TableOfContents</key> <array> - <string>8BEF853D21F67C3100FEF113</string> + <string>8B6F22CF221C35700084A947</string> <string>1CA23ED40692098700951B8B</string> - <string>8BEF853E21F67C3100FEF113</string> + <string>8B6F22D0221C35700084A947</string> <string>8B0237581D42B1C400E1E8C8</string> - <string>8BEF853F21F67C3100FEF113</string> + <string>8B6F22D1221C35700084A947</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -632,7 +674,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>569802788.52883804</real> + <real>572274577.26009297</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -649,10 +691,11 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>/Users/christopherjohnson/Desktop/DitherFloat/DitherFloat.xcodeproj</string> + <string>8B6F22F9221C37910084A947</string> + <string>/Users/christopherjohnson/Desktop/MacVST/DitherFloat/DitherFloat.xcodeproj</string> </array> <key>WindowString</key> - <string>291 285 810 487 0 0 1440 878 </string> + <string>121 270 810 487 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> diff --git a/plugins/MacVST/DitherFloat/source/DitherFloat.cpp b/plugins/MacVST/DitherFloat/source/DitherFloat.cpp index ffd9e94..05213a6 100755 --- a/plugins/MacVST/DitherFloat/source/DitherFloat.cpp +++ b/plugins/MacVST/DitherFloat/source/DitherFloat.cpp @@ -14,8 +14,7 @@ DitherFloat::DitherFloat(audioMasterCallback audioMaster) : { A = 0.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpd = 17; //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/DitherFloat/source/DitherFloat.h b/plugins/MacVST/DitherFloat/source/DitherFloat.h index b8ddf51..08cce74 100755 --- a/plugins/MacVST/DitherFloat/source/DitherFloat.h +++ b/plugins/MacVST/DitherFloat/source/DitherFloat.h @@ -53,8 +53,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpd; //default stuff float A; diff --git a/plugins/MacVST/DitherFloat/source/DitherFloatProc.cpp b/plugins/MacVST/DitherFloat/source/DitherFloatProc.cpp index 3c76a1a..a7121e8 100755 --- a/plugins/MacVST/DitherFloat/source/DitherFloatProc.cpp +++ b/plugins/MacVST/DitherFloat/source/DitherFloatProc.cpp @@ -67,16 +67,15 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam long double inputSampleR = *in2 + (gain-1); - - //stereo 32 bit dither, made small and tidy. + + //begin stereo 32 bit floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62) * blend; //remove 'blend' for real use, it's for the demo; - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; + inputSampleL += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62) * blend; //remove 'blend' for real use, it's for the demo; - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither - + fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; + inputSampleR += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; + //end stereo 32 bit floating point dither inputSampleL = (float)inputSampleL; //equivalent of 'floor' for 32 bit floating point @@ -154,15 +153,14 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI - //stereo 32 bit dither, made small and tidy. + //begin stereo 32 bit floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62) * blend; //remove 'blend' for real use, it's for the demo; - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; + inputSampleL += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62) * blend; //remove 'blend' for real use, it's for the demo; - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither - + fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; + inputSampleR += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; + //end stereo 32 bit floating point dither inputSampleL = (float)inputSampleL; //equivalent of 'floor' for 32 bit floating point |