Browse Source

Update nekobi

pull/1/head
falkTX 3 years ago
parent
commit
5d5dc0b39e
2 changed files with 31 additions and 1 deletions
  1. +28
    -0
      distrho-nekobi/DistrhoPluginNekobi.cpp
  2. +3
    -1
      distrho-nekobi/DistrhoPluginNekobi.hpp

+ 28
- 0
distrho-nekobi/DistrhoPluginNekobi.cpp View File

@@ -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)


+ 3
- 1
distrho-nekobi/DistrhoPluginNekobi.hpp View File

@@ -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…
Cancel
Save