1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 08:29:27 +02:00

sbsms Transient Sharpening shouldn't crash anymore, but it's not thoroughly tested yet.

This commit is contained in:
clayton.otey@gmail.com 2010-06-11 01:34:52 +00:00
parent 92f28a0a1d
commit 317ed4bf17

View File

@ -307,7 +307,7 @@ void subband :: write_(audio *inBuf, long n, real a, real ratio)
} else {
amod = 1.0f;
}
setA(1.0f+amod*(a-1.0f));
setA(amod*a);
setAMod(amod);
setRatio(ratio);
setF(1.0f/ratio);
@ -1131,9 +1131,9 @@ void subband :: preAnalyzeComplete()
for(long k=k0;k<k1;k++) {
bool bOnset = false;
if(k==k0)
if(k==k0) {
bOnset = true;
else {
} else {
real o0 = getOnset(k);
if(o0 < 0.1f) continue;
real o1 = getOnset(k-1);
@ -1158,6 +1158,8 @@ void subband :: preAnalyzeComplete()
}
}
calculateA(kstart,k1);
aPreAnalysis.write(1.0f);
aPreAnalysis.advance(1);
}
void subband :: calculateA(long kstart, long kend)
@ -1170,6 +1172,8 @@ void subband :: calculateA(long kstart, long kend)
if(o > oMax) oMax = o;
}
oMax *= 1.3;
for(long k=kstart;k<kend;k++) {
real o = getOnset(k);
real d = oMax - o;