aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/uLawDecode
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/uLawDecode
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/uLawDecode')
-rwxr-xr-xplugins/MacAU/uLawDecode/uLawDecode.cpp18
-rwxr-xr-xplugins/MacAU/uLawDecode/uLawDecode.xcodeproj/christopherjohnson.pbxuser61
-rwxr-xr-xplugins/MacAU/uLawDecode/uLawDecode.xcodeproj/christopherjohnson.perspectivev348
3 files changed, 64 insertions, 63 deletions
diff --git a/plugins/MacAU/uLawDecode/uLawDecode.cpp b/plugins/MacAU/uLawDecode/uLawDecode.cpp
index 8bf3e5a..3f4581c 100755
--- a/plugins/MacAU/uLawDecode/uLawDecode.cpp
+++ b/plugins/MacAU/uLawDecode/uLawDecode.cpp
@@ -231,23 +231,15 @@ void uLawDecode::uLawDecodeKernel::Process( const Float32 *inSourceP,
}
//Dry/Wet control, defaults to the last slider
- //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/uLawDecode/uLawDecode.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/uLawDecode/uLawDecode.xcodeproj/christopherjohnson.pbxuser
index 7c52743..fa546fe 100755
--- a/plugins/MacAU/uLawDecode/uLawDecode.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/uLawDecode/uLawDecode.xcodeproj/christopherjohnson.pbxuser
@@ -10,7 +10,7 @@
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
- 292,
+ 382,
20,
48,
43,
@@ -49,33 +49,54 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 561231051;
- PBXWorkspaceStateSaveDate = 561231051;
+ PBXPerProjectTemplateStateSaveDate = 569686304;
+ PBXWorkspaceStateSaveDate = 569686304;
};
perUserProjectItems = {
- 8B2720A82173B5FC00396442 /* PBXTextBookmark */ = 8B2720A82173B5FC00396442 /* PBXTextBookmark */;
+ 8B79321B21F4B952006E9731 /* PBXTextBookmark */ = 8B79321B21F4B952006E9731 /* PBXTextBookmark */;
+ 8B79321D21F4B952006E9731 /* PBXTextBookmark */ = 8B79321D21F4B952006E9731 /* PBXTextBookmark */;
+ 8B79322221F4B963006E9731 /* PBXTextBookmark */ = 8B79322221F4B963006E9731 /* PBXTextBookmark */;
8BE1D69D2145372700D5F5B6 /* PlistBookmark */ = 8BE1D69D2145372700D5F5B6 /* PlistBookmark */;
- 8BE626FE2159745A00E4E476 /* PBXTextBookmark */ = 8BE626FE2159745A00E4E476 /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
};
};
- 8B2720A82173B5FC00396442 /* PBXTextBookmark */ = {
+ 8B79321B21F4B952006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BC6025B073B072D006C4272 /* uLawDecode.h */;
+ name = "uLawDecode.h: 67";
+ rLen = 0;
+ rLoc = 3125;
+ rType = 0;
+ vrLen = 1015;
+ vrLoc = 4252;
+ };
+ 8B79321D21F4B952006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* uLawDecode.cpp */;
+ name = "uLawDecode.cpp: 244";
+ rLen = 0;
+ rLoc = 10226;
+ rType = 0;
+ vrLen = 974;
+ vrLoc = 9255;
+ };
+ 8B79322221F4B963006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A660720730100365D66 /* uLawDecode.cpp */;
- name = "uLawDecode.cpp: 224";
+ name = "uLawDecode.cpp: 244";
rLen = 0;
- rLoc = 9598;
+ rLoc = 10226;
rType = 0;
- vrLen = 437;
- vrLoc = 10287;
+ vrLen = 1006;
+ vrLoc = 9223;
};
8BA05A660720730100365D66 /* uLawDecode.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {621, 3471}}";
- sepNavSelRange = "{9598, 0}";
- sepNavVisRange = "{10287, 437}";
+ sepNavIntBoundsRect = "{{0, 0}, {670, 3471}}";
+ sepNavSelRange = "{10226, 0}";
+ sepNavVisRange = "{9223, 1006}";
sepNavWindowFrame = "{{587, 45}, {816, 833}}";
};
};
@@ -89,9 +110,9 @@
};
8BC6025B073B072D006C4272 /* uLawDecode.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {843, 1664}}";
+ sepNavIntBoundsRect = "{{0, 0}, {894, 1781}}";
sepNavSelRange = "{3125, 0}";
- sepNavVisRange = "{1679, 1855}";
+ sepNavVisRange = "{4252, 1015}";
sepNavWindowFrame = "{{15, 63}, {890, 810}}";
};
};
@@ -121,16 +142,6 @@
rLen = 0;
rLoc = 9223372036854775808;
};
- 8BE626FE2159745A00E4E476 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 8BA05A660720730100365D66 /* uLawDecode.cpp */;
- name = "uLawDecode.cpp: 224";
- rLen = 0;
- rLoc = 9598;
- rType = 0;
- vrLen = 434;
- vrLoc = 10290;
- };
8D01CCC60486CAD60068D4B7 /* uLawDecode */ = {
activeExec = 0;
};
diff --git a/plugins/MacAU/uLawDecode/uLawDecode.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/uLawDecode/uLawDecode.xcodeproj/christopherjohnson.perspectivev3
index b412088..a73a00a 100755
--- a/plugins/MacAU/uLawDecode/uLawDecode.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/uLawDecode/uLawDecode.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>198</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}, {198, 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}, {215, 613}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
- <real>288</real>
+ <real>198</real>
</array>
<key>RubberWindowFrame</key>
- <string>585 216 841 654 0 0 1440 878 </string>
+ <string>464 204 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
- <string>305pt</string>
+ <string>215pt</string>
</dict>
<dict>
<key>Dock</key>
@@ -354,11 +352,12 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B2720A82173B5FC00396442</string>
+ <string>8B79322221F4B963006E9731</string>
<key>history</key>
<array>
<string>8BE1D69D2145372700D5F5B6</string>
- <string>8BE626FE2159745A00E4E476</string>
+ <string>8B79321B21F4B952006E9731</string>
+ <string>8B79321D21F4B952006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -372,18 +371,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {531, 173}}</string>
+ <string>{{0, 0}, {621, 497}}</string>
<key>RubberWindowFrame</key>
- <string>585 216 841 654 0 0 1440 878 </string>
+ <string>464 204 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>173pt</string>
+ <string>497pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>435pt</string>
+ <string>111pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -397,9 +396,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 408}}</string>
- <key>RubberWindowFrame</key>
- <string>585 216 841 654 0 0 1440 878 </string>
+ <string>{{10, 27}, {621, 84}}</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}, {621, 84}}</string>
+ <key>RubberWindowFrame</key>
+ <string>464 204 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>621pt</string>
</dict>
</array>
<key>Name</key>
@@ -481,11 +480,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B2720A92173B5FC00396442</string>
+ <string>8B79322321F4B963006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B2720AA2173B5FC00396442</string>
+ <string>8B79322421F4B963006E9731</string>
<string>8BD7274A1D46E5A5000176F0</string>
- <string>8B2720AB2173B5FC00396442</string>
+ <string>8B79322521F4B963006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -658,7 +657,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>561231356.44708204</real>
+ <real>569686371.96209395</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -675,11 +674,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B2720AC2173B5FC00396442</string>
<string>/Users/christopherjohnson/Desktop/MacAU/uLawDecode/uLawDecode.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>585 216 841 654 0 0 1440 878 </string>
+ <string>464 204 841 654 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>