|
|
@@ -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;
|
|
|
@@ -169,6 +170,16 @@ void DistrhoPluginNekobi::initParameter(uint32_t index, Parameter& parameter) |
|
|
|
parameter.ranges.def = 0.0f;
|
|
|
|
parameter.ranges.min = 0.0f;
|
|
|
|
parameter.ranges.max = 1.0f;
|
|
|
|
parameter.enumValues.count = 2;
|
|
|
|
parameter.enumValues.restrictedMode = true;
|
|
|
|
{
|
|
|
|
ParameterEnumerationValue* const enumValues = new ParameterEnumerationValue[2];
|
|
|
|
enumValues[0].value = 0.0f;
|
|
|
|
enumValues[0].label = "Square";
|
|
|
|
enumValues[1].value = 1.0f;
|
|
|
|
enumValues[1].label = "Triangle";
|
|
|
|
parameter.enumValues.values = enumValues;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case paramTuning:
|
|
|
|
parameter.hints = kParameterIsAutomable; // was 0.5 <-> 2.0, log
|
|
|
@@ -232,6 +243,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 +272,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 +323,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 +366,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)
|
|
|
|