diff options
author | Eugene Sandulenko | 2004-10-24 19:21:38 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-10-24 19:21:38 +0000 |
commit | 6fd31192e1413e2a84c22a28379278e5ee8a9355 (patch) | |
tree | dbfe236604f5bf49ac4cf46e9eb7403ff7e95cd9 /backends | |
parent | 53d10219858cd58542deb564156111aa83cc59ed (diff) | |
download | scummvm-rg350-6fd31192e1413e2a84c22a28379278e5ee8a9355.tar.gz scummvm-rg350-6fd31192e1413e2a84c22a28379278e5ee8a9355.tar.bz2 scummvm-rg350-6fd31192e1413e2a84c22a28379278e5ee8a9355.zip |
o Sync with upstream source
o Move back to old sawtooth filter, which sounds better
svn-id: r15683
Diffstat (limited to 'backends')
-rw-r--r-- | backends/midi/mt32/partial.cpp | 12 | ||||
-rw-r--r-- | backends/midi/mt32/synth.cpp | 6 |
2 files changed, 16 insertions, 2 deletions
diff --git a/backends/midi/mt32/partial.cpp b/backends/midi/mt32/partial.cpp index 97d6813a21..a5dddfed1f 100644 --- a/backends/midi/mt32/partial.cpp +++ b/backends/midi/mt32/partial.cpp @@ -237,6 +237,15 @@ INLINE void CPartialMT32::generateSamples(int16 * partialBuf, long length) { // to how it looks on the MT-32. What it really does it takes the // square wave and multiplies it by a full cosine // TODO: This area here crashes DosBox due to read overflow + if(toff < sawtable[noteval][partCache->pulsewidth]) { + ptemp = waveforms[2][noteval][(toff<<2)+minorplace]; + } else { + ptemp = waveforms[3][noteval][(toff<<2)+minorplace]; + } + ptemp = ptemp *4; + +// This is dosbox 0.62 canadacow's code. Reported to be worse than above 0.61 code +#if 0 uint offsetpos = (toff<<2)+minorplace; //int a = 0; if(toff < sawtable[noteval][partCache->pulsewidth]) { @@ -251,7 +260,8 @@ INLINE void CPartialMT32::generateSamples(int16 * partialBuf, long length) { ptemp = waveforms[3][noteval][offsetpos]; } ptemp = ptemp *4; - +#endif + // ptemp = (int)(sin((double)toff / 100.0) * 100.0); //ptemp = pa; diff --git a/backends/midi/mt32/synth.cpp b/backends/midi/mt32/synth.cpp index d6215265dc..138ca29cb7 100644 --- a/backends/midi/mt32/synth.cpp +++ b/backends/midi/mt32/synth.cpp @@ -1386,8 +1386,11 @@ INLINE int32 getAmpEnvelope(dpoly::partialStatus *pStat, dpoly *poly) { } else { tc = tStat->envbase; tc = (tc + ((tStat->envdist * tStat->envpos) / tStat->envsize)); + + // TRISTAN if (tc < 0) tc = 0; + if((tStat->envpos >= tStat->envsize) || (tc == 0)){ pStat->PCMDone = true; pStat->isDecayed = true; @@ -2919,7 +2922,8 @@ bool CSynthMT32::InitTables() { //brsa = exp(pow(((float)tr * 0.0133),2)); brsa = exp(pow(((float)tr * 0.005),3)) * 125; - brsa = pow((float)10,((float)(tr/46.5)-1))/2; + //brsa = pow((float)10,((float)(tr/46.5)-1))/2; + brsa = pow((float)10,((float)(tr/55)-1))/2; //brsa = pow(exp((ftr-40)/40),1.15); //brsq = exp((ftr-35)/35); |