added dpf controls, which are not connected to anything yet

This commit is contained in:
Gordon JC Pearce 2024-10-17 23:22:08 +01:00
parent e806584a46
commit be894c562e
4 changed files with 322 additions and 6 deletions

View File

@ -11,6 +11,7 @@ NAME = peacock
FILES_DSP = \ FILES_DSP = \
peacock.cpp \ peacock.cpp \
controls.cpp \
ic1.cpp \ ic1.cpp \
oscillator.cpp \ oscillator.cpp \
ic29.cpp ic29.cpp

View File

@ -16,8 +16,298 @@
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#include "ic1.hpp"
#include "ic29.hpp"
#include "peacock.hpp" #include "peacock.hpp"
void Peacock::initParameter(uint32_t index, Parameter& parameter) {
switch (index) {
case p_lfoRate:
parameter.hints = kParameterIsAutomatable;
parameter.name = "LFO Rate";
parameter.symbol = "pfau_lforate";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 48.0f;
parameter.midiCC = 3;
break;
case p_lfoDelay:
parameter.hints = kParameterIsAutomatable;
parameter.name = "LFO Delay";
parameter.symbol = "pfau_lfodelay";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 0.0f;
parameter.midiCC = 9;
break;
case p_vcoRange:
parameter.hints = kParameterIsAutomatable | kParameterIsInteger;
parameter.name = "Range";
parameter.symbol = "pfau_vcorange";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 2.0f;
parameter.ranges.def = 1.0f;
parameter.midiCC = 12;
parameter.enumValues.count = 3;
parameter.enumValues.restrictedMode = true;
{
ParameterEnumerationValue* const enumValues = new ParameterEnumerationValue[3];
enumValues[0].value = 0.0f;
enumValues[0].label = "16'";
enumValues[1].value = 1.0f;
enumValues[1].label = "8'";
enumValues[2].value = 2.0f;
enumValues[2].label = "4'";
parameter.enumValues.values = enumValues;
}
break;
case p_vcoLfoMod:
parameter.hints = kParameterIsAutomatable;
parameter.name = "LFO";
parameter.symbol = "pfau_lfo";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 10.0f;
parameter.midiCC = 13;
break;
case p_pwmLfoMod:
parameter.hints = kParameterIsAutomatable;
parameter.name = "PWM";
parameter.symbol = "pfau_pwm";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 48.0f;
parameter.midiCC = 14;
break;
case p_pwmMode:
parameter.hints = kParameterIsAutomatable | kParameterIsBoolean;
parameter.name = "PWM Mode";
parameter.symbol = "pfau_pwmmode";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f;
parameter.ranges.def = 1.0f;
parameter.midiCC = 15;
parameter.enumValues.count = 2;
parameter.enumValues.restrictedMode = true;
{
ParameterEnumerationValue* const enumValues = new ParameterEnumerationValue[2];
enumValues[0].value = 0.0f;
enumValues[0].label = "LFO";
enumValues[1].value = 1.0f;
enumValues[1].label = "MAN";
parameter.enumValues.values = enumValues;
}
break;
case p_sawOn:
parameter.hints = kParameterIsAutomatable | kParameterIsBoolean;
parameter.name = "Saw";
parameter.symbol = "pfau_saw";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f;
parameter.ranges.def = 1.0f;
parameter.midiCC = 17;
break;
case p_sqrOn:
parameter.hints = kParameterIsAutomatable | kParameterIsBoolean;
parameter.name = "Square";
parameter.symbol = "pfau_sqr";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f;
parameter.ranges.def = 1.0f;
parameter.midiCC = 16;
break;
case p_subLevel:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Sub Osc";
parameter.symbol = "pfau_sub";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 0.0f;
parameter.midiCC = 18;
break;
case p_noiseLevel:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Noise";
parameter.symbol = "pfau_noise";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 0.0f;
parameter.midiCC = 19;
break;
case p_hpfMode:
parameter.hints = kParameterIsAutomatable | kParameterIsInteger;
parameter.name = "HPF";
parameter.symbol = "pfau_hpf";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 3.0f;
parameter.ranges.def = 0.0f;
parameter.midiCC = 20;
break;
case p_vcfCutoff:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Freq";
parameter.symbol = "pfau_freq";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 60.0f;
parameter.midiCC = 74;
break;
case p_vcfReso:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Res";
parameter.symbol = "pfau_reso";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 0.0f;
parameter.midiCC = 71;
break;
case p_vcfEnvPol:
parameter.hints = kParameterIsAutomatable | kParameterIsInteger;
parameter.name = "Polarity";
parameter.symbol = "pfau_vcfmode";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f;
parameter.ranges.def = 1.0f;
parameter.midiCC = 21;
parameter.enumValues.count = 2;
parameter.enumValues.restrictedMode = true;
{
ParameterEnumerationValue* const enumValues = new ParameterEnumerationValue[2];
enumValues[0].value = 0.0f;
enumValues[0].label = "POS";
enumValues[1].value = 1.0f;
enumValues[1].label = "INV";
parameter.enumValues.values = enumValues;
}
break;
case p_vcfEnvMod:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Env";
parameter.symbol = "pfau_vcfenvmod";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 46.0f;
parameter.midiCC = 22;
break;
case p_vcfLFoMod:
parameter.hints = kParameterIsAutomatable;
parameter.name = "LFO";
parameter.symbol = "pfau_vcflfomod";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 0.0f;
parameter.midiCC = 23;
break;
case p_vcfKeyTrk:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Kybd";
parameter.symbol = "pfau_vcfkeymod";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 71.0f;
parameter.midiCC = 24;
break;
case p_attack:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Attack";
parameter.symbol = "pfau_attack";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 27.0f;
parameter.midiCC = 73;
break;
case p_decay:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Decay";
parameter.symbol = "pfau_decay";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 57.0f;
parameter.midiCC = 75;
break;
case p_sustain:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Sustain";
parameter.symbol = "pfau_sustain";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 57.0f;
parameter.midiCC = 27;
break;
case p_release:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Release";
parameter.symbol = "pfau_release";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 48.0f;
parameter.midiCC = 72;
break;
case p_vcaEnvGate:
parameter.hints = kParameterIsAutomatable | kParameterIsInteger; // | kParameterIsBoolean;
parameter.name = "Gate";
parameter.symbol = "pfau_envgate";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f;
parameter.ranges.def = 1.0f;
parameter.midiCC = 25;
parameter.enumValues.count = 2;
parameter.enumValues.restrictedMode = true;
{
ParameterEnumerationValue* const enumValues = new ParameterEnumerationValue[2];
enumValues[0].value = 0.0f;
enumValues[0].label = "ENV";
enumValues[1].value = 1.0f;
enumValues[1].label = "GATE";
parameter.enumValues.values = enumValues;
}
break;
case p_vcaLevel:
parameter.hints = kParameterIsAutomatable;
parameter.name = "VCA Level";
parameter.symbol = "pfau_vcalevel";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 40.0f;
parameter.midiCC = 26;
break;
case p_modWheel:
parameter.hints = kParameterIsAutomatable | kParameterIsHidden;
parameter.name = "Mod wheel";
parameter.symbol = "pfau_modwheel";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 0.0f;
parameter.midiCC = 1;
break;
case p_holdPedal:
parameter.hints = kParameterIsAutomatable | kParameterIsHidden;
parameter.name = "Hold Pedal";
parameter.symbol = "pfau_holdpedal";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 0.0f;
parameter.midiCC = 64;
break;
}
// chorus, porta, bend range, key mode still to do
}

View File

@ -191,7 +191,7 @@ void Voice::update() {
void Voice::on(uint8_t key) { void Voice::on(uint8_t key) {
voiceState = V_ON; voiceState = V_ON;
note = key; note = key;
env.on(); env.on(); // FIXME move to synth update code
} }
void Voice::off() { void Voice::off() {

View File

@ -28,6 +28,32 @@ START_NAMESPACE_DISTRHO
class Peacock : public Plugin { class Peacock : public Plugin {
public: public:
enum Parameters { enum Parameters {
p_lfoRate,
p_lfoDelay,
p_vcoRange, // 16'/8'/4'
p_vcoLfoMod,
p_pwmLfoMod,
p_pwmMode, // LFO/Fixed
p_sawOn,
p_sqrOn,
p_subLevel,
p_noiseLevel,
p_hpfMode, // 0 = bass boost, 1 = flat, 2 = 170Hz, 3 = 350Hz
p_vcfCutoff,
p_vcfReso,
p_vcfEnvPol, // positive / inverted
p_vcfEnvMod,
p_vcfLFoMod,
p_vcfKeyTrk,
p_vcaEnvGate, // env or gate
p_vcaLevel,
p_attack,
p_decay,
p_sustain,
p_release,
p_chorus, // 0, 1, 2
p_modWheel,
p_holdPedal,
paramCount paramCount
}; };
@ -35,7 +61,6 @@ class Peacock : public Plugin {
float sampleRate; float sampleRate;
protected: protected:
const char *getLabel() const override { return "peacock-8"; } const char *getLabel() const override { return "peacock-8"; }
const char *getDescription() const override { const char *getDescription() const override {
return "simple polysynth"; return "simple polysynth";
@ -47,7 +72,7 @@ class Peacock : public Plugin {
// Initialisation // Initialisation
// void initAudioPort(bool input, uint32_t index, AudioPort &port) override; // void initAudioPort(bool input, uint32_t index, AudioPort &port) override;
// void initParameter(uint32_t index, Parameter &parameter) override; void initParameter(uint32_t index, Parameter &parameter) override;
// void setParameterValue(uint32_t index, float value) override; // void setParameterValue(uint32_t index, float value) override;
// float getParameterValue(uint32_t index) const override; // float getParameterValue(uint32_t index) const override;