Skip to content

Commit

Permalink
fixed bug where Blendronic was not tracking adaptiveTempo1
Browse files Browse the repository at this point in the history
  • Loading branch information
dantrueman committed Sep 7, 2021
1 parent a034c25 commit f36fc1e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bk_JUCE/bitKlavier/Source/Blendronic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ void BlendronicProcessor::tick(float* outputs)
// Update the pulse length in case tempo or subdiv changed
// possible to put this behind conditional, so we aren't doing these operations ever tick?
pulseLength = (60.0 / (tempoPrep->getSubdivisions() * tempoPrep->getTempo()));
if (pulseLength != prevPulseLength) numSamplesBeat = prep->bBeats.value[beatIndex] * pulseLength * synth->getSampleRate();
pulseLength *= (general->getPeriodMultiplier() * tempo->getPeriodMultiplier());

if (pulseLength != prevPulseLength) numSamplesBeat = prep->bBeats.value[beatIndex] * pulseLength * synth->getSampleRate();

// Check for beat change
if (sampleTimer >= numSamplesBeat)
{
Expand Down Expand Up @@ -160,8 +162,9 @@ void BlendronicProcessor::tick(float* outputs)
// Set parameters of the delay object
updateDelayParameters();
resetPhase = true;
prevPulseLength = pulseLength;
}
prevPulseLength = pulseLength;
//prevPulseLength = pulseLength;

// Tick the delay
delay->tick(outputs, Decibels::decibelsToGain(prep->outGain.value));
Expand All @@ -181,7 +184,7 @@ void BlendronicProcessor::tick(float* outputs)

void BlendronicProcessor::processBlock(int numSamples, int midiChannel)
{

// DBG("Blendronic tempo = " + String(tempo->getTempo()->prep->getTempo()));
}

void BlendronicProcessor::keyPressed(int noteNumber, Array<float>& targetVelocities, bool fromPress)
Expand Down Expand Up @@ -406,6 +409,7 @@ void BlendronicProcessor::prepareToPlay(double sr)
feedbackIndex = 0;

pulseLength = (60.0 / (tempoPrep->getSubdivisions() * tempoPrep->getTempo()));
pulseLength *= (general->getPeriodMultiplier() * tempo->getPeriodMultiplier());
numSamplesBeat = prep->bBeats.value[beatIndex] * synth->getSampleRate() * pulseLength;
numSamplesDelay = prep->bDelayLengths.value[delayIndex] * synth->getSampleRate() * pulseLength;
if (pulseLength == INFINITY)
Expand Down

0 comments on commit f36fc1e

Please sign in to comment.