aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/PurestConsoleChannel
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/PurestConsoleChannel
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/PurestConsoleChannel')
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.cpp28
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.h4
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.mode1v30
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.pbxuser57
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.perspectivev342
-rwxr-xr-x[-rw-r--r--]plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.pbxproj0
6 files changed, 61 insertions, 70 deletions
diff --git a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.cpp b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.cpp
index 7f47b65..b418640 100644..100755
--- a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.cpp
+++ b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.cpp
@@ -150,9 +150,7 @@ ComponentResult PurestConsoleChannel::Initialize()
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void PurestConsoleChannel::PurestConsoleChannelKernel::Reset()
{
- fpNShapeA = 0.0;
- fpNShapeB = 0.0;
- fpFlip = true;
+ fpNShape = 0.0;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -168,10 +166,6 @@ void PurestConsoleChannel::PurestConsoleChannelKernel::Process( const Float32
const Float32 *sourceP = inSourceP;
Float32 *destP = inDestP;
- Float32 fpTemp;
- long double fpOld = 0.618033988749894848204586; //golden ratio!
- long double fpNew = 1.0 - fpOld;
-
long double inputSample;
while (nSampleFrames-- > 0) {
@@ -203,20 +197,12 @@ void PurestConsoleChannel::PurestConsoleChannelKernel::Process( const Float32
inputSample = sin(inputSample);
//amplitude aspect
-
- //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;
diff --git a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.h b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.h
index 5cf13da..0beecd1 100644..100755
--- a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.h
+++ b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.h
@@ -119,9 +119,7 @@ public:
virtual void Reset();
private:
- long double fpNShapeA;
- long double fpNShapeB;
- bool fpFlip;
+ long double fpNShape;
};
};
diff --git a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.mode1v3 b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.mode1v3
index f301be9..f301be9 100644..100755
--- a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.mode1v3
+++ b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.mode1v3
diff --git a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.pbxuser
index dcf6a55..44838c0 100644..100755
--- a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.pbxuser
@@ -49,18 +49,19 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 538686827;
- PBXWorkspaceStateSaveDate = 538686827;
+ PBXPerProjectTemplateStateSaveDate = 569585667;
+ PBXWorkspaceStateSaveDate = 569585667;
};
perUserProjectItems = {
- 8B4E54B5201BB4AE00B5DC2A /* PlistBookmark */ = 8B4E54B5201BB4AE00B5DC2A /* PlistBookmark */;
- 8B4E54C3201BB57400B5DC2A /* PlistBookmark */ = 8B4E54C3201BB57400B5DC2A /* PlistBookmark */;
+ 8B34922E2054553C00C0EF7D /* PlistBookmark */ = 8B34922E2054553C00C0EF7D /* PlistBookmark */;
+ 8B79267521F33079006E9731 /* PBXTextBookmark */ = 8B79267521F33079006E9731 /* PBXTextBookmark */;
+ 8B79267A21F3308F006E9731 /* PBXTextBookmark */ = 8B79267A21F3308F006E9731 /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
};
};
- 8B4E54B5201BB4AE00B5DC2A /* PlistBookmark */ = {
+ 8B34922E2054553C00C0EF7D /* PlistBookmark */ = {
isa = PlistBookmark;
fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */;
fallbackIsa = PBXBookmark;
@@ -68,28 +69,36 @@
kPath = (
CFBundleName,
);
- name = /Users/christopherjohnson/Desktop/github/plugins/MacAU/PurestConsoleChannel/Info.plist;
+ name = /Users/christopherjohnson/Desktop/MacAU/PurestConsoleChannel/Info.plist;
rLen = 0;
rLoc = 9223372036854775808;
};
- 8B4E54C3201BB57400B5DC2A /* PlistBookmark */ = {
- isa = PlistBookmark;
- fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */;
- fallbackIsa = PBXBookmark;
- isK = 0;
- kPath = (
- CFBundleName,
- );
- name = /Users/christopherjohnson/Desktop/github/plugins/MacAU/PurestConsoleChannel/Info.plist;
+ 8B79267521F33079006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* PurestConsoleChannel.cpp */;
+ name = "PurestConsoleChannel.cpp: 206";
+ rLen = 0;
+ rLoc = 9532;
+ rType = 0;
+ vrLen = 213;
+ vrLoc = 9160;
+ };
+ 8B79267A21F3308F006E9731 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 8BA05A660720730100365D66 /* PurestConsoleChannel.cpp */;
+ name = "PurestConsoleChannel.cpp: 206";
rLen = 0;
- rLoc = 9223372036854775807;
+ rLoc = 9532;
+ rType = 0;
+ vrLen = 213;
+ vrLoc = 9160;
};
8BA05A660720730100365D66 /* PurestConsoleChannel.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {848, 3094}}";
- sepNavSelRange = "{9377, 56}";
- sepNavVisRange = "{7017, 2416}";
- sepNavWindowFrame = "{{545, 39}, {895, 839}}";
+ sepNavIntBoundsRect = "{{0, 0}, {677, 2873}}";
+ sepNavSelRange = "{9532, 0}";
+ sepNavVisRange = "{9160, 213}";
+ sepNavWindowFrame = "{{352, 39}, {895, 839}}";
};
};
8BA05A690720730100365D66 /* PurestConsoleChannelVersion.h */ = {
@@ -102,10 +111,10 @@
};
8BC6025B073B072D006C4272 /* PurestConsoleChannel.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {894, 1703}}";
- sepNavSelRange = "{2920, 0}";
- sepNavVisRange = "{1797, 2033}";
- sepNavWindowFrame = "{{705, 39}, {895, 839}}";
+ sepNavIntBoundsRect = "{{0, 0}, {894, 1677}}";
+ sepNavSelRange = "{5033, 0}";
+ sepNavVisRange = "{3380, 1763}";
+ sepNavWindowFrame = "{{307, 39}, {895, 839}}";
};
};
8BD3CCB8148830B20062E48C /* Source Control */ = {
diff --git a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.perspectivev3
index f3c675f..18c4f2b 100644..100755
--- a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/christopherjohnson.perspectivev3
@@ -256,8 +256,6 @@
<key>Layout</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -325,7 +323,7 @@
<real>288</real>
</array>
<key>RubberWindowFrame</key>
- <string>584 203 841 654 0 0 1440 878 </string>
+ <string>388 183 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -341,7 +339,7 @@
<key>PBXProjectModuleGUID</key>
<string>8BD7274A1D46E5A5000176F0</string>
<key>PBXProjectModuleLabel</key>
- <string>Info.plist</string>
+ <string>PurestConsoleChannel.cpp</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -349,14 +347,15 @@
<key>PBXProjectModuleGUID</key>
<string>8BD7274B1D46E5A5000176F0</string>
<key>PBXProjectModuleLabel</key>
- <string>Info.plist</string>
+ <string>PurestConsoleChannel.cpp</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B4E54C3201BB57400B5DC2A</string>
+ <string>8B79267A21F3308F006E9731</string>
<key>history</key>
<array>
- <string>8B4E54B5201BB4AE00B5DC2A</string>
+ <string>8B34922E2054553C00C0EF7D</string>
+ <string>8B79267521F33079006E9731</string>
</array>
</dict>
<key>SplitCount</key>
@@ -370,18 +369,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {531, 229}}</string>
+ <string>{{0, 0}, {531, 126}}</string>
<key>RubberWindowFrame</key>
- <string>584 203 841 654 0 0 1440 878 </string>
+ <string>388 183 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>229pt</string>
+ <string>126pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>379pt</string>
+ <string>482pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -395,9 +394,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 352}}</string>
- <key>RubberWindowFrame</key>
- <string>584 203 841 654 0 0 1440 878 </string>
+ <string>{{10, 27}, {531, 455}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -451,7 +448,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 315}}</string>
+ <string>{{10, 27}, {531, 455}}</string>
+ <key>RubberWindowFrame</key>
+ <string>388 183 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -479,11 +478,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B4E54C4201BB57400B5DC2A</string>
+ <string>8B79267B21F3308F006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B4E54C5201BB57400B5DC2A</string>
+ <string>8B79267C21F3308F006E9731</string>
<string>8BD7274A1D46E5A5000176F0</string>
- <string>8B4E54C6201BB57400B5DC2A</string>
+ <string>8B79267D21F3308F006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -656,7 +655,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>538686836.144647</real>
+ <real>569585807.50112402</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -673,11 +672,10 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B4E54C7201BB57400B5DC2A</string>
- <string>/Users/christopherjohnson/Desktop/github/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj</string>
+ <string>/Users/christopherjohnson/Desktop/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>584 203 841 654 0 0 1440 878 </string>
+ <string>388 183 841 654 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>
diff --git a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.pbxproj b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.pbxproj
index a832a58..a832a58 100644..100755
--- a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.pbxproj
+++ b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.xcodeproj/project.pbxproj