Skip to content

Commit

Permalink
fix: cracking sound at some DAW hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
midilab committed Sep 11, 2024
1 parent af7c130 commit 6fc925d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/JC303.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void JC303::render303(juce::AudioBuffer<float>& buffer, int beginSample, int end
auto* monoChannel = buffer.getWritePointer(0);
for (auto sample = beginSample; sample < endSample; ++sample)
// processing open303
monoChannel[sample] += (float) open303Core.getSample();
monoChannel[sample] = (float) open303Core.getSample();
}

void JC303::processBlock (juce::AudioBuffer<float>& buffer,
Expand Down Expand Up @@ -381,9 +381,6 @@ void JC303::processBlock (juce::AudioBuffer<float>& buffer,
const auto message = midiMetadata.getMessage();
const auto messagePosition = static_cast<int>(message.getTimeStamp());

// render open303
render303(buffer, currentSample, messagePosition);

if (message.isNoteOn())
{
open303Core.noteOn(message.getNoteNumber(), message.getVelocity(), 0);
Expand All @@ -401,6 +398,8 @@ void JC303::processBlock (juce::AudioBuffer<float>& buffer,
continue;
}

// render open303
render303(buffer, currentSample, messagePosition);
currentSample = messagePosition;
}

Expand Down

0 comments on commit 6fc925d

Please sign in to comment.