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/MacAU/NCSeventeen | |
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/MacAU/NCSeventeen')
4 files changed, 42 insertions, 62 deletions
diff --git a/plugins/MacAU/NCSeventeen/NCSeventeen.cpp b/plugins/MacAU/NCSeventeen/NCSeventeen.cpp index cc27033..14f0cf2 100755 --- a/plugins/MacAU/NCSeventeen/NCSeventeen.cpp +++ b/plugins/MacAU/NCSeventeen/NCSeventeen.cpp @@ -173,9 +173,7 @@ void NCSeventeen::NCSeventeenKernel::Reset() basslev = 0.0; treblev = 0.0; cheblev = 0.0; - fpNShapeA = 0.0; - fpNShapeB = 0.0; - fpFlip = true; + fpNShape = 0.0; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -189,12 +187,7 @@ void NCSeventeen::NCSeventeenKernel::Process( const Float32 *inSourceP, { UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; - Float32 *destP = inDestP; - - Float32 fpTemp; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - + Float32 *destP = inDestP; Float64 inP2; Float64 chebyshev; Float64 overallscale = 1.0; @@ -389,19 +382,11 @@ void NCSeventeen::NCSeventeenKernel::Process( const Float32 *inSourceP, if (inputSample < -0.95) inputSample = -0.95; //iron bar - //noise shaping to 32-bit floating point - if (fpFlip) { - fpTemp = inputSample; - fpNShapeA = (fpNShapeA*fpOld)+((inputSample-fpTemp)*fpNew); - inputSample += fpNShapeA; - } - else { - fpTemp = inputSample; - fpNShapeB = (fpNShapeB*fpOld)+((inputSample-fpTemp)*fpNew); - inputSample += fpNShapeB; - } - fpFlip = !fpFlip; - //end noise shaping on 32 bit output + //32 bit dither, made small and tidy. + int expon; frexpf((Float32)inputSample, &expon); + long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + inputSample += (dither-fpNShape); fpNShape = dither; + //end 32 bit dither *destP = inputSample; //built in output trim and dry/wet by default diff --git a/plugins/MacAU/NCSeventeen/NCSeventeen.h b/plugins/MacAU/NCSeventeen/NCSeventeen.h index 80575ef..571f64f 100755 --- a/plugins/MacAU/NCSeventeen/NCSeventeen.h +++ b/plugins/MacAU/NCSeventeen/NCSeventeen.h @@ -133,9 +133,7 @@ public: Float64 basslev; Float64 treblev; Float64 cheblev; - long double fpNShapeA; - long double fpNShapeB; - bool fpFlip; + long double fpNShape; //default stuff }; diff --git a/plugins/MacAU/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.pbxuser index f9c1f79..6f69541 100755 --- a/plugins/MacAU/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.pbxuser @@ -49,43 +49,43 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 531741948; - PBXWorkspaceStateSaveDate = 531741948; + PBXPerProjectTemplateStateSaveDate = 569651037; + PBXWorkspaceStateSaveDate = 569651037; }; perUserProjectItems = { - 8B66929D1FA3B6DF007B3434 /* PBXTextBookmark */ = 8B66929D1FA3B6DF007B3434 /* PBXTextBookmark */; - 8B6692BF1FB1BEBD007B3434 /* PBXTextBookmark */ = 8B6692BF1FB1BEBD007B3434 /* PBXTextBookmark */; + 8B792E2D21F42FE2006E9731 /* PBXTextBookmark */ = 8B792E2D21F42FE2006E9731 /* PBXTextBookmark */; + 8B792E3221F43005006E9731 /* PBXTextBookmark */ = 8B792E3221F43005006E9731 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; - 8B66929D1FA3B6DF007B3434 /* PBXTextBookmark */ = { + 8B792E2D21F42FE2006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BC6025B073B072D006C4272 /* NCSeventeen.h */; name = "NCSeventeen.h: 1"; rLen = 0; rLoc = 0; rType = 0; - vrLen = 47; + vrLen = 26; vrLoc = 0; }; - 8B6692BF1FB1BEBD007B3434 /* PBXTextBookmark */ = { + 8B792E3221F43005006E9731 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 8BC6025B073B072D006C4272 /* NCSeventeen.h */; name = "NCSeventeen.h: 1"; rLen = 0; rLoc = 0; rType = 0; - vrLen = 29; + vrLen = 26; vrLoc = 0; }; 8BA05A660720730100365D66 /* NCSeventeen.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1098, 5460}}"; - sepNavSelRange = "{16304, 0}"; - sepNavVisRange = "{15087, 1879}"; - sepNavWindowFrame = "{{295, 66}, {1145, 812}}"; + sepNavIntBoundsRect = "{{0, 0}, {1098, 5317}}"; + sepNavSelRange = "{16560, 0}"; + sepNavVisRange = "{14728, 1968}"; + sepNavWindowFrame = "{{152, 66}, {1145, 812}}"; }; }; 8BA05A690720730100365D66 /* NCSeventeenVersion.h */ = { @@ -98,10 +98,10 @@ }; 8BC6025B073B072D006C4272 /* NCSeventeen.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {554, 1963}}"; + sepNavIntBoundsRect = "{{0, 0}, {554, 1937}}"; sepNavSelRange = "{0, 0}"; - sepNavVisRange = "{0, 29}"; - sepNavWindowFrame = "{{413, 43}, {1027, 835}}"; + sepNavVisRange = "{0, 26}"; + sepNavWindowFrame = "{{244, 43}, {1027, 835}}"; }; }; 8BD3CCB8148830B20062E48C /* Source Control */ = { diff --git a/plugins/MacAU/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.perspectivev3 index 8047d9f..b049979 100755 --- a/plugins/MacAU/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/NCSeventeen/NCSeventeen.xcodeproj/christopherjohnson.perspectivev3 @@ -225,8 +225,8 @@ <array/> <key>PerspectiveWidths</key> <array> - <integer>-1</integer> - <integer>-1</integer> + <integer>810</integer> + <integer>810</integer> </array> <key>Perspectives</key> <array> @@ -256,8 +256,6 @@ <key>Layout</key> <array> <dict> - <key>BecomeActive</key> - <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> @@ -300,7 +298,7 @@ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> - <integer>4</integer> + <integer>3</integer> <integer>2</integer> <integer>1</integer> <integer>0</integer> @@ -324,7 +322,7 @@ <real>185</real> </array> <key>RubberWindowFrame</key> - <string>613 385 810 487 0 0 1440 878 </string> + <string>460 371 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -352,10 +350,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8B6692BF1FB1BEBD007B3434</string> + <string>8B792E3221F43005006E9731</string> <key>history</key> <array> - <string>8B66929D1FA3B6DF007B3434</string> + <string>8B792E2D21F42FE2006E9731</string> </array> </dict> <key>SplitCount</key> @@ -369,18 +367,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {603, 69}}</string> + <string>{{0, 0}, {603, 51}}</string> <key>RubberWindowFrame</key> - <string>613 385 810 487 0 0 1440 878 </string> + <string>460 371 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>69pt</string> + <string>51pt</string> </dict> <dict> <key>Proportion</key> - <string>372pt</string> + <string>390pt</string> <key>Tabs</key> <array> <dict> @@ -394,9 +392,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {603, 345}}</string> - <key>RubberWindowFrame</key> - <string>613 385 810 487 0 0 1440 878 </string> + <string>{{10, 27}, {603, 363}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -450,7 +446,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 31}, {603, 297}}</string> + <string>{{10, 27}, {603, 363}}</string> + <key>RubberWindowFrame</key> + <string>460 371 810 487 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -478,11 +476,11 @@ </array> <key>TableOfContents</key> <array> - <string>8B6692C01FB1BEBD007B3434</string> + <string>8B792E3321F43005006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8B6692C11FB1BEBD007B3434</string> + <string>8B792E3421F43005006E9731</string> <string>8B67C76A1FA2B03A008C64D6</string> - <string>8B6692C21FB1BEBD007B3434</string> + <string>8B792E3521F43005006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -635,7 +633,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>531742397.05920899</real> + <real>569651205.03675902</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -652,11 +650,10 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>8B6692C31FB1BEBD007B3434</string> <string>/Users/christopherjohnson/Desktop/MacAU/NCSeventeen/NCSeventeen.xcodeproj</string> </array> <key>WindowString</key> - <string>613 385 810 487 0 0 1440 878 </string> + <string>460 371 810 487 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> |