/* Peacock-8 VA polysynth Copyright 2024 Gordon JC Pearce Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #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 }