diff --git a/plugins/Lb302/Lb302.cpp b/plugins/Lb302/Lb302.cpp index 0041b0c5127..9cb82bd7c90 100644 --- a/plugins/Lb302/Lb302.cpp +++ b/plugins/Lb302/Lb302.cpp @@ -462,7 +462,7 @@ inline float GET_INC(float freq) { return freq/Engine::audioEngine()->outputSampleRate(); // TODO: Use actual sampling rate. } -int Lb302Synth::process(SampleFrame* outbuf, const int size) +int Lb302Synth::process(SampleFrame* outbuf, const std::size_t size) { const float sampleRatio = 44100.f / Engine::audioEngine()->outputSampleRate(); @@ -498,13 +498,10 @@ int Lb302Synth::process(SampleFrame* outbuf, const int size) // hard coded value of 0.99897516. auto decay = computeDecayFactor(0.245260770975f, 1.f / 65536.f); - for( int i=0; i= release_frame ) - { - vca_mode = VcaMode::Decay; - } + if (i >= release_frame) { vca_mode = VcaMode::Decay; } // update vcf if(vcf_envpos >= ENVINC) { @@ -751,7 +748,7 @@ void Lb302Synth::playNote( NotePlayHandle * _n, SampleFrame* _working_buffer ) } m_notesMutex.unlock(); - release_frame = std::max(release_frame, static_cast(_n->framesLeft()) + static_cast(_n->offset())); + release_frame = std::max(release_frame, _n->framesLeft() + _n->offset()); } diff --git a/plugins/Lb302/Lb302.h b/plugins/Lb302/Lb302.h index 25a08592cd9..f9129af668c 100644 --- a/plugins/Lb302/Lb302.h +++ b/plugins/Lb302/Lb302.h @@ -214,7 +214,7 @@ public slots: Lb302FilterKnobState fs; QAtomicPointer vcf; - int release_frame; + size_t release_frame; // More States int vcf_envpos; // Update counter. Updates when >= ENVINC @@ -246,7 +246,7 @@ public slots: void recalcFilter(); - int process(SampleFrame* outbuf, const int size); + int process(SampleFrame* outbuf, const std::size_t size); friend class gui::Lb302SynthView;