Skip to content

Commit

Permalink
Merge pull request #18 from Tote-Bag-Labs/baconpaul/fix-logic
Browse files Browse the repository at this point in the history
Fix the juce BlockSize API so plugin works in Logic
  • Loading branch information
JoseDiazRohena authored Mar 11, 2023
2 parents edb13f0 + a364ec0 commit 721d5b3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/PluginProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ void ValentineAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, ju
juce::ScopedNoDenormals noDenormals;
auto totalNumInputChannels = getTotalNumInputChannels();
auto totalNumOutputChannels = getTotalNumOutputChannels();
auto currentSamplesPerBlock = getBlockSize();
auto bufferSize = buffer.getNumSamples();
auto currentSamplesPerBlock = bufferSize;

// We need to prepare the process buffer first. The input buffer is delayed to account for
// oversampling latency. Copying into the process buffer after this, then, would undo the
Expand Down Expand Up @@ -319,7 +320,7 @@ void ValentineAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, ju

auto g = compressValue.get();
for (int i = 0; i < totalNumOutputChannels; ++i)
processBuffer.applyGainRamp (i, 0, getBlockSize(), currentGain, g);
processBuffer.applyGainRamp (i, 0, bufferSize, currentGain, g);
currentGain = g;

// Upsample then do non-linear processing
Expand All @@ -342,7 +343,7 @@ void ValentineAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, ju
auto m = makeupValue.get();
for (int i = 0; i < totalNumOutputChannels; ++i)
{
processBuffer.applyGainRamp (i, 0, getBlockSize(), currentMakeup, m);
processBuffer.applyGainRamp (i, 0, bufferSize, currentMakeup, m);
}
currentMakeup = m;

Expand Down Expand Up @@ -371,7 +372,7 @@ void ValentineAudioProcessor::processBlockBypassed (juce::AudioBuffer<float>& bu

auto totalNumInputChannels = getTotalNumInputChannels();
auto totalNumOutputChannels = getTotalNumOutputChannels();
auto currentSamplesPerBlock = getBlockSize();
auto currentSamplesPerBlock = buffer.getNumSamples();

prepareInputBuffer (buffer,
totalNumInputChannels,
Expand Down

0 comments on commit 721d5b3

Please sign in to comment.