mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
Try and make delay less zippery
This commit is contained in:
parent
a2f1eb82e4
commit
c6f9f7d1a5
4 changed files with 23 additions and 8 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 98c1f54cb9b17090522327064bd2d76090f21af3
|
||||
Subproject commit ab67106ad750ede2daceb56908735ccd9c22fb2c
|
||||
|
|
@ -15,7 +15,10 @@ WavetableAudioProcessorEditor::WavetableAudioProcessorEditor (WavetableAudioProc
|
|||
addAndMakeVisible (editor);
|
||||
addAndMakeVisible (scope);
|
||||
|
||||
usage.panic.onClick = [this] { wtProc.presetLoaded = true; };
|
||||
usage.panic.onClick = [this]
|
||||
{
|
||||
wtProc.presetLoaded = true;
|
||||
};
|
||||
addAndMakeVisible (usage);
|
||||
|
||||
usage.setBounds (45, 12, 150, 16);
|
||||
|
|
|
|||
|
|
@ -678,12 +678,22 @@ void WavetableAudioProcessor::setupModMatrix()
|
|||
polyParam = false;
|
||||
|
||||
if (! pp->isInternal() || pp == delayParams.delay)
|
||||
modMatrix.addParameter (pp, polyParam);
|
||||
modMatrix.addParameter (pp, polyParam, getSmoothingTime (pp));
|
||||
}
|
||||
|
||||
modMatrix.build();
|
||||
}
|
||||
|
||||
float WavetableAudioProcessor::getSmoothingTime (gin::Parameter* p)
|
||||
{
|
||||
if (p == delayParams.delay) return 0.0f;
|
||||
if (p == delayParams.cf) return 0.0f;
|
||||
if (p == delayParams.fb) return 0.0f;
|
||||
if (p == delayParams.mix) return 0.0f;
|
||||
|
||||
return 0.02f;
|
||||
}
|
||||
|
||||
void WavetableAudioProcessor::reset()
|
||||
{
|
||||
Processor::reset();
|
||||
|
|
@ -739,7 +749,7 @@ void WavetableAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, ju
|
|||
if (blockMissed || presetLoaded || lastMono != globalParams.mono->isOn())
|
||||
{
|
||||
blockMissed = presetLoaded = false;
|
||||
lastMono = ! lastMono;
|
||||
lastMono = globalParams.mono->isOn();
|
||||
stereoDelay.reset();
|
||||
reverb.reset();
|
||||
turnOffAllVoices (false);
|
||||
|
|
@ -838,7 +848,7 @@ void WavetableAudioProcessor::applyEffects (juce::AudioSampleBuffer& buffer)
|
|||
|
||||
// Apply Delay
|
||||
if (delayParams.enable->isOn())
|
||||
stereoDelay.process (buffer);
|
||||
stereoDelay.processSmoothed (buffer);
|
||||
|
||||
// Apply Reverb
|
||||
if (reverbParams.enable->isOn())
|
||||
|
|
@ -939,13 +949,12 @@ void WavetableAudioProcessor::updateParams (int newBlockSize)
|
|||
{
|
||||
if (delayParams.sync->isOn())
|
||||
{
|
||||
auto& duration = gin::NoteDuration::getNoteDurations()[(size_t)delayParams.beat->getUserValueInt()];
|
||||
auto& duration = gin::NoteDuration::getNoteDurations()[(size_t)modMatrix.getValue (delayParams.beat)];
|
||||
delayParams.delay->setUserValue (duration.toSeconds (getPlayHead()));
|
||||
}
|
||||
else
|
||||
{
|
||||
auto z = delayParams.time->getUserValue();
|
||||
delayParams.delay->setUserValue (z);
|
||||
delayParams.delay->setUserValue (modMatrix.getValue (delayParams.time));
|
||||
}
|
||||
|
||||
stereoDelay.setParams (modMatrix.getValue (delayParams.delay),
|
||||
|
|
|
|||
|
|
@ -283,6 +283,9 @@ public:
|
|||
|
||||
juce::CriticalSection dspLock;
|
||||
|
||||
private:
|
||||
float getSmoothingTime (gin::Parameter*);
|
||||
|
||||
//==============================================================================
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WavetableAudioProcessor)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue