This commit is contained in:
Christopher Johnson 2026-05-02 19:22:14 -04:00
parent 38f93aaaa7
commit 6df9b9832d
21 changed files with 113 additions and 86 deletions

View file

@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D01CCC60486CAD60068D4B7"
BuildableName = "Gain.vst"
BuildableName = "ADClip9.vst"
BlueprintName = "ADClip9"
ReferencedContainer = "container:ADClip9.xcodeproj">
</BuildableReference>
@ -51,7 +51,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D01CCC60486CAD60068D4B7"
BuildableName = "Gain.vst"
BuildableName = "ADClip9.vst"
BlueprintName = "ADClip9"
ReferencedContainer = "container:ADClip9.xcodeproj">
</BuildableReference>

View file

@ -124,7 +124,7 @@ void ADClip9::getParameterName(VstInt32 index, char *text) {
void ADClip9::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A*18.0, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B*18.0, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
case kParamE: switch((VstInt32)( E * 2.999 )) {

View file

@ -106,12 +106,14 @@ void ADClip9::processReplacing(float **inputs, float **outputs, VstInt32 sampleF
//this is our output mode switch, showing the effects
//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
//int expon; frexpf((float)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 3.553e-44l * pow(2,expon+62));
//frexpf((float)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
if (fpdL-fpdR < 1073741824 || fpdR-fpdL < 1073741824) {
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;}
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 3.553e-44l * pow(2,expon+62));
//end 32 bit stereo floating point dither
*out1 = inputSampleL;
@ -225,10 +227,12 @@ void ADClip9::processDoubleReplacing(double **inputs, double **outputs, VstInt32
//begin 64 bit stereo floating point dither
//int expon; frexp((double)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 3.553e-44l * pow(2,expon+62));
//frexp((double)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
if (fpdL-fpdR < 1073741824 || fpdR-fpdL < 1073741824) {
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;}
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 3.553e-44l * pow(2,expon+62));
//end 64 bit stereo floating point dither
*out1 = inputSampleL;