NeuralPi

Raspberry Pi guitar pedal using neural networks to emulate real amps and effects
Log | Files | Refs | Submodules | README

commit 06fdd7a0d5cd632a373d0a8d932a2cdd3cef3927
parent 3650e9cc84d3f8bb059be3c8fc5571bdf561f5da
Author: keith <kbloemer89@gmail.com>
Date:   Mon, 31 May 2021 05:21:14 -0500

WIP testing osc messages

Diffstat:
MSource/PluginEditor.cpp | 10+++++++---
MSource/PluginProcessor.cpp | 14+++++++++-----
MSource/PluginProcessor.h | 8++++----
3 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp @@ -87,7 +87,7 @@ NeuralPiAudioProcessorEditor::NeuralPiAudioProcessorEditor (NeuralPiAudioProcess ampGainKnob.setNumDecimalPlacesToDisplay(1); ampGainKnob.addListener(this); ampGainKnob.setRange(-12.0, 12.0); - ampGainKnob.setValue(processor.ampGainKnobState); + ampGainKnob.setValue(1.0); ampGainKnob.setSliderStyle(juce::Slider::SliderStyle::RotaryVerticalDrag); ampGainKnob.setTextBoxStyle(juce::Slider::TextEntryBoxPosition::NoTextBox, false, 50, 20); ampGainKnob.setNumDecimalPlacesToDisplay(1); @@ -127,7 +127,7 @@ NeuralPiAudioProcessorEditor::NeuralPiAudioProcessorEditor (NeuralPiAudioProcess ampMasterKnob.setNumDecimalPlacesToDisplay(1); ampMasterKnob.addListener(this); ampMasterKnob.setRange(-48.0, 0.0); - ampMasterKnob.setValue(processor.ampMasterKnobState); + ampMasterKnob.setValue(1.0); ampMasterKnob.setSliderStyle(juce::Slider::SliderStyle::RotaryVerticalDrag); ampMasterKnob.setTextBoxStyle(juce::Slider::TextEntryBoxPosition::NoTextBox, false, 50, 20 ); ampMasterKnob.setNumDecimalPlacesToDisplay(1); @@ -316,16 +316,20 @@ void NeuralPiAudioProcessorEditor::buttonClicked(juce::Button* button) void NeuralPiAudioProcessorEditor::sliderValueChanged(Slider* slider) { // Amp + /* if (slider == &ampGainKnob) processor.set_ampDrive(slider->getValue()); else if (slider == &ampMasterKnob) processor.set_ampMaster(slider->getValue()); - else if (slider == &modelKnob) + */ + //else + if (slider == &modelKnob) if (slider->getValue() >= 0 && slider->getValue() < processor.jsonFiles.size()) { processor.loadConfig(processor.jsonFiles[slider->getValue()]); processor.current_model_index = modelSelect.getSelectedItemIndex(); modelSelect.setSelectedItemIndex(slider->getValue(), juce::NotificationType::dontSendNotification); } + } diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp @@ -161,8 +161,10 @@ void NeuralPiAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffe // Amp ============================================================================= if (amp_state == 1) { - buffer.applyGain(ampDrive); - //buffer.applyGain(gainParam->get()); + auto gain = static_cast<float> (gainParam->get()); + auto master = static_cast<float> (masterParam->get()); + //buffer.applyGain(ampDrive); + buffer.applyGain(gain); // Apply LSTM model if (model_loaded == 1) { @@ -170,8 +172,8 @@ void NeuralPiAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffe } // Master Volume - buffer.applyGain(ampMaster); - //buffer.applyGain(masterParam->get()); + //buffer.applyGain(ampMaster); + buffer.applyGain(master); } for (int ch = 1; ch < buffer.getNumChannels(); ++ch) @@ -318,9 +320,10 @@ float NeuralPiAudioProcessor::convertLogScale(float in_value, float x_min, float return converted_value; } +/* void NeuralPiAudioProcessor::set_ampDrive(float db_ampDrive) { - ampDrive = decibelToLinear(db_ampDrive); + gainParam = decibelToLinear(db_ampDrive); ampGainKnobState = db_ampDrive; } @@ -333,6 +336,7 @@ void NeuralPiAudioProcessor::set_ampMaster(float db_ampMaster) ampMaster = decibelToLinear(db_ampMaster); } } +*/ float NeuralPiAudioProcessor::decibelToLinear(float dbValue) { diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h @@ -96,8 +96,8 @@ public: int current_model_index = 0; // Amp knob states - float ampGainKnobState = 0.0; - float ampMasterKnobState = -24.0; + //float ampGainKnobState = 0.0; + //float ampMasterKnobState = -24.0; RT_LSTM LSTM; @@ -106,8 +106,8 @@ public: private: // Amp - float ampDrive = 1.0; - float ampMaster = 1.0; + //float ampDrive = 1.0; + //float ampMaster = 1.0; var dummyVar;