aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/Spiral
diff options
context:
space:
mode:
authorChris Johnson <jinx6568@sover.net>2019-01-27 21:13:54 -0500
committerChris Johnson <jinx6568@sover.net>2019-01-27 21:13:54 -0500
commit966f2d253cd2ee6ce140ad68095a20a9d2b63052 (patch)
treeb0400d95bd06512531ade6ddf55190a58b6a5623 /plugins/MacAU/Spiral
parent0887543349dbbec0721a1fc8b1c7deba9afefa8b (diff)
downloadairwindows-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/Spiral')
-rwxr-xr-xplugins/MacAU/Spiral/Spiral.cpp18
-rwxr-xr-xplugins/MacAU/Spiral/Spiral.xcodeproj/christopherjohnson.pbxuser75
-rwxr-xr-xplugins/MacAU/Spiral/Spiral.xcodeproj/christopherjohnson.perspectivev352
3 files changed, 76 insertions, 69 deletions
diff --git a/plugins/MacAU/Spiral/Spiral.cpp b/plugins/MacAU/Spiral/Spiral.cpp
index 77ae93f..0dab386 100755
--- a/plugins/MacAU/Spiral/Spiral.cpp
+++ b/plugins/MacAU/Spiral/Spiral.cpp
@@ -194,23 +194,15 @@ void Spiral::SpiralKernel::Process( const Float32 *inSourceP,
inputSample = sin(inputSample * fabs(inputSample)) / ((inputSample == 0.0) ?1:fabs(inputSample));
- //noise shaping to 32-bit floating point
- Float32 fpTemp = inputSample;
- fpNShape += (inputSample-fpTemp);
- inputSample += fpNShape;
- //for deeper space and warmth, we try a non-oscillating noise shaping
- //that is kind of ruthless: it will forever retain the rounding errors
- //except we'll dial it back a hair at the end of every buffer processed
- //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; destP += inNumChannels;
}
- fpNShape *= 0.999999;
- //we will just delicately dial back the FP noise shaping, not even every sample
- //this is a good place to put subtle 'no runaway' calculations, though bear in mind
- //that it will be called more often when you use shorter sample buffers in the DAW.
- //So, very low latency operation will call these calculations more often.
}
diff --git a/plugins/MacAU/Spiral/Spiral.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Spiral/Spiral.xcodeproj/christopherjohnson.pbxuser
index 574956e..f03d75b 100755
--- a/plugins/MacAU/Spiral/Spiral.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/Spiral/Spiral.xcodeproj/christopherjohnson.pbxuser
@@ -10,7 +10,7 @@
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
- 292,
+ 419,
20,
48,
43,
@@ -49,31 +49,62 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 548241334;
- PBXWorkspaceStateSaveDate = 548241334;
+ PBXPerProjectTemplateStateSaveDate = 569680086;
+ PBXWorkspaceStateSaveDate = 569680086;
};
perUserProjectItems = {
+ 8B79304B21F4A1E5006E9731 /* PBXTextBookmark */ = 8B79304B21F4A1E5006E9731 /* PBXTextBookmark */;
+ 8B79304D21F4A1E5006E9731 /* PBXTextBookmark */ = 8B79304D21F4A1E5006E9731 /* PBXTextBookmark */;
+ 8B79305221F4A238006E9731 /* PBXTextBookmark */ = 8B79305221F4A238006E9731 /* PBXTextBookmark */;
8BBFF81D20AD8037005650EF /* PlistBookmark */ = 8BBFF81D20AD8037005650EF /* PlistBookmark */;
- 8BBFF81E20AD8037005650EF /* PBXBookmark */ = 8BBFF81E20AD8037005650EF /* PBXBookmark */;
- 8BBFF81F20AD8037005650EF /* PBXTextBookmark */ = 8BBFF81F20AD8037005650EF /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
};
};
+ 8B79304B21F4A1E5006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BC6025B073B072D006C4272 /* Spiral.h */;
+ name = "Spiral.h: 59";
+ rLen = 0;
+ rLoc = 2862;
+ rType = 0;
+ vrLen = 684;
+ vrLoc = 4289;
+ };
+ 8B79304D21F4A1E5006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* Spiral.cpp */;
+ name = "Spiral.cpp: 207";
+ rLen = 0;
+ rLoc = 8720;
+ rType = 0;
+ vrLen = 980;
+ vrLoc = 7743;
+ };
+ 8B79305221F4A238006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* Spiral.cpp */;
+ name = "Spiral.cpp: 207";
+ rLen = 0;
+ rLoc = 8720;
+ rType = 0;
+ vrLen = 1029;
+ vrLoc = 7694;
+ };
8BA05A660720730100365D66 /* Spiral.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {824, 2821}}";
- sepNavSelRange = "{8229, 152}";
- sepNavVisRange = "{7230, 1988}";
- sepNavWindowFrame = "{{15, 52}, {850, 821}}";
+ sepNavIntBoundsRect = "{{0, 0}, {747, 2873}}";
+ sepNavSelRange = "{8720, 0}";
+ sepNavVisRange = "{7694, 1029}";
+ sepNavWindowFrame = "{{590, 57}, {850, 821}}";
};
};
8BA05A690720730100365D66 /* SpiralVersion.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {824, 767}}";
- sepNavSelRange = "{2869, 0}";
- sepNavVisRange = "{49, 2888}";
+ sepNavSelRange = "{2870, 4}";
+ sepNavVisRange = "{31, 2906}";
sepNavWindowFrame = "{{15, 52}, {850, 821}}";
};
};
@@ -87,28 +118,14 @@
);
name = /Users/christopherjohnson/Desktop/MacAU/Spiral/Info.plist;
rLen = 0;
- rLoc = 9223372036854775807;
- };
- 8BBFF81E20AD8037005650EF /* PBXBookmark */ = {
- isa = PBXBookmark;
- fRef = 8BC6025B073B072D006C4272 /* Spiral.h */;
- };
- 8BBFF81F20AD8037005650EF /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 8BC6025B073B072D006C4272 /* Spiral.h */;
- name = "Spiral.h: 59";
- rLen = 0;
- rLoc = 2862;
- rType = 0;
- vrLen = 583;
- vrLoc = 3295;
+ rLoc = 9223372036854775808;
};
8BC6025B073B072D006C4272 /* Spiral.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {894, 1807}}";
+ sepNavIntBoundsRect = "{{0, 0}, {894, 1677}}";
sepNavSelRange = "{2862, 0}";
- sepNavVisRange = "{3295, 583}";
- sepNavWindowFrame = "{{15, 52}, {850, 821}}";
+ sepNavVisRange = "{4289, 684}";
+ sepNavWindowFrame = "{{609, 57}, {850, 821}}";
};
};
8BD3CCB8148830B20062E48C /* Source Control */ = {
diff --git a/plugins/MacAU/Spiral/Spiral.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Spiral/Spiral.xcodeproj/christopherjohnson.perspectivev3
index fdfc41a..61ccad2 100755
--- a/plugins/MacAU/Spiral/Spiral.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/Spiral/Spiral.xcodeproj/christopherjohnson.perspectivev3
@@ -256,8 +256,6 @@
<key>Layout</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -282,7 +280,7 @@
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
- <real>288</real>
+ <real>161</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
@@ -309,7 +307,7 @@
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 0}, {288, 595}}</string>
+ <string>{{0, 0}, {161, 595}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -319,19 +317,19 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {305, 613}}</string>
+ <string>{{0, 0}, {178, 613}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
- <real>288</real>
+ <real>161</real>
</array>
<key>RubberWindowFrame</key>
- <string>16 205 841 654 0 0 1440 878 </string>
+ <string>472 182 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
- <string>305pt</string>
+ <string>178pt</string>
</dict>
<dict>
<key>Dock</key>
@@ -342,7 +340,7 @@
<key>PBXProjectModuleGUID</key>
<string>8BD7274A1D46E5A5000176F0</string>
<key>PBXProjectModuleLabel</key>
- <string>Spiral.h</string>
+ <string>Spiral.cpp</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -350,15 +348,16 @@
<key>PBXProjectModuleGUID</key>
<string>8BD7274B1D46E5A5000176F0</string>
<key>PBXProjectModuleLabel</key>
- <string>Spiral.h</string>
+ <string>Spiral.cpp</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8BBFF81F20AD8037005650EF</string>
+ <string>8B79305221F4A238006E9731</string>
<key>history</key>
<array>
<string>8BBFF81D20AD8037005650EF</string>
- <string>8BBFF81E20AD8037005650EF</string>
+ <string>8B79304B21F4A1E5006E9731</string>
+ <string>8B79304D21F4A1E5006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -372,18 +371,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {531, 229}}</string>
+ <string>{{0, 0}, {658, 432}}</string>
<key>RubberWindowFrame</key>
- <string>16 205 841 654 0 0 1440 878 </string>
+ <string>472 182 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>229pt</string>
+ <string>432pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>379pt</string>
+ <string>176pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -397,9 +396,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 352}}</string>
- <key>RubberWindowFrame</key>
- <string>16 205 841 654 0 0 1440 878 </string>
+ <string>{{10, 27}, {658, 149}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -453,7 +450,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 339}}</string>
+ <string>{{10, 27}, {658, 149}}</string>
+ <key>RubberWindowFrame</key>
+ <string>472 182 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -462,7 +461,7 @@
</dict>
</array>
<key>Proportion</key>
- <string>531pt</string>
+ <string>658pt</string>
</dict>
</array>
<key>Name</key>
@@ -481,11 +480,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BBFF82020AD8037005650EF</string>
+ <string>8B79305321F4A238006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8BBFF82120AD8037005650EF</string>
+ <string>8B79305421F4A238006E9731</string>
<string>8BD7274A1D46E5A5000176F0</string>
- <string>8BBFF82220AD8037005650EF</string>
+ <string>8B79305521F4A238006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -658,7 +657,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>548241463.28044701</real>
+ <real>569680440.94942403</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -675,11 +674,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8BBFF82320AD8037005650EF</string>
<string>/Users/christopherjohnson/Desktop/MacAU/Spiral/Spiral.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>16 205 841 654 0 0 1440 878 </string>
+ <string>472 182 841 654 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>