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/PurestConsoleChannel | |
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/PurestConsoleChannel')
14 files changed, 55 insertions, 145 deletions
diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.pbxuser index cd6b4c4..9f0edd0 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.pbxuser @@ -49,14 +49,12 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 535163135; - PBXWorkspaceStateSaveDate = 535163135; + PBXPerProjectTemplateStateSaveDate = 569771151; + PBXWorkspaceStateSaveDate = 569771151; }; perUserProjectItems = { - 8BBE45161FE5F1980022E6F7 /* PBXBookmark */ = 8BBE45161FE5F1980022E6F7 /* PBXBookmark */; - 8BBE45251FE5F2760022E6F7 /* XCBuildMessageTextBookmark */ = 8BBE45251FE5F2760022E6F7 /* XCBuildMessageTextBookmark */; - 8BBE45261FE5F2760022E6F7 /* PBXTextBookmark */ = 8BBE45261FE5F2760022E6F7 /* PBXTextBookmark */; - 8BBE45291FE5F2760022E6F7 /* PBXTextBookmark */ = 8BBE45291FE5F2760022E6F7 /* PBXTextBookmark */; + 8B793E7C21F604AB006E9731 /* XCBuildMessageTextBookmark */ = 8B793E7C21F604AB006E9731 /* XCBuildMessageTextBookmark */; + 8B793E7D21F604AB006E9731 /* PBXTextBookmark */ = 8B793E7D21F604AB006E9731 /* PBXTextBookmark */; }; sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */; userBuildSettings = { @@ -64,9 +62,9 @@ }; 2407DEB6089929BA00EB68BF /* PurestConsoleChannel.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {663, 1508}}"; - sepNavSelRange = "{2286, 0}"; - sepNavVisRange = "{2321, 276}"; + sepNavIntBoundsRect = "{{0, 0}, {663, 1417}}"; + sepNavSelRange = "{2230, 0}"; + sepNavVisRange = "{2139, 260}"; sepNavWindowFrame = "{{12, 47}, {895, 831}}"; }; }; @@ -88,9 +86,9 @@ }; 24D8286F09A914000093AEF8 /* PurestConsoleChannelProc.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {848, 2522}}"; + sepNavIntBoundsRect = "{{0, 0}, {848, 2132}}"; sepNavSelRange = "{5889, 0}"; - sepNavVisRange = "{94, 2079}"; + sepNavVisRange = "{899, 2244}"; sepNavWindowFrame = "{{8, 47}, {895, 831}}"; }; }; @@ -108,38 +106,24 @@ isa = PBXCodeSenseManager; indexTemplatePath = ""; }; - 8BBE45161FE5F1980022E6F7 /* PBXBookmark */ = { - isa = PBXBookmark; - fRef = 24D8286F09A914000093AEF8 /* PurestConsoleChannelProc.cpp */; - }; - 8BBE45251FE5F2760022E6F7 /* XCBuildMessageTextBookmark */ = { + 8B793E7C21F604AB006E9731 /* XCBuildMessageTextBookmark */ = { isa = PBXTextBookmark; comments = "Unused variable 'chunkData'"; fRef = 2407DEB6089929BA00EB68BF /* PurestConsoleChannel.cpp */; fallbackIsa = XCBuildMessageTextBookmark; rLen = 1; - rLoc = 53; + rLoc = 50; rType = 1; }; - 8BBE45261FE5F2760022E6F7 /* PBXTextBookmark */ = { + 8B793E7D21F604AB006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 2407DEB6089929BA00EB68BF /* PurestConsoleChannel.cpp */; - name = "PurestConsoleChannel.cpp: 54"; - rLen = 0; - rLoc = 2286; - rType = 0; - vrLen = 276; - vrLoc = 2321; - }; - 8BBE45291FE5F2760022E6F7 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 24D8286F09A914000093AEF8 /* PurestConsoleChannelProc.cpp */; - name = "PurestConsoleChannelProc.cpp: 158"; + name = "PurestConsoleChannel.cpp: 51"; rLen = 0; - rLoc = 5889; + rLoc = 2230; rType = 0; - vrLen = 2079; - vrLoc = 94; + vrLen = 260; + vrLoc = 2139; }; 8D01CCC60486CAD60068D4B7 /* PurestConsoleChannel */ = { activeExec = 0; diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.perspectivev3 index 91b4416..948cc4a 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.perspectivev3 @@ -222,48 +222,7 @@ </dict> </array> <key>OpenEditors</key> - <array> - <dict> - <key>Content</key> - <dict> - <key>PBXProjectModuleGUID</key> - <string>8BBE45271FE5F2760022E6F7</string> - <key>PBXProjectModuleLabel</key> - <string>PurestConsoleChannelProc.cpp</string> - <key>PBXSplitModuleInNavigatorKey</key> - <dict> - <key>Split0</key> - <dict> - <key>PBXProjectModuleGUID</key> - <string>8BBE45281FE5F2760022E6F7</string> - <key>PBXProjectModuleLabel</key> - <string>PurestConsoleChannelProc.cpp</string> - <key>_historyCapacity</key> - <integer>0</integer> - <key>bookmark</key> - <string>8BBE45291FE5F2760022E6F7</string> - <key>history</key> - <array> - <string>8BBE45161FE5F1980022E6F7</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>8 103 895 775 0 0 1440 878 </string> - </dict> - </dict> - </array> + <array/> <key>PerspectiveWidths</key> <array> <integer>810</integer> @@ -362,7 +321,7 @@ <real>236</real> </array> <key>RubberWindowFrame</key> - <string>13 375 810 487 0 0 1440 878 </string> + <string>406 301 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -390,10 +349,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8BBE45261FE5F2760022E6F7</string> + <string>8B793E7D21F604AB006E9731</string> <key>history</key> <array> - <string>8BBE45251FE5F2760022E6F7</string> + <string>8B793E7C21F604AB006E9731</string> </array> </dict> <key>SplitCount</key> @@ -407,18 +366,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {552, 132}}</string> + <string>{{0, 0}, {552, 117}}</string> <key>RubberWindowFrame</key> - <string>13 375 810 487 0 0 1440 878 </string> + <string>406 301 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> @@ -432,7 +391,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {552, 414}}</string> + <string>{{10, 27}, {552, 297}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -486,9 +445,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {552, 282}}</string> + <string>{{10, 27}, {552, 297}}</string> <key>RubberWindowFrame</key> - <string>13 375 810 487 0 0 1440 878 </string> + <string>406 301 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -516,11 +475,11 @@ </array> <key>TableOfContents</key> <array> - <string>8BBE45051FE5F1020022E6F7</string> + <string>8B793E7E21F604AB006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8BBE45061FE5F1020022E6F7</string> + <string>8B793E7F21F604AB006E9731</string> <string>8B0237581D42B1C400E1E8C8</string> - <string>8BBE45071FE5F1020022E6F7</string> + <string>8B793E8021F604AB006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -673,7 +632,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>535163510.630979</real> + <real>569771179.00788903</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -690,12 +649,11 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8BBE452A1FE5F2760022E6F7</string> <string>8BBE45271FE5F2760022E6F7</string> - <string>/Users/christopherjohnson/Desktop/PurestConsoleChannel/PurestConsoleChannel.xcodeproj</string> + <string>/Users/christopherjohnson/Desktop/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj</string> </array> <key>WindowString</key> - <string>13 375 810 487 0 0 1440 878 </string> + <string>406 301 810 487 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/contents.xcworkspacedata index a80c038..a80c038 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate Binary files differindex 5c38f94..5c38f94 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate Binary files differindex 314de0f..314de0f 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/spiadmin.mode1v3 b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/spiadmin.mode1v3 index c572326..c572326 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/spiadmin.mode1v3 +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/spiadmin.mode1v3 diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/spiadmin.pbxuser b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/spiadmin.pbxuser index df94780..df94780 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/spiadmin.pbxuser +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/spiadmin.pbxuser diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme index 8ee693f..8ee693f 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist index 5bccbcb..5bccbcb 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist index a7bdd62..a7bdd62 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme index 0df2de4..0df2de4 100644..100755 --- a/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme +++ b/plugins/MacVST/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme diff --git a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp index b9f3e04..35649a6 100755 --- a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp +++ b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp @@ -12,11 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new P PurestConsoleChannel::PurestConsoleChannel(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - 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/PurestConsoleChannel/source/PurestConsoleChannel.h b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.h index c0a1648..51e728f 100755 --- a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.h +++ b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.h @@ -51,11 +51,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 }; diff --git a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp index 630cba7..2fc513a 100755 --- a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp +++ b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp @@ -14,9 +14,6 @@ void PurestConsoleChannel::processReplacing(float **inputs, float **outputs, Vst float* out1 = outputs[0]; float* out2 = outputs[1]; - float fpTemp; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; long double inputSampleL; long double inputSampleR; @@ -68,25 +65,14 @@ void PurestConsoleChannel::processReplacing(float **inputs, float **outputs, Vst inputSampleR = sin(inputSampleR); //amplitude aspect - //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; @@ -105,9 +91,6 @@ void PurestConsoleChannel::processDoubleReplacing(double **inputs, double **outp double* out1 = outputs[0]; double* out2 = outputs[1]; - double fpTemp; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; long double inputSampleL; long double inputSampleR; @@ -159,25 +142,16 @@ void PurestConsoleChannel::processDoubleReplacing(double **inputs, double **outp inputSampleR = sin(inputSampleR); //amplitude aspect - //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; |