Fix unwanted cutoff bug

This commit is contained in:
Jack Andersen
2019-01-22 21:52:00 -10:00
parent 7719459ac7
commit d80f1346bb
3 changed files with 13 additions and 3 deletions

View File

@@ -51,6 +51,9 @@ void Envelope::keyOff() {
}
float Envelope::advance(double dt, const Voice& vox) {
if (!m_adsrSet && !vox.m_state.m_useAdsrControllers)
return 1.f;
double thisTime = m_curTime;
m_curTime += dt;
@@ -131,6 +134,9 @@ float Envelope::advance(double dt, const Voice& vox) {
}
float Envelope::advance(double dt) {
if (!m_adsrSet)
return 1.f;
double thisTime = m_curTime;
m_curTime += dt;
@@ -196,4 +202,8 @@ float Envelope::advance(double dt) {
return 0.f;
}
}
bool Envelope::isComplete(const Voice& vox) const {
return (m_adsrSet || vox.m_state.m_useAdsrControllers) && m_phase == State::Complete;
}
} // namespace amuse