aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/AQuickVoiceClip
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/AQuickVoiceClip
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/AQuickVoiceClip')
-rwxr-xr-xplugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.cpp29
-rwxr-xr-xplugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.h6
-rwxr-xr-xplugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.pbxuser31
-rwxr-xr-xplugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.perspectivev334
4 files changed, 33 insertions, 67 deletions
diff --git a/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.cpp b/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.cpp
index 9fbaade..8d93557 100755
--- a/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.cpp
+++ b/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.cpp
@@ -181,10 +181,7 @@ void AQuickVoiceClip::AQuickVoiceClipKernel::Reset()
iirSampleC = 0.0;
iirSampleD = 0.0;
flip = false;
- demotimer = 0;
- fpNShapeA = 0.0;
- fpNShapeB = 0.0;
- fpFlip = true;
+ fpNShape = 0.0;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -227,9 +224,6 @@ void AQuickVoiceClip::AQuickVoiceClipKernel::Process( const Float32 *inSourceP
Float64 outputSample;
bool clipOnset;
Float64 drySample;
- Float32 fpTemp;
- Float64 fpOld = 0.618033988749894848204586; //golden ratio!
- Float64 fpNew = 1.0 - fpOld;
while (nSampleFrames-- > 0) {
inputSample = *sourceP;
@@ -430,21 +424,7 @@ void AQuickVoiceClip::AQuickVoiceClipKernel::Process( const Float32 *inSourceP
inputSample += (((lastOutSample + lastOut2Sample + lastOut3Sample) / 3.6)*lpDepth);
}
if (lpDepth < 0.0) lpDepth = 0.0;
-
- //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 = not fpFlip;
- //end noise shaping on 32 bit output, hasn't been applied yet
-
+
inputSample *= (1.0-maxRecent);
inputSample += (passThrough * maxRecent);
//there's our raw signal, without antialiasing. Brings up low level stuff and softens more when hot
@@ -453,6 +433,11 @@ void AQuickVoiceClip::AQuickVoiceClipKernel::Process( const Float32 *inSourceP
if (inputSample < -cliplevel) inputSample = -cliplevel;
//final iron bar
+ //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/AQuickVoiceClip/AQuickVoiceClip.h b/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.h
index ef284bd..5cb485a 100755
--- a/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.h
+++ b/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.h
@@ -158,11 +158,7 @@ public:
Float64 iirSampleC;
Float64 iirSampleD;
bool flip;
- int demotimer;
- Float64 fpNShapeA;
- Float64 fpNShapeB;
- bool fpFlip;
-
+ Float64 fpNShape;
};
};
diff --git a/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.pbxuser
index f98240c..ec97115 100755
--- a/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.pbxuser
@@ -49,29 +49,18 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 528421130;
- PBXWorkspaceStateSaveDate = 528421130;
+ PBXPerProjectTemplateStateSaveDate = 569588500;
+ PBXWorkspaceStateSaveDate = 569588500;
};
perUserProjectItems = {
- 8B65E4DA1EFF50F700DF9573 /* PBXTextBookmark */ = 8B65E4DA1EFF50F700DF9573 /* PBXTextBookmark */;
- 8B9D72231F7EFB95007AB60F /* PBXTextBookmark */ = 8B9D72231F7EFB95007AB60F /* PBXTextBookmark */;
+ 8B79277E21F33BC7006E9731 /* PBXTextBookmark */ = 8B79277E21F33BC7006E9731 /* PBXTextBookmark */;
8B9D72B61F7F1114007AB60F /* PBXTextBookmark */ = 8B9D72B61F7F1114007AB60F /* PBXTextBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
};
};
- 8B65E4DA1EFF50F700DF9573 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 8BA05A660720730100365D66 /* AQuickVoiceClip.cpp */;
- name = "AQuickVoiceClip.cpp: 420";
- rLen = 0;
- rLoc = 16700;
- rType = 0;
- vrLen = 137;
- vrLoc = 14995;
- };
- 8B9D72231F7EFB95007AB60F /* PBXTextBookmark */ = {
+ 8B79277E21F33BC7006E9731 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 8BA05A690720730100365D66 /* AQuickVoiceClipVersion.h */;
name = "AQuickVoiceClipVersion.h: 54";
@@ -93,9 +82,9 @@
};
8BA05A660720730100365D66 /* AQuickVoiceClip.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1468, 5785}}";
- sepNavSelRange = "{11331, 0}";
- sepNavVisRange = "{9752, 2750}";
+ sepNavIntBoundsRect = "{{0, 0}, {1104, 6604}}";
+ sepNavSelRange = "{16734, 0}";
+ sepNavVisRange = "{15329, 1491}";
sepNavWindowFrame = "{{175, 59}, {1151, 803}}";
};
};
@@ -109,9 +98,9 @@
};
8BC6025B073B072D006C4272 /* AQuickVoiceClip.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1104, 2236}}";
- sepNavSelRange = "{5418, 0}";
- sepNavVisRange = "{1999, 1702}";
+ sepNavIntBoundsRect = "{{0, 0}, {1104, 2392}}";
+ sepNavSelRange = "{5940, 0}";
+ sepNavVisRange = "{4794, 1256}";
sepNavWindowFrame = "{{16, 57}, {1151, 803}}";
};
};
diff --git a/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.perspectivev3
index 278e871..e2f0f99 100755
--- a/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.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>
@@ -352,11 +350,10 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8B9D72B61F7F1114007AB60F</string>
+ <string>8B79277E21F33BC7006E9731</string>
<key>history</key>
<array>
- <string>8B65E4DA1EFF50F700DF9573</string>
- <string>8B9D72231F7EFB95007AB60F</string>
+ <string>8B9D72B61F7F1114007AB60F</string>
</array>
</dict>
<key>SplitCount</key>
@@ -370,18 +367,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {567, 13}}</string>
+ <string>{{0, 0}, {567, 0}}</string>
<key>RubberWindowFrame</key>
<string>218 365 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>13pt</string>
+ <string>0pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>428pt</string>
+ <string>441pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -395,9 +392,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {567, 401}}</string>
- <key>RubberWindowFrame</key>
- <string>218 365 810 487 0 0 1440 878 </string>
+ <string>{{10, 27}, {567, 414}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -451,7 +446,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 31}, {603, 297}}</string>
+ <string>{{10, 27}, {567, 414}}</string>
+ <key>RubberWindowFrame</key>
+ <string>218 365 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -479,11 +476,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8B9D72B71F7F1114007AB60F</string>
+ <string>8B79277F21F33BC7006E9731</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8B9D72B81F7F1114007AB60F</string>
+ <string>8B79278021F33BC7006E9731</string>
<string>8B81AD171E85459D00889355</string>
- <string>8B9D72B91F7F1114007AB60F</string>
+ <string>8B79278121F33BC7006E9731</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -636,7 +633,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>528421140.86927599</real>
+ <real>569588679.18826604</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -653,7 +650,6 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8B9D72BA1F7F1114007AB60F</string>
<string>/Users/christopherjohnson/Desktop/MacAU/AQuickVoiceClip/AQuickVoiceClip.xcodeproj</string>
</array>
<key>WindowString</key>