SmartGuitarAmp

Guitar plugin made with JUCE that uses neural networks to emulate a tube amplifier
Log | Files | Refs | Submodules | README

commit 9ccec59e5264371d66fa9aaf288fe37bb93d80c5
parent 5db0609033302c1ad40b06fa9f0d60a81066843a
Author: keith <[email protected]>
Date:   Wed, 11 Nov 2020 09:02:48 -0600

Added save tone state

Diffstat:
Mplugins/SmartAmp/Source/PluginEditor.cpp | 13++++++++++---
Mplugins/SmartAmp/Source/PluginEditor.h | 1+
Mplugins/SmartAmp/Source/PluginProcessor.cpp | 6+++---
Mplugins/SmartAmp/Source/PluginProcessor.h | 2++
4 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/plugins/SmartAmp/Source/PluginEditor.cpp b/plugins/SmartAmp/Source/PluginEditor.cpp @@ -34,7 +34,7 @@ WaveNetVaAudioProcessorEditor::WaveNetVaAudioProcessorEditor (WaveNetVaAudioProc loadButton.addListener(this); addAndMakeVisible(modelLabel); - modelLabel.setText("", juce::NotificationType::dontSendNotification); + modelLabel.setText(processor.loaded_tone_name, juce::NotificationType::dontSendNotification); modelLabel.setJustificationType(juce::Justification::left); modelLabel.setColour(juce::Label::textColourId, juce::Colours::black); @@ -158,7 +158,11 @@ WaveNetVaAudioProcessorEditor::WaveNetVaAudioProcessorEditor (WaveNetVaAudioProc setSize (1085, 660); // Load the preset wavenet json model from the project resources - processor.loadConfigAmp(); + if (processor.loaded_tone_name == "") { + processor.loadConfigAmp(); + } else { + processor.loadConfig(processor.loaded_tone); + } } WaveNetVaAudioProcessorEditor::~WaveNetVaAudioProcessorEditor() @@ -259,8 +263,10 @@ void WaveNetVaAudioProcessorEditor::loadButtonClicked() { File file = chooser.getResult(); processor.loadConfig(file); - juce::String fname = file.getFileName(); + fname = file.getFileName(); modelLabel.setText(fname, juce::NotificationType::dontSendNotification); + processor.loaded_tone = file; + processor.loaded_tone_name = fname; } } @@ -298,6 +304,7 @@ void WaveNetVaAudioProcessorEditor::ampCleanLeadButtonClicked() { processor.set_ampEQ(ampLeadBassKnob.getValue(), ampLeadMidKnob.getValue(), ampLeadTrebleKnob.getValue(), ampPresenceKnob.getValue()); } modelLabel.setText("", juce::NotificationType::dontSendNotification); + processor.loaded_tone_name = ""; repaint(); } diff --git a/plugins/SmartAmp/Source/PluginEditor.h b/plugins/SmartAmp/Source/PluginEditor.h @@ -61,6 +61,7 @@ private: TextButton loadButton; Label modelLabel; + juce::String fname; virtual void buttonClicked(Button* button) override; void loadButtonClicked(); virtual void sliderValueChanged(Slider* slider) override; diff --git a/plugins/SmartAmp/Source/PluginProcessor.cpp b/plugins/SmartAmp/Source/PluginProcessor.cpp @@ -163,9 +163,9 @@ void WaveNetVaAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuff // Master Volume buffer.applyGain(ampMaster); - if (amp_lead == 1) {// add extra clean boost because this particular clean model is very quiet - buffer.applyGain(15.0); - } + //if (amp_lead == 1) {// add extra clean boost because this particular clean model is very quiet + //buffer.applyGain(15.0); + //} } diff --git a/plugins/SmartAmp/Source/PluginProcessor.h b/plugins/SmartAmp/Source/PluginProcessor.h @@ -75,6 +75,8 @@ public: // Pedal/amp states int amp_state = 1; // 0 = off, 1 = on int amp_lead = 1; // 1 = clean, 0 = lead + File loaded_tone; + juce::String loaded_tone_name; // Amp knob states float ampPresenceKnobState = 0.0;