Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions plugins/Lb302/Lb302.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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<size; i++ )
for (auto i = std::size_t{0}; i < size; i++)
{
// start decay if we're past release
if( i >= release_frame )
{
vca_mode = VcaMode::Decay;
}
if (i >= release_frame) { vca_mode = VcaMode::Decay; }

// update vcf
if(vcf_envpos >= ENVINC) {
Expand Down Expand Up @@ -751,7 +748,7 @@ void Lb302Synth::playNote( NotePlayHandle * _n, SampleFrame* _working_buffer )
}
m_notesMutex.unlock();

release_frame = std::max(release_frame, static_cast<int>(_n->framesLeft()) + static_cast<int>(_n->offset()));
release_frame = std::max(release_frame, _n->framesLeft() + _n->offset());
}


Expand Down
4 changes: 2 additions & 2 deletions plugins/Lb302/Lb302.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public slots:
Lb302FilterKnobState fs;
QAtomicPointer<Lb302Filter> vcf;

int release_frame;
size_t release_frame;

// More States
int vcf_envpos; // Update counter. Updates when >= ENVINC
Expand Down Expand Up @@ -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;

Expand Down