Add bypass parameter
This commit is contained in:
parent
9c6a2741be
commit
7a01d898bf
2
dpf
2
dpf
|
@ -1 +1 @@
|
|||
Subproject commit cda831ffcd5f4fe6138e86e5fab70d81f4cf3a18
|
||||
Subproject commit bb29962a512a8911860de2b9b1da468b3f771538
|
|
@ -135,6 +135,7 @@ DistrhoPluginNekobi::DistrhoPluginNekobi()
|
|||
fParams.decay = 75.0f;
|
||||
fParams.accent = 25.0f;
|
||||
fParams.volume = 75.0f;
|
||||
fParams.bypass = false;
|
||||
|
||||
// Internal stuff
|
||||
fSynth.waveform = 0.0f;
|
||||
|
@ -232,6 +233,9 @@ void DistrhoPluginNekobi::initParameter(uint32_t index, Parameter& parameter)
|
|||
parameter.ranges.min = 0.0f;
|
||||
parameter.ranges.max = 100.0f;
|
||||
break;
|
||||
case paramBypass:
|
||||
parameter.initDesignation(kParameterDesignationBypass);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -258,6 +262,8 @@ float DistrhoPluginNekobi::getParameterValue(uint32_t index) const
|
|||
return fParams.accent;
|
||||
case paramVolume:
|
||||
return fParams.volume;
|
||||
case paramBypass:
|
||||
return fParams.bypass ? 1.0f : 0.0f;
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
|
@ -307,6 +313,14 @@ void DistrhoPluginNekobi::setParameterValue(uint32_t index, float value)
|
|||
fSynth.volume = value/100.0f;
|
||||
DISTRHO_SAFE_ASSERT(fSynth.volume >= 0.0f && fSynth.volume <= 1.0f);
|
||||
break;
|
||||
case paramBypass: {
|
||||
const bool bypass = (value > 0.5f);
|
||||
if (fParams.bypass != bypass)
|
||||
{
|
||||
fParams.bypass = bypass;
|
||||
nekobee_synth_all_voices_off(&fSynth);
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -342,6 +356,10 @@ void DistrhoPluginNekobi::run(const float**, float** outputs, uint32_t frames, c
|
|||
return;
|
||||
}
|
||||
|
||||
// ignore midi input if bypassed
|
||||
if (fParams.bypass)
|
||||
midiEventCount = 0;
|
||||
|
||||
while (framesDone < frames)
|
||||
{
|
||||
if (fSynth.nugget_remains == 0)
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
paramDecay,
|
||||
paramAccent,
|
||||
paramVolume,
|
||||
paramBypass,
|
||||
paramCount
|
||||
};
|
||||
|
||||
|
@ -79,7 +80,7 @@ protected:
|
|||
|
||||
uint32_t getVersion() const noexcept override
|
||||
{
|
||||
return d_version(1, 0, 0);
|
||||
return d_version(1, 1, 0);
|
||||
}
|
||||
|
||||
int64_t getUniqueId() const noexcept override
|
||||
|
@ -117,6 +118,7 @@ private:
|
|||
float decay;
|
||||
float accent;
|
||||
float volume;
|
||||
bool bypass;
|
||||
} fParams;
|
||||
|
||||
nekobee_synth_t fSynth;
|
||||
|
|
Loading…
Reference in New Issue