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/VoiceOfTheStarship | |
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/VoiceOfTheStarship')
-rwxr-xr-x | plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp | 25 | ||||
-rwxr-xr-x | plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.h | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.mode1v3 | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.pbxuser | 73 | ||||
-rwxr-xr-x[-rw-r--r--] | plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.perspectivev3 | 49 | ||||
-rwxr-xr-x[-rw-r--r--] | plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/project.pbxproj | 0 |
6 files changed, 74 insertions, 77 deletions
diff --git a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp index e89cc53..cfc6806 100755 --- a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp +++ b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp @@ -175,9 +175,7 @@ void VoiceOfTheStarship::VoiceOfTheStarshipKernel::Reset() filterflip = false; for(int count = 0; count < 11; count++) {b[count] = 0.0; f[count] = 0.0;} lastAlgorithm = 0; - fpNShapeA = 0.0; - fpNShapeB = 0.0; - fpFlip = true; + fpNShape = 0.0; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -259,9 +257,6 @@ void VoiceOfTheStarship::VoiceOfTheStarshipKernel::Process( const Float32 *inS Float64 rumbletrim = sqrt(lowcut); //this among other things is just to give volume compensation Float64 inputSample; - Float32 fpTemp; - Float64 fpOld = 0.618033988749894848204586; //golden ratio! - Float64 fpNew = 1.0 - fpOld; while (nSampleFrames-- > 0) { inputSample = *sourceP; @@ -323,19 +318,11 @@ void VoiceOfTheStarship::VoiceOfTheStarshipKernel::Process( const Float32 *inS flip = !flip; filterflip = !filterflip; - //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; sourceP += inNumChannels; diff --git a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.h b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.h index d2731b8..28d236a 100755 --- a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.h +++ b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.h @@ -138,9 +138,7 @@ public: Float64 b[11]; Float64 f[11]; int lastAlgorithm; - Float64 fpNShapeA; - Float64 fpNShapeB; - bool fpFlip; + Float64 fpNShape; }; }; diff --git a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.mode1v3 b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.mode1v3 index e28aecb..e28aecb 100644..100755 --- a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.mode1v3 +++ b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.mode1v3 diff --git a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.pbxuser index 31707e8..2622f4a 100644..100755 --- a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.pbxuser @@ -12,7 +12,7 @@ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, - 181, + 327, 20, 48, 43, @@ -51,22 +51,53 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 539483684; - PBXWorkspaceStateSaveDate = 539483684; + PBXPerProjectTemplateStateSaveDate = 569686894; + PBXWorkspaceStateSaveDate = 569686894; }; perUserProjectItems = { - 8BCA6F4B2027DF6C00D92BAD /* PBXTextBookmark */ = 8BCA6F4B2027DF6C00D92BAD /* PBXTextBookmark */; - 8BCA6F4C2027DF6C00D92BAD /* PBXTextBookmark */ = 8BCA6F4C2027DF6C00D92BAD /* PBXTextBookmark */; + 8B79327421F4BBE8006E9731 /* PBXTextBookmark */ = 8B79327421F4BBE8006E9731 /* PBXTextBookmark */; + 8B79327621F4BBE8006E9731 /* PBXTextBookmark */ = 8B79327621F4BBE8006E9731 /* PBXTextBookmark */; + 8B79327F21F4BC16006E9731 /* PBXTextBookmark */ = 8B79327F21F4BC16006E9731 /* PBXTextBookmark */; }; sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; userBuildSettings = { }; }; + 8B79327421F4BBE8006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BC6025B073B072D006C4272 /* VoiceOfTheStarship.h */; + name = "VoiceOfTheStarship.h: 141"; + rLen = 0; + rLoc = 5399; + rType = 0; + vrLen = 878; + vrLoc = 4631; + }; + 8B79327621F4BBE8006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* VoiceOfTheStarship.cpp */; + name = "VoiceOfTheStarship.cpp: 329"; + rLen = 0; + rLoc = 13814; + rType = 0; + vrLen = 1135; + vrLoc = 12872; + }; + 8B79327F21F4BC16006E9731 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* VoiceOfTheStarship.cpp */; + name = "VoiceOfTheStarship.cpp: 260"; + rLen = 0; + rLoc = 11704; + rType = 0; + vrLen = 1504; + vrLoc = 10760; + }; 8BA05A660720730100365D66 /* VoiceOfTheStarship.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {803, 4758}}"; - sepNavSelRange = "{13583, 0}"; - sepNavVisRange = "{12506, 267}"; + sepNavIntBoundsRect = "{{0, 0}, {677, 4446}}"; + sepNavSelRange = "{11704, 0}"; + sepNavVisRange = "{10760, 1504}"; sepNavWindowFrame = "{{459, 62}, {981, 816}}"; }; }; @@ -96,32 +127,12 @@ }; 8BC6025B073B072D006C4272 /* VoiceOfTheStarship.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {824, 1937}}"; - sepNavSelRange = "{5380, 57}"; - sepNavVisRange = "{4200, 1340}"; + sepNavIntBoundsRect = "{{0, 0}, {824, 2171}}"; + sepNavSelRange = "{5399, 0}"; + sepNavVisRange = "{4631, 878}"; sepNavWindowFrame = "{{670, 67}, {770, 811}}"; }; }; - 8BCA6F4B2027DF6C00D92BAD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BA05A660720730100365D66 /* VoiceOfTheStarship.cpp */; - name = "VoiceOfTheStarship.cpp: 319"; - rLen = 0; - rLoc = 13583; - rType = 0; - vrLen = 267; - vrLoc = 12506; - }; - 8BCA6F4C2027DF6C00D92BAD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 8BA05A660720730100365D66 /* VoiceOfTheStarship.cpp */; - name = "VoiceOfTheStarship.cpp: 319"; - rLen = 0; - rLoc = 13583; - rType = 0; - vrLen = 267; - vrLoc = 12506; - }; 8BD3CCB8148830B20062E48C /* Source Control */ = { isa = PBXSourceControlManager; fallbackIsa = XCSourceControlManager; diff --git a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.perspectivev3 index e5ee563..93dc9d7 100644..100755 --- a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/christopherjohnson.perspectivev3 @@ -225,8 +225,8 @@ <array/> <key>PerspectiveWidths</key> <array> - <integer>810</integer> - <integer>810</integer> + <integer>850</integer> + <integer>850</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,14 +298,14 @@ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> - <integer>3</integer> + <integer>4</integer> <integer>2</integer> <integer>1</integer> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> - <string>{{0, 0}, {262, 390}}</string> + <string>{{0, 0}, {262, 653}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> @@ -317,14 +315,14 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {279, 408}}</string> + <string>{{0, 0}, {279, 671}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>262</real> </array> <key>RubberWindowFrame</key> - <string>727 422 704 449 0 0 1440 878 </string> + <string>436 140 850 712 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -335,6 +333,8 @@ <key>Dock</key> <array> <dict> + <key>BecomeActive</key> + <true/> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> @@ -352,10 +352,11 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>8BCA6F4C2027DF6C00D92BAD</string> + <string>8B79327F21F4BC16006E9731</string> <key>history</key> <array> - <string>8BCA6F4B2027DF6C00D92BAD</string> + <string>8B79327421F4BBE8006E9731</string> + <string>8B79327621F4BBE8006E9731</string> </array> </dict> <key>SplitCount</key> @@ -369,18 +370,18 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{0, 0}, {420, 121}}</string> + <string>{{0, 0}, {566, 560}}</string> <key>RubberWindowFrame</key> - <string>727 422 704 449 0 0 1440 878 </string> + <string>436 140 850 712 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> - <string>121pt</string> + <string>560pt</string> </dict> <dict> <key>Proportion</key> - <string>282pt</string> + <string>106pt</string> <key>Tabs</key> <array> <dict> @@ -394,9 +395,7 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {420, 255}}</string> - <key>RubberWindowFrame</key> - <string>727 422 704 449 0 0 1440 878 </string> + <string>{{10, 27}, {566, 79}}</string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -450,7 +449,9 @@ <key>GeometryConfiguration</key> <dict> <key>Frame</key> - <string>{{10, 27}, {526, 414}}</string> + <string>{{10, 27}, {566, 79}}</string> + <key>RubberWindowFrame</key> + <string>436 140 850 712 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> @@ -459,7 +460,7 @@ </dict> </array> <key>Proportion</key> - <string>420pt</string> + <string>566pt</string> </dict> </array> <key>Name</key> @@ -478,11 +479,11 @@ </array> <key>TableOfContents</key> <array> - <string>8BCA6F4D2027DF6C00D92BAD</string> + <string>8B79328021F4BC16006E9731</string> <string>1CA23ED40692098700951B8B</string> - <string>8BCA6F4E2027DF6C00D92BAD</string> + <string>8B79328121F4BC16006E9731</string> <string>8BD3753F2011847B00FD04C9</string> - <string>8BCA6F4F2027DF6C00D92BAD</string> + <string>8B79328221F4BC16006E9731</string> <string>1CA23EDF0692099D00951B8B</string> <string>1CA23EE00692099D00951B8B</string> <string>1CA23EE10692099D00951B8B</string> @@ -655,7 +656,7 @@ <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> - <real>539484012.35384703</real> + <real>569687062.55458999</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> @@ -675,7 +676,7 @@ <string>/Users/christopherjohnson/Desktop/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj</string> </array> <key>WindowString</key> - <string>727 422 704 449 0 0 1440 878 </string> + <string>436 140 850 712 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> diff --git a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/project.pbxproj b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/project.pbxproj index cc10978..cc10978 100644..100755 --- a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/project.pbxproj +++ b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.xcodeproj/project.pbxproj |