mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 08:59:28 +02:00
sbsms Transient Sharpening shouldn't crash anymore, but it's not thoroughly tested yet.
This commit is contained in:
parent
92f28a0a1d
commit
317ed4bf17
@ -307,7 +307,7 @@ void subband :: write_(audio *inBuf, long n, real a, real ratio)
|
|||||||
} else {
|
} else {
|
||||||
amod = 1.0f;
|
amod = 1.0f;
|
||||||
}
|
}
|
||||||
setA(1.0f+amod*(a-1.0f));
|
setA(amod*a);
|
||||||
setAMod(amod);
|
setAMod(amod);
|
||||||
setRatio(ratio);
|
setRatio(ratio);
|
||||||
setF(1.0f/ratio);
|
setF(1.0f/ratio);
|
||||||
@ -1131,9 +1131,9 @@ void subband :: preAnalyzeComplete()
|
|||||||
|
|
||||||
for(long k=k0;k<k1;k++) {
|
for(long k=k0;k<k1;k++) {
|
||||||
bool bOnset = false;
|
bool bOnset = false;
|
||||||
if(k==k0)
|
if(k==k0) {
|
||||||
bOnset = true;
|
bOnset = true;
|
||||||
else {
|
} else {
|
||||||
real o0 = getOnset(k);
|
real o0 = getOnset(k);
|
||||||
if(o0 < 0.1f) continue;
|
if(o0 < 0.1f) continue;
|
||||||
real o1 = getOnset(k-1);
|
real o1 = getOnset(k-1);
|
||||||
@ -1158,6 +1158,8 @@ void subband :: preAnalyzeComplete()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
calculateA(kstart,k1);
|
calculateA(kstart,k1);
|
||||||
|
aPreAnalysis.write(1.0f);
|
||||||
|
aPreAnalysis.advance(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void subband :: calculateA(long kstart, long kend)
|
void subband :: calculateA(long kstart, long kend)
|
||||||
@ -1170,6 +1172,8 @@ void subband :: calculateA(long kstart, long kend)
|
|||||||
if(o > oMax) oMax = o;
|
if(o > oMax) oMax = o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oMax *= 1.3;
|
||||||
|
|
||||||
for(long k=kstart;k<kend;k++) {
|
for(long k=kstart;k<kend;k++) {
|
||||||
real o = getOnset(k);
|
real o = getOnset(k);
|
||||||
real d = oMax - o;
|
real d = oMax - o;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user