mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-26 17:06:51 +00:00
Don't read the first 32 samples after keyon.
The way I'm approximating this is ugly...
This commit is contained in:
parent
6b984c5593
commit
e006ab5b2d
@ -468,7 +468,12 @@ void SasInstance::MixVoice(SasVoice &voice) {
|
||||
numSamples = grainSize * 4;
|
||||
}
|
||||
|
||||
voice.ReadSamples(resampleBuffer + 2, numSamples);
|
||||
// This feels a bit hacky. The first 32 samples after a keyon are 0s.
|
||||
if (voice.envelope.NeedsKeyOn()) {
|
||||
voice.ReadSamples(resampleBuffer + 2 + 32, numSamples - 32);
|
||||
} else {
|
||||
voice.ReadSamples(resampleBuffer + 2, numSamples);
|
||||
}
|
||||
|
||||
// Smoothness HACKERY
|
||||
resampleBuffer[2 + numSamples] = resampleBuffer[2 + numSamples - 1];
|
||||
|
@ -146,9 +146,13 @@ public:
|
||||
int GetHeight() const {
|
||||
return height_ > (s64)PSP_SAS_ENVELOPE_HEIGHT_MAX ? PSP_SAS_ENVELOPE_HEIGHT_MAX : height_;
|
||||
}
|
||||
bool NeedsKeyOn() const {
|
||||
return state_ == STATE_KEYON;
|
||||
}
|
||||
bool HasEnded() const {
|
||||
return state_ == STATE_OFF;
|
||||
}
|
||||
|
||||
int attackRate;
|
||||
int decayRate;
|
||||
int sustainRate;
|
||||
|
Loading…
x
Reference in New Issue
Block a user