Permalink
Browse files

Fix AKSampler note-release bug found by Matt

  • Loading branch information...
getdunne committed Sep 22, 2018
1 parent 41ce501 commit 3b7d59fff965cf174e9592408c206d2d68f85ff2
Showing with 4 additions and 14 deletions.
  1. +4 −14 AudioKit/Core/AudioKitCore/Common/ADSREnvelope.cpp
@@ -41,7 +41,7 @@ namespace AudioKitCore
releaseSamples *= scaleFactor;
}
void ADSREnvelope::init()
{
segment = kIdle;
@@ -50,26 +50,16 @@ namespace AudioKitCore
void ADSREnvelope::start()
{
// if (segment == kIdle)
// {
// // start new attack segment from zero
// ramper.init(0.0f, 1.0f, pParameters->attackSamples);
// }
// else
// {
// // envelope has been retriggered; start new attack from where we are
// ramper.reinit(1.0f, pParameters->attackSamples);
// }
// SD have to make attack go above 1.0, or decay won't work if sustain is 1.0
// have to make attack go above 1.0, or decay won't work if sustain is 1.0
ramper.init(0.0f, 1.01f, pParameters->attackSamples);
segment = kAttack;
}
void ADSREnvelope::release()
{
segment = kRelease;
ramper.reinit(0.0f, pParameters->releaseSamples);
if (ramper.value != 0.0f)
ramper.reinit(0.0f, pParameters->releaseSamples);
}
void ADSREnvelope::restart()

0 comments on commit 3b7d59f

Please sign in to comment.