gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit 7f059b5bfcb518fdaa00d396bdeb4937fe6624b9
parent 1921e0c3704e3127ae6f935d99816ad88ead1d41
Author: trancy2k5 <63122430+trancy2k5@users.noreply.github.com>
Date:   Thu, 20 Jan 2022 22:22:28 +0100

- New Bitmaps for OSC/Filter Section
- New Bitmaps for ARP/Generel Section
- Fix: Display asynron to channel display
- Small GUI improvements
- Removed all timers
- FilterKeytrackBase ComboBox selection from "C-1" to "G8" added
- Fix: ComboBoxes are not updated
- Changed Mode/Single as button

Diffstat:
Msource/jucePlugin/VirusController.cpp | 141+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
Msource/jucePlugin/assets2/panel_1_marker_points.png | 0
Msource/jucePlugin/assets2/panel_4_marker_points.png | 0
Msource/jucePlugin/assets2/panels/panel_1.png | 0
Msource/jucePlugin/assets2/panels/panel_4.png | 0
Msource/jucePlugin/ui2/VirusEditor.cpp | 102++++++++++++++++++++++++++++++++++++++++++-------------------------------------
Msource/jucePlugin/ui2/VirusEditor.h | 1+
Msource/jucePlugin/ui2/Virus_LookAndFeel.h | 4++--
Msource/jucePlugin/ui2/Virus_Panel1_OscEditor.cpp | 2+-
Msource/jucePlugin/ui2/Virus_Panel3_FxEditor.cpp | 110+++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------
Msource/jucePlugin/ui2/Virus_Panel3_FxEditor.h | 8+++++---
Msource/jucePlugin/ui2/Virus_Panel4_ArpEditor.cpp | 174+++++++++++++++++++++++++++++++++----------------------------------------------
Msource/jucePlugin/ui2/Virus_Panel4_ArpEditor.h | 8++++----
13 files changed, 349 insertions(+), 201 deletions(-)

diff --git a/source/jucePlugin/VirusController.cpp b/source/jucePlugin/VirusController.cpp @@ -1297,6 +1297,143 @@ namespace Virus } } + juce::String filterKeytrackBase(float v, Parameter::Description) + { + const auto ridx = juce::roundToInt(v); + switch (ridx) + { + case 0: return "C-1"; + case 1: return "C#-1"; + case 2: return "D-1"; + case 3: return "D#-1"; + case 4: return "E-1"; + case 5: return "F-1"; + case 6: return "F#-1"; + case 7: return "G-1"; + case 8: return "G#-1"; + case 9: return "A-1"; + case 10: return "A#-1"; + case 11: return "B-1"; + case 12: return "C0"; + case 13: return "C#0"; + case 14: return "D0"; + case 15: return "D#0"; + case 16: return "E0"; + case 17: return "F0"; + case 18: return "F#0"; + case 19: return "G0"; + case 20: return "G#0"; + case 21: return "A0"; + case 22: return "A#0"; + case 23: return "B0"; + case 24: return "C1"; + case 25: return "C#1"; + case 26: return "D1"; + case 27: return "D#1"; + case 28: return "E1"; + case 29: return "F1"; + case 30: return "F#1"; + case 31: return "G1"; + case 32: return "G#1"; + case 33: return "A1"; + case 34: return "A#1"; + case 35: return "B1"; + case 36: return "C2"; + case 37: return "C#2"; + case 38: return "D2"; + case 39: return "D#2"; + case 40: return "E2"; + case 41: return "F2"; + case 42: return "F#2"; + case 43: return "G2"; + case 44: return "G#2"; + case 45: return "A2"; + case 46: return "A#2"; + case 47: return "B2"; + case 48: return "C3"; + case 49: return "C#3"; + case 50: return "D3"; + case 51: return "D#3"; + case 52: return "E3"; + case 53: return "F3"; + case 54: return "F#3"; + case 55: return "G3"; + case 56: return "G#3"; + case 57: return "A3"; + case 58: return "A#3"; + case 59: return "B3"; + case 60: return "C4"; + case 61: return "C#4"; + case 62: return "D4"; + case 63: return "D#4"; + case 64: return "E4"; + case 65: return "F4"; + case 66: return "F#4"; + case 67: return "G4"; + case 68: return "G#4"; + case 69: return "A4"; + case 70: return "A#4"; + case 71: return "B4"; + case 72: return "C5"; + case 73: return "C#5"; + case 74: return "D5"; + case 75: return "D#5"; + case 76: return "E5"; + case 77: return "F5"; + case 78: return "F#5"; + case 79: return "G5"; + case 80: return "G#5"; + case 81: return "A5"; + case 82: return "A#5"; + case 83: return "B5"; + case 84: return "C6"; + case 85: return "C#6"; + case 86: return "D6"; + case 87: return "D#6"; + case 88: return "E6"; + case 89: return "F6"; + case 90: return "F#6"; + case 91: return "G6"; + case 92: return "G#6"; + case 93: return "A6"; + case 94: return "A#6"; + case 95: return "B6"; + case 96: return "C7"; + case 97: return "C#7"; + case 98: return "D7"; + case 99: return "D#7"; + case 100: return "E7"; + case 101: return "F7"; + case 102: return "F#7"; + case 103: return "G7"; + case 104: return "G#7"; + case 105: return "A7"; + case 106: return "A#7"; + case 107: return "B7"; + case 108: return "C8"; + case 109: return "C#8"; + case 110: return "D8"; + case 111: return "D#8"; + case 112: return "E8"; + case 113: return "F8"; + case 114: return "F#8"; + case 115: return "G8"; + case 116: return "G#8"; + case 117: return "A8"; + case 118: return "A#8"; + case 119: return "B8"; + case 120: return "C9"; + case 121: return "C#9"; + case 122: return "D9"; + case 123: return"D#9"; + case 124: return "E9"; + case 125: return "F9"; + case 126: return "F#9"; + case 127: return "G9"; + default: return juce::String(v); + } + } + juce::String numToOscFmMode(float idx, Parameter::Description) { const auto ridx = juce::roundToInt(idx); @@ -1512,7 +1649,7 @@ namespace Virus {Parameter::Page::A, Parameter::Class::SOUNDBANK_A, 38, "Ringmodulator Volume", {0,127}, {},{}, true, false, false}, {Parameter::Page::A, Parameter::Class::SOUNDBANK_A|Parameter::Class::VIRUS_C, 39, "Noise Color", {0,127}, paramTo7bitSigned, textTo7bitSigned, true, false, false, true}, {Parameter::Page::A, Parameter::Class::SOUNDBANK_A, 40, "Cutoff", {0,127}, {},{}, true, false, false}, - {Parameter::Page::A, Parameter::Class::SOUNDBANK_A, 41, "Cutoff2", {0,127}, {},{}, true, false, false}, + {Parameter::Page::A, Parameter::Class::SOUNDBANK_A, 41, "Cutoff2", {0,127}, {},{}, true, false, false, true}, {Parameter::Page::A, Parameter::Class::SOUNDBANK_A, 42, "Filter1 Resonance", {0,127}, {},{}, true, false, false}, {Parameter::Page::A, Parameter::Class::SOUNDBANK_A, 43, "Filter2 Resonance", {0,127}, {},{}, true, false, false}, {Parameter::Page::A, Parameter::Class::SOUNDBANK_A, 44, "Filter1 Env Amt", {0,127}, {},{}, true, false, false}, @@ -1614,7 +1751,7 @@ namespace Virus {Parameter::Page::B, Parameter::Class::SOUNDBANK_B, 30, "Filter1 Env Polarity", {0,1}, numToNegPos, {}, true, false, true}, {Parameter::Page::B, Parameter::Class::SOUNDBANK_B, 31, "Filter1 Env Polarity", {0,1}, numToNegPos, {}, true, false, true}, {Parameter::Page::B, Parameter::Class::SOUNDBANK_B, 32, "Filter2 Cutoff Link", {0,1}, {},{}, true, false, true}, - {Parameter::Page::B, Parameter::Class::SOUNDBANK_B, 33, "Filter Keytrack Base", {0,127}, {},{}, true, false, false}, + {Parameter::Page::B, Parameter::Class::SOUNDBANK_B, 33, "Filter Keytrack Base", {0,127}, filterKeytrackBase,{}, true, true, false}, {Parameter::Page::B, Parameter::Class::SOUNDBANK_B|Parameter::Class::VIRUS_C, 34, "Osc FM Mode", {0,12}, numToOscFmMode,{}, true, true, false}, {Parameter::Page::B, Parameter::Class::SOUNDBANK_B, 35, "Osc Init Phase", {0,127}, {},{}, true, false, false}, {Parameter::Page::B, Parameter::Class::SOUNDBANK_B, 36, "Punch Intensity", {0,127}, {},{}, true, false, false}, diff --git a/source/jucePlugin/assets2/panel_1_marker_points.png b/source/jucePlugin/assets2/panel_1_marker_points.png Binary files differ. diff --git a/source/jucePlugin/assets2/panel_4_marker_points.png b/source/jucePlugin/assets2/panel_4_marker_points.png Binary files differ. diff --git a/source/jucePlugin/assets2/panels/panel_1.png b/source/jucePlugin/assets2/panels/panel_1.png Binary files differ. diff --git a/source/jucePlugin/assets2/panels/panel_4.png b/source/jucePlugin/assets2/panels/panel_4.png Binary files differ. diff --git a/source/jucePlugin/ui2/VirusEditor.cpp b/source/jucePlugin/ui2/VirusEditor.cpp @@ -34,7 +34,7 @@ VirusEditor::VirusEditor(VirusParameterBinding &_parameterBinding, AudioPluginAu addAndMakeVisible (m_mainButtons); m_arpEditor = std::make_unique<ArpEditor>(_parameterBinding, processorRef); - m_fxEditor = std::make_unique<FxEditor>(_parameterBinding); + m_fxEditor = std::make_unique<FxEditor>(_parameterBinding, processorRef); m_lfoEditor = std::make_unique<LfoEditor>(_parameterBinding); m_oscEditor = std::make_unique<OscEditor>(_parameterBinding); m_patchBrowser = std::make_unique<PatchBrowser>(_parameterBinding, processorRef); @@ -85,51 +85,21 @@ VirusEditor::VirusEditor(VirusParameterBinding &_parameterBinding, AudioPluginAu index++; }); - m_mainMenu.setLookAndFeel (&m_landfButtons); - - m_mainMenu.onClick = [this]() - { - selectorMenu.setLookAndFeel(&m_landfButtons); - SubSkinSizeSelector.setLookAndFeel(&m_landfButtons); - SubSkinSizeSelector.clear(); - - for (float d = 375; d < 1250; d = d + 125) - { - SubSkinSizeSelector.addItem(std::to_string(200 * int(d) / 1000) + "%", [this, d] - { - double dScaleFactor = float(d / 1000.0); - m_AudioPlugInEditor->setScaleFactor(dScaleFactor); - (*this).setSize(iSkinSizeWidth, iSkinSizeHeight); - m_properties->setValue("skin_scale_factor", juce::String(dScaleFactor)); - m_properties->save(); - }); - } - - selectorMenu.addSubMenu("Skin size", SubSkinSizeSelector, true); - selectorMenu.addItem("About", [this]() { AboutWindow(); }); - selectorMenu.showMenu(juce::PopupMenu::Options()); - }; - - //draw Main Menu Button - m_mainMenu.setBounds(2301 - m_mainMenu.kWidth / 2, 62 - m_mainMenu.kHeight / 2, m_mainMenu.kWidth, m_mainMenu.kHeight); - addAndMakeVisible(m_mainMenu); + //Draw Main Menu + ShowMainMenue(); //MainDisplay (Patchname) m_patchName.setBounds(1473, 35, 480, 58); m_patchName.setJustificationType(Justification::left); m_patchName.setFont(juce::Font("Register", "Normal", 30.f)); m_patchName.setEditable(false, true, true); - m_patchName.onTextChange = [this]() - { + m_patchName.onTextChange = [this]() { auto text = m_patchName.getText(); if(text.trim().length() > 0) { - if (text == "/pv") { // stupid debug thing to remove later - m_paramDisplayLocal = !m_paramDisplayLocal; - return; - } m_controller.setSinglePresetName(m_controller.getCurrentPart(), text); + m_arpEditor->refreshParts(); } - }; + }; addAndMakeVisible(m_patchName); //MainDisplay @@ -152,9 +122,7 @@ VirusEditor::VirusEditor(VirusParameterBinding &_parameterBinding, AudioPluginAu m_controlLabelValue.setJustificationType(Justification::centredRight); //m_controlLabelValue.setColour(juce::Label::textColourId, juce::Colours::red); m_controlLabelValue.setFont(juce::Font("Register", "Normal", 30.f)); - addAndMakeVisible(m_controlLabelValue); - - //m_controller.setCurrentPartPreset(0,virusLib::BankNumber::A,0); + addAndMakeVisible(m_controlLabelValue); //PresetsSwitch addAndMakeVisible(m_PresetLeft); @@ -165,11 +133,13 @@ VirusEditor::VirusEditor(VirusParameterBinding &_parameterBinding, AudioPluginAu m_PresetLeft.onClick = [this]() { processorRef.getController().setCurrentPartPreset(m_controller.getCurrentPart(), processorRef.getController().getCurrentPartBank(m_controller.getCurrentPart()), std::max(0, processorRef.getController().getCurrentPartProgram(m_controller.getCurrentPart()) - 1)); + postCommandMessage(VirusEditor::Commands::UpdateParts); }; m_PresetRight.onClick = [this]() { processorRef.getController().setCurrentPartPreset(m_controller.getCurrentPart(), processorRef.getController().getCurrentPartBank(m_controller.getCurrentPart()), std::min(127, processorRef.getController().getCurrentPartProgram(m_controller.getCurrentPart()) + 1)); + postCommandMessage(VirusEditor::Commands::UpdateParts); }; addAndMakeVisible(m_PresetPatchList); @@ -178,7 +148,7 @@ VirusEditor::VirusEditor(VirusParameterBinding &_parameterBinding, AudioPluginAu //Show Version m_version.setText(std::string(g_pluginVersionString), NotificationType::dontSendNotification); - m_version.setBounds(250, 1124, 50, 17); + m_version.setBounds(250, 1123, 50, 17); m_version.setColour(juce::Label::textColourId, juce::Colours::silver); m_version.setFont(juce::Font("Arial", "Bold", 20.f)); m_version.setJustificationType(Justification::left); @@ -187,7 +157,7 @@ VirusEditor::VirusEditor(VirusParameterBinding &_parameterBinding, AudioPluginAu //Show Synth Model m_SynthModel.setText(m_controller.getVirusModel() == virusLib::VirusModel::B ? "B" : "C", NotificationType::dontSendNotification); - m_SynthModel.setBounds(430, 1124, 50, 17); + m_SynthModel.setBounds(430, 1123, 50, 17); m_SynthModel.setFont(juce::Font("Arial", "Bold", 20.f)); m_SynthModel.setJustificationType(Justification::left); m_SynthModel.setColour(juce::Label::textColourId, juce::Colours::silver); @@ -196,7 +166,7 @@ VirusEditor::VirusEditor(VirusParameterBinding &_parameterBinding, AudioPluginAu //Show RomName m_RomName.setText(_processorRef.getRomName()+".bin", NotificationType::dontSendNotification); - m_RomName.setBounds(642, 1124, 150, 17); + m_RomName.setBounds(642, 1123, 150, 17); m_RomName.setColour(juce::Label::textColourId, juce::Colours::silver); m_RomName.setFont(juce::Font("Arial", "Bold", 20.f)); m_RomName.setJustificationType(Justification::left); @@ -206,6 +176,7 @@ VirusEditor::VirusEditor(VirusParameterBinding &_parameterBinding, AudioPluginAu m_controller.onProgramChange = [this]() { updateParts(); + m_arpEditor->refreshParts(); }; m_controller.getBankCount(); @@ -257,12 +228,46 @@ void VirusEditor::updateParts() } +void VirusEditor::ShowMainMenue() +{ + m_mainMenu.setLookAndFeel (&m_landfButtons); + + m_mainMenu.onClick = [this]() + { + selectorMenu.setLookAndFeel(&m_landfButtons); + selectorMenu.clear(); + SubSkinSizeSelector.setLookAndFeel(&m_landfButtons); + SubSkinSizeSelector.clear(); + + for (float d = 375; d < 1250; d = d + 125) + { + SubSkinSizeSelector.addItem(std::to_string(200 * int(d) / 1000) + "%", [this, d] + { + double dScaleFactor = float(d / 1000.0); + m_AudioPlugInEditor->setScaleFactor(dScaleFactor); + (*this).setSize(iSkinSizeWidth, iSkinSizeHeight); + m_properties->setValue("skin_scale_factor", juce::String(dScaleFactor)); + m_properties->save(); + }); + } + + selectorMenu.addSubMenu("Skin size", SubSkinSizeSelector, true); + selectorMenu.addItem("About", [this]() { AboutWindow(); }); + selectorMenu.showMenu(juce::PopupMenu::Options()); + }; + + //draw Main Menu Button + m_mainMenu.setBounds(2301 - m_mainMenu.kWidth / 2, 62 - m_mainMenu.kHeight / 2, m_mainMenu.kWidth, m_mainMenu.kHeight); + addAndMakeVisible(m_mainMenu); +} + void VirusEditor::ShowMenuePatchList() { auto pt = m_controller.getCurrentPart(); selector.setLookAndFeel (&m_landfButtons); - + selector.clear(); + for (uint8_t b = 0; b < m_controller.getBankCount(); ++b) { const auto bank = virusLib::fromArrayIndex(b); @@ -273,6 +278,7 @@ void VirusEditor::ShowMenuePatchList() const auto presetName = presetNames[j]; p.addItem(presetNames[j], [this, bank, j, pt, presetName] { m_controller.setCurrentPartPreset(pt, bank, j); + postCommandMessage(VirusEditor::Commands::UpdateParts); //m_presetNames[pt].setButtonText(presetName); }); } @@ -393,7 +399,7 @@ void VirusEditor::handleCommandMessage(int commandId) { switch (commandId) { case Commands::Rebind: recreateControls(); - case Commands::UpdateParts: { updateParts();}; + case Commands::UpdateParts: { updateParts(); m_arpEditor->refreshParts();}; default: return; } } @@ -404,7 +410,7 @@ void VirusEditor::recreateControls() removeChildComponent(m_lfoEditor.get()); removeChildComponent(m_fxEditor.get()); removeChildComponent(m_arpEditor.get()); - removeChildComponent(m_patchBrowser.get()); + //removeChildComponent(m_patchBrowser.get()); m_oscEditor = std::make_unique<OscEditor>(m_parameterBinding); addChildComponent(m_oscEditor.get()); @@ -412,14 +418,14 @@ void VirusEditor::recreateControls() m_lfoEditor = std::make_unique<LfoEditor>(m_parameterBinding); addChildComponent(m_lfoEditor.get()); - m_fxEditor = std::make_unique<FxEditor>(m_parameterBinding); + m_fxEditor = std::make_unique<FxEditor>(m_parameterBinding, processorRef); addChildComponent(m_fxEditor.get()); m_arpEditor = std::make_unique<ArpEditor>(m_parameterBinding, processorRef); addChildComponent(m_arpEditor.get()); - m_patchBrowser = std::make_unique<PatchBrowser>(m_parameterBinding, processorRef); - addChildComponent(m_patchBrowser.get()); + /*m_patchBrowser = std::make_unique<PatchBrowser>(m_parameterBinding, processorRef); + addChildComponent(m_patchBrowser.get());*/ m_mainButtons.updateSection(); resized(); diff --git a/source/jucePlugin/ui2/VirusEditor.h b/source/jucePlugin/ui2/VirusEditor.h @@ -24,6 +24,7 @@ public: void recreateControls(); void updatePartsPresetNames(); void ShowMenuePatchList(); + void ShowMainMenue(); void updateParts(); enum Commands { diff --git a/source/jucePlugin/ui2/Virus_LookAndFeel.h b/source/jucePlugin/ui2/Virus_LookAndFeel.h @@ -6,8 +6,8 @@ constexpr auto comboBoxHeight = 38; constexpr auto comboBoxWidth = 126; -constexpr auto comboBox2Height = 60; -constexpr auto comboBox2Width = 49; +constexpr auto comboBox2Height = 52; +constexpr auto comboBox2Width = 74; constexpr auto comboBox3Height = 52; constexpr auto comboBox3Width = 186; diff --git a/source/jucePlugin/ui2/Virus_Panel1_OscEditor.cpp b/source/jucePlugin/ui2/Virus_Panel1_OscEditor.cpp @@ -186,7 +186,7 @@ OscEditor::OscEditor(VirusParameterBinding& _parameterBinding) m_filterMode2.setBounds(1710+comboBoxXMargin - comboBox3Width / 2, 353 - comboBox3Height / 2, comboBox3Width, comboBox3Height); m_filterRouting.setBounds(2017+comboBoxXMargin - comboBox3Width / 2, 242 - comboBox3Height / 2, comboBox3Width, comboBox3Height); m_saturationCurve.setBounds(2017+comboBoxXMargin - comboBox3Width / 2, 353 - comboBox3Height / 2, comboBox3Width, comboBox3Height); - m_keyFollowBase.setBounds(1884+comboBoxXMargin - comboBox2Width / 2, 303 - comboBox2Height / 2, comboBox2Width, comboBox2Height); + m_keyFollowBase.setBounds(1876+comboBoxXMargin - comboBox2Width / 2, 303 - comboBox2Height / 2, comboBox2Width, comboBox2Height); addAndMakeVisible(m_filterMode1); addAndMakeVisible(m_filterMode2); diff --git a/source/jucePlugin/ui2/Virus_Panel3_FxEditor.cpp b/source/jucePlugin/ui2/Virus_Panel3_FxEditor.cpp @@ -6,7 +6,7 @@ using namespace juce; -FxEditor::FxEditor(VirusParameterBinding &_parameterBinding) +FxEditor::FxEditor(VirusParameterBinding &_parameterBinding, AudioPluginAudioProcessor &_processorRef): m_controller(_processorRef.getController()) { setupBackground(*this, m_background, BinaryData::panel_3_png, BinaryData::panel_3_pngSize); setBounds(m_background->getDrawableBounds().toNearestIntEdges()); @@ -144,6 +144,17 @@ FxEditor::FxEditor(VirusParameterBinding &_parameterBinding) _parameterBinding.bind(m_delayReverbSend, Virus::Param_EffectSend); _parameterBinding.bind(m_delayReverbMode, Virus::Param_DelayReverbMode); + + auto p = m_controller.getParameter(Virus::Param_DelayReverbMode, 0); + if (p) { + const auto val = (int)p->getValueObject().getValueSource().getValue(); + DelayReverb(); + + p->onValueChanged = nullptr; + p->onValueChanged = [this, p]() { + DelayReverb(); + }; + } //Reverb selected // Reverb @@ -194,7 +205,6 @@ FxEditor::FxEditor(VirusParameterBinding &_parameterBinding) _parameterBinding.bind(m_delayClock, Virus::Param_DelayClock); _parameterBinding.bind(m_delayShape, Virus::Param_DelayLfoShape); - // Vocoder for (auto *s : {&m_vocoderCenterFreq, &m_vocoderModOffset, &m_vocoderModQ, &m_vocoderModSpread, &m_vocoderCarrQ, &m_vocoderCarrSpread, &m_vocoderSpectralBal, &m_vocoderBands, &m_vocoderAttack, &m_vocoderRelease, @@ -243,16 +253,72 @@ FxEditor::FxEditor(VirusParameterBinding &_parameterBinding) _parameterBinding.bind(m_vocoderModInput, Virus::Param_InputSelect); _parameterBinding.bind(m_vocoderLink, Virus::Param_Filter2CutoffLink); - startTimerHz(2); + auto p1 = m_controller.getParameter(Virus::Param_VocoderMode, 0); + if (p1) { + const auto val = (int)p1->getValueObject().getValueSource().getValue(); + Vocoder(); + + p1->onValueChanged = nullptr; + p1->onValueChanged = [this, p1]() { + Vocoder(); + }; + } + } -void FxEditor::timerCallback() +void FxEditor::Vocoder() { + //Vocoder + //m_vocoderMode + auto p = m_controller.getParameter(Virus::Param_VocoderMode, 0); + const auto value = (int)p->getValueObject().getValueSource().getValue(); + m_vocoderMode.setSelectedId(value + 1, juce::dontSendNotification); + + int iSelectedIndex = m_vocoderMode.getSelectedItemIndex(); + bool bVocoder = (iSelectedIndex > 0); + float fAlpha = (bVocoder)?1.0f:0.3f; + + m_vocoderCenterFreq.setEnabled(bVocoder); + m_vocoderCenterFreq.setAlpha(fAlpha); + m_vocoderModOffset.setEnabled(bVocoder); + m_vocoderModOffset.setAlpha(fAlpha); + m_vocoderModQ.setEnabled(bVocoder); + m_vocoderModQ.setAlpha(fAlpha); + m_vocoderModSpread.setEnabled(bVocoder); + m_vocoderModSpread.setAlpha(fAlpha); + m_vocoderCarrQ.setEnabled(bVocoder); + m_vocoderCarrQ.setAlpha(fAlpha); + m_vocoderCarrSpread.setEnabled(bVocoder); + m_vocoderCarrSpread.setAlpha(fAlpha); + m_vocoderSpectralBal.setEnabled(bVocoder); + m_vocoderSpectralBal.setAlpha(fAlpha); + m_vocoderBands.setEnabled(bVocoder); + m_vocoderBands.setAlpha(fAlpha); + m_vocoderAttack.setEnabled(bVocoder); + m_vocoderAttack.setAlpha(fAlpha); + m_vocoderRelease.setEnabled(bVocoder); + m_vocoderRelease.setAlpha(fAlpha); + m_vocoderSourceBal.setEnabled(bVocoder); + m_vocoderSourceBal.setAlpha(fAlpha); + //m_vocoderMode.setVisible(bVocoder); + m_vocoderModInput.setEnabled(bVocoder); + m_vocoderModInput.setAlpha(fAlpha); + m_vocoderLink.setEnabled(bVocoder); + m_vocoderLink.setAlpha(fAlpha); +} + +void FxEditor::DelayReverb() +{ + //rebind(); + auto p = m_controller.getParameter(Virus::Param_DelayReverbMode, 0); + const auto value = (int)p->getValueObject().getValueSource().getValue(); + m_delayReverbMode.setSelectedId(value + 1, juce::dontSendNotification); + //Delay/Reverb int iSelectedIndex = m_delayReverbMode.getSelectedItemIndex(); bool bReverb = (iSelectedIndex >= 2 && iSelectedIndex <= 4); float fReverbAlpha = (bReverb)?1.0f:0.3f; - bool bDelay = (iSelectedIndex ==1 || iSelectedIndex > 5); + bool bDelay = (iSelectedIndex ==1 || iSelectedIndex >= 5); float fDelayAlpha = (bDelay)?1.0f:0.3f; m_reverbDecayTime.setEnabled(bReverb); @@ -282,38 +348,4 @@ void FxEditor::timerCallback() m_delayClock.setAlpha(fDelayAlpha); m_delayShape.setEnabled(bDelay); m_delayShape.setAlpha(fDelayAlpha); - - //Vocoder - //m_vocoderMode - iSelectedIndex = m_vocoderMode.getSelectedItemIndex(); - bool bVocoder = (iSelectedIndex > 0); - float fAlpha = (bVocoder)?1.0f:0.3f; - - m_vocoderCenterFreq.setEnabled(bVocoder); - m_vocoderCenterFreq.setAlpha(fAlpha); - m_vocoderModOffset.setEnabled(bVocoder); - m_vocoderModOffset.setAlpha(fAlpha); - m_vocoderModQ.setEnabled(bVocoder); - m_vocoderModQ.setAlpha(fAlpha); - m_vocoderModSpread.setEnabled(bVocoder); - m_vocoderModSpread.setAlpha(fAlpha); - m_vocoderCarrQ.setEnabled(bVocoder); - m_vocoderCarrQ.setAlpha(fAlpha); - m_vocoderCarrSpread.setEnabled(bVocoder); - m_vocoderCarrSpread.setAlpha(fAlpha); - m_vocoderSpectralBal.setEnabled(bVocoder); - m_vocoderSpectralBal.setAlpha(fAlpha); - m_vocoderBands.setEnabled(bVocoder); - m_vocoderBands.setAlpha(fAlpha); - m_vocoderAttack.setEnabled(bVocoder); - m_vocoderAttack.setAlpha(fAlpha); - m_vocoderRelease.setEnabled(bVocoder); - m_vocoderRelease.setAlpha(fAlpha); - m_vocoderSourceBal.setEnabled(bVocoder); - m_vocoderSourceBal.setAlpha(fAlpha); - //m_vocoderMode.setVisible(bVocoder); - m_vocoderModInput.setEnabled(bVocoder); - m_vocoderModInput.setAlpha(fAlpha); - m_vocoderLink.setEnabled(bVocoder); - m_vocoderLink.setAlpha(fAlpha); } \ No newline at end of file diff --git a/source/jucePlugin/ui2/Virus_Panel3_FxEditor.h b/source/jucePlugin/ui2/Virus_Panel3_FxEditor.h @@ -6,13 +6,15 @@ class VirusParameterBinding; -class FxEditor : public juce::Component, private juce::Timer +class FxEditor : public juce::Component { public: - FxEditor(VirusParameterBinding& _parameterBinding); + FxEditor(VirusParameterBinding& _parameterBinding, AudioPluginAudioProcessor &_processorRef); private: - void timerCallback(); + void DelayReverb(); + void Vocoder(); + Virus::Controller &m_controller; // Env Follower juce::Slider m_envFollowLevel, m_envFollowAttack, m_eEnvFollowRelease; diff --git a/source/jucePlugin/ui2/Virus_Panel4_ArpEditor.cpp b/source/jucePlugin/ui2/Virus_Panel4_ArpEditor.cpp @@ -14,34 +14,10 @@ ArpEditor::ArpEditor(VirusParameterBinding &_parameterBinding, AudioPluginAudioP { setupBackground(*this, m_background, BinaryData::panel_4_png, BinaryData::panel_4_pngSize); setBounds(m_background->getDrawableBounds().toNearestIntEdges()); - bRunning = false; - - //Mode - m_WorkingMode.addItem("Single",1); - m_WorkingMode.addItem("Multi & Single",2); - m_WorkingMode.addItem("Multi",3); - m_WorkingMode.setBounds(1234 + comboBoxXMargin - comboBox3Width / 2, 868 - comboBox3Height / 2, comboBox3Width, comboBox3Height); - m_WorkingMode.setSelectedItemIndex(0); - - m_WorkingMode.onChange = [this]() - { - if (bRunning ) - { - if (m_WorkingMode.getSelectedItemIndex()==0) - setPlayMode(virusLib::PlayMode::PlayModeSingle); - else if (m_WorkingMode.getSelectedItemIndex()==1) - setPlayMode(virusLib::PlayMode::PlayModeMultiSingle); - else - setPlayMode(virusLib::PlayMode::PlayModeMulti); - } - }; - - addAndMakeVisible(m_WorkingMode); - //MIDI settings - auto midiIn = m_properties->getValue("midi_input", ""); - auto midiOut = m_properties->getValue("midi_output", ""); + juce::String midiIn = m_properties->getValue("midi_input", ""); + juce::String midiOut = m_properties->getValue("midi_output", ""); if (midiIn != "") { @@ -98,6 +74,7 @@ ArpEditor::ArpEditor(VirusParameterBinding &_parameterBinding, AudioPluginAudioP m_cmbMidiInput.onChange = [this]() { updateMidiInput(m_cmbMidiInput.getSelectedItemIndex()); }; m_cmbMidiOutput.onChange = [this]() { updateMidiOutput(m_cmbMidiOutput.getSelectedItemIndex()); }; + int iMarginYChannels = 118; int iMarginXChannels = 0; int iIndex = 0; @@ -105,13 +82,6 @@ ArpEditor::ArpEditor(VirusParameterBinding &_parameterBinding, AudioPluginAudioP //Channels for (auto pt = 0; pt < 16; pt++) { - /*m_partLabels[pt].setBounds(34, 161 + pt * (36), 24, 36); - m_partLabels[pt].setText(juce::String(pt + 1), juce::dontSendNotification); - m_partLabels[pt].setColour(0, juce::Colours::white); - m_partLabels[pt].setColour(1, juce::Colour(45, 24, 24)); - m_partLabels[pt].setJustificationType(Justification::centred); - addAndMakeVisible(m_partLabels[pt]);*/ - if (pt==8) { iIndex=0; @@ -148,6 +118,7 @@ ArpEditor::ArpEditor(VirusParameterBinding &_parameterBinding, AudioPluginAudioP p.addItem(presetNames[j], [this, bank, j, pt, presetName] { m_controller.setCurrentPartPreset(pt, bank, j); m_PresetPatch[pt].setButtonText(presetName); + getParentComponent()->postCommandMessage(VirusEditor::Commands::UpdateParts); }); } std::stringstream bankName; @@ -164,15 +135,14 @@ ArpEditor::ArpEditor(VirusParameterBinding &_parameterBinding, AudioPluginAudioP m_prevPatch[pt].onClick = [this, pt]() { - m_controller.setCurrentPartPreset( - pt, m_controller.getCurrentPartBank(pt), - std::max(0, m_controller.getCurrentPartProgram(pt) - 1)); + m_controller.setCurrentPartPreset(pt, m_controller.getCurrentPartBank(pt),std::max(0, m_controller.getCurrentPartProgram(pt) - 1)); + getParentComponent()->postCommandMessage(VirusEditor::Commands::UpdateParts); }; + m_nextPatch[pt].onClick = [this, pt]() { - m_controller.setCurrentPartPreset( - pt, m_controller.getCurrentPartBank(pt), - std::min(127, m_controller.getCurrentPartProgram(pt) + 1)); + m_controller.setCurrentPartPreset(pt, m_controller.getCurrentPartBank(pt),std::min(127, m_controller.getCurrentPartProgram(pt) + 1)); + getParentComponent()->postCommandMessage(VirusEditor::Commands::UpdateParts); }; addAndMakeVisible(m_prevPatch[pt]); @@ -186,59 +156,33 @@ ArpEditor::ArpEditor(VirusParameterBinding &_parameterBinding, AudioPluginAudioP m_partVolumes[pt].setLookAndFeel(&m_lookAndFeelSmallButton); m_partVolumes[pt].setBounds(407 - knobSizeSmall / 2 + iMarginXChannels, 98 - knobSizeSmall / 2 + iIndex * (iMarginYChannels), knobSizeSmall, knobSizeSmall); - m_parameterBinding.bind(m_partVolumes[pt], Virus::Param_PartVolume, pt); + _parameterBinding.bind(m_partVolumes[pt], Virus::Param_PartVolume, pt); addAndMakeVisible(m_partVolumes[pt]); m_partPans[pt].setLookAndFeel(&m_lookAndFeelSmallButton); m_partPans[pt].setBounds(495 - knobSizeSmall / 2 + iMarginXChannels, 98 - knobSizeSmall / 2 + iIndex * (iMarginYChannels), knobSizeSmall, knobSizeSmall); - m_parameterBinding.bind(m_partPans[pt], Virus::Param_Panorama, pt); + _parameterBinding.bind(m_partPans[pt], Virus::Param_Panorama, pt); addAndMakeVisible(m_partPans[pt]); iIndex++; } - m_partSelect[m_controller.getCurrentPart()].setToggleState(true, NotificationType::sendNotification); - - /*m_btSingleMode.setRadioGroupId(0x3cf); - m_btMultiMode.setRadioGroupId(0x3cf); - m_btMultiSingleMode.setRadioGroupId(0x3cf); - addAndMakeVisible(m_btSingleMode); - addAndMakeVisible(m_btMultiMode); - addAndMakeVisible(m_btMultiSingleMode); - /m_btSingleMode.setTopLeftPosition(102, 756); - m_btSingleMode.setSize(70, 30); - - m_btMultiMode.getToggleStateValue().referTo(*m_controller.getParamValue(Virus::Param_PlayMode)); - m_btSingleMode.setClickingTogglesState(true); - m_btMultiMode.setClickingTogglesState(true); - m_btMultiSingleMode.setClickingTogglesState(true); - - m_btSingleMode.setColour(TextButton::ColourIds::textColourOnId, juce::Colours::white); - m_btSingleMode.setColour(TextButton::ColourIds::textColourOffId, juce::Colours::grey); - m_btMultiMode.setColour(TextButton::ColourIds::textColourOnId, juce::Colours::white); - m_btMultiMode.setColour(TextButton::ColourIds::textColourOffId, juce::Colours::grey); - m_btMultiSingleMode.setColour(TextButton::ColourIds::textColourOnId, juce::Colours::white); - m_btMultiSingleMode.setColour(TextButton::ColourIds::textColourOffId, juce::Colours::grey); - - m_btSingleMode.onClick = [this]() { setPlayMode(virusLib::PlayMode::PlayModeSingle); }; - m_btMultiSingleMode.onClick = [this]() { setPlayMode(virusLib::PlayMode::PlayModeMultiSingle); }; - m_btMultiMode.onClick = [this]() { setPlayMode(virusLib::PlayMode::PlayModeMulti); }; - - m_btMultiSingleMode.setBounds(m_btSingleMode.getBounds().translated(m_btSingleMode.getWidth()+4, 0)); - m_btMultiMode.setBounds(m_btMultiSingleMode.getBounds().translated(m_btMultiSingleMode.getWidth()+4, 0)); - - const uint8_t playMode = g_playMode; - if (playMode == virusLib::PlayModeSingle) { - m_btSingleMode.setToggleState(true, juce::dontSendNotification); - } - else if (playMode == virusLib::PlayModeMultiSingle) { - m_btMultiSingleMode.setToggleState(true, juce::dontSendNotification); - } - else if (playMode == virusLib::PlayModeMulti) { - m_btMultiMode.setToggleState(true, juce::dontSendNotification); - }*/ - startTimerHz(5); + m_btWorkingMode.setBounds(1203 - m_btWorkingMode.kWidth / 2, 868 - m_btWorkingMode.kHeight / 2, m_btWorkingMode.kWidth, m_btWorkingMode.kHeight); + addAndMakeVisible(m_btWorkingMode); + m_btWorkingMode.onClick = [this]() + { + if (m_btWorkingMode.getToggleState()==1) + { + setPlayMode(virusLib::PlayMode::PlayModeSingle); + } + else + { + setPlayMode(virusLib::PlayMode::PlayModeMulti); + } + updatePlayModeButtons(); + }; + refreshParts(); } ArpEditor::~ArpEditor() @@ -250,25 +194,7 @@ ArpEditor::~ArpEditor() } } -void ArpEditor::changePart(uint8_t _part) -{ - for (auto &p : m_partSelect) - { - p.setToggleState(false, juce::dontSendNotification); - } - m_partSelect[_part].setToggleState(true, juce::dontSendNotification); - m_parameterBinding.setPart(_part); - //getParentComponent()->postCommandMessage(VirusEditor::Commands::Rebind); -} - -void ArpEditor::setPlayMode(uint8_t _mode) -{ - m_controller.getParameter(Virus::Param_PlayMode)->setValue(_mode); - g_playMode = _mode; - //getParentComponent()->postCommandMessage(VirusEditor::Commands::Rebind); -} - -void ArpEditor::timerCallback() +void ArpEditor::refreshParts() { const auto multiMode = m_controller.isMultiMode(); for (auto pt = 0; pt < 16; pt++) @@ -295,8 +221,52 @@ void ArpEditor::timerCallback() } if (singlePartOrInMulti) m_presetNames[pt].setText(m_controller.getCurrentPartPresetName(pt), juce::dontSendNotification); + else + m_presetNames[pt].setText("", juce::dontSendNotification); + } + + updatePlayModeButtons(); +} + +void ArpEditor::changePart(uint8_t _part) +{ + for (auto &p : m_partSelect) + { + p.setToggleState(false, juce::dontSendNotification); + } + m_partSelect[_part].setToggleState(true, juce::dontSendNotification); + m_parameterBinding.setPart(_part); + getParentComponent()->postCommandMessage(VirusEditor::Commands::UpdateParts); + getParentComponent()->postCommandMessage(VirusEditor::Commands::Rebind); +} + +void ArpEditor::setPlayMode(uint8_t _mode) +{ + + m_controller.getParameter(Virus::Param_PlayMode)->setValue(_mode); + if (_mode == virusLib::PlayModeSingle && m_controller.getCurrentPart() != 0) + { + changePart(0); + } + getParentComponent()->postCommandMessage(VirusEditor::Commands::Rebind); +} + + +void ArpEditor::updatePlayModeButtons() +{ + const auto modeParam = m_controller.getParameter(Virus::Param_PlayMode, 0); + if (modeParam == nullptr) { + return; + } + const auto _mode = (int)modeParam->getValue(); + if (_mode == virusLib::PlayModeSingle) + { + m_btWorkingMode.setToggleState(true, juce::dontSendNotification); + } + else if (_mode == virusLib::PlayModeMulti || _mode == virusLib::PlayModeMultiSingle) + { + m_btWorkingMode.setToggleState(false, juce::dontSendNotification); } - bRunning=true; } void ArpEditor::updateMidiInput(int index) diff --git a/source/jucePlugin/ui2/Virus_Panel4_ArpEditor.h b/source/jucePlugin/ui2/Virus_Panel4_ArpEditor.h @@ -8,12 +8,13 @@ class VirusParameterBinding; -class ArpEditor : public juce::Component, private juce::Timer +class ArpEditor : public juce::Component { public: ArpEditor(VirusParameterBinding &_parameterBinding, AudioPluginAudioProcessor &_processorRef); ArpEditor::~ArpEditor(); static constexpr auto kPartGroupId = 0x3FBBC; + void refreshParts(); private: void updateMidiInput(int index); void updateMidiOutput(int index); @@ -25,8 +26,7 @@ private: //Channels void changePart(uint8_t _part); void setPlayMode(uint8_t _mode); - void timerCallback() override; - bool bRunning; + void updatePlayModeButtons(); Virus::Controller &m_controller; VirusParameterBinding &m_parameterBinding; @@ -39,7 +39,7 @@ private: juce::Slider m_partVolumes[16]; juce::Slider m_partPans[16]; - //juce::TextButton m_btSingleMode; + Buttons::Button2 m_btWorkingMode; //juce::TextButton m_btMultiSingleMode; //juce::TextButton m_btMultiMode;