mirror of
https://codeberg.org/armin/mindball.git
synced 2026-09-01 03:40:49 +02:00
fix sync delay
This commit is contained in:
parent
482d5c3cbd
commit
2e85d45983
4 changed files with 35 additions and 3 deletions
|
|
@ -84,6 +84,11 @@ bool MindballAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts)
|
|||
&& (mainIn == juce::AudioChannelSet::mono() || mainIn == juce::AudioChannelSet::stereo());
|
||||
}
|
||||
|
||||
double MindballAudioProcessor::getCurrentBpm() const
|
||||
{
|
||||
return lastBpm.load (std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
void MindballAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer&)
|
||||
{
|
||||
juce::ScopedNoDenormals noDenormals;
|
||||
|
|
@ -109,13 +114,14 @@ void MindballAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juc
|
|||
}
|
||||
wasBypassed = false;
|
||||
|
||||
double bpm = 120.0;
|
||||
double bpm = lastBpm.load (std::memory_order_relaxed);
|
||||
if (auto* playHead = getPlayHead())
|
||||
{
|
||||
juce::AudioPlayHead::CurrentPositionInfo pos;
|
||||
if (playHead->getCurrentPosition (pos))
|
||||
bpm = pos.bpm > 0 ? pos.bpm : 120.0;
|
||||
if (playHead->getCurrentPosition (pos) && pos.bpm > 0)
|
||||
bpm = pos.bpm;
|
||||
}
|
||||
lastBpm.store (bpm, std::memory_order_relaxed);
|
||||
|
||||
mindball::DelayEngine::Params p;
|
||||
p.feedback = *apvts.getRawParameterValue (ParameterIDs::feedback);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue