commit 585810a7c6a29e0cce2570e1d1d3b5eee23e3f63
parent fcf2f4dcca281fb4c14ed1eddd64e489f899e654
Author: Keith <smartguitarml@gmail.com>
Date: Thu, 6 Oct 2022 17:05:48 -0500
Updates
Diffstat:
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/src/PluginProcessor.cpp b/src/PluginProcessor.cpp
@@ -165,19 +165,19 @@ void ProteusAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer
// Overdrive Pedal ==================================================================
if (fw_state == 1) {
- auto block44k = resampler.processIn(block);
+
if (conditioned == false) {
// Apply ramped changes for gain smoothing
if (driveValue == previousDriveValue)
{
- buffer.applyGain(driveValue*20.0);
+ buffer.applyGain(driveValue*10.0);
}
else {
- buffer.applyGainRamp(0, (int) buffer.getNumSamples(), previousDriveValue * 20.0, driveValue * 20.0);
+ buffer.applyGainRamp(0, (int) buffer.getNumSamples(), previousDriveValue * 10.0, driveValue * 10.0);
previousDriveValue = driveValue;
}
-
+ auto block44k = resampler.processIn(block);
for (int ch = 0; ch < buffer.getNumChannels(); ++ch)
{
// Apply LSTM model
@@ -188,11 +188,12 @@ void ProteusAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer
LSTM2.process(block44k.getChannelPointer(1), block44k.getChannelPointer(1), (int)block44k.getNumSamples());
}
}
+ resampler.processOut(block44k, block);
} else {
- buffer.applyGain(10.0); // Apply default boost to help sound
+ buffer.applyGain(5.0); // Apply default boost to help sound
// resample to target sample rate
-
+ auto block44k = resampler.processIn(block);
for (int ch = 0; ch < buffer.getNumChannels(); ++ch)
{
// Apply LSTM model
@@ -203,8 +204,9 @@ void ProteusAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer
LSTM2.process(block44k.getChannelPointer(1), driveValue, block44k.getChannelPointer(1), (int)block44k.getNumSamples());
}
}
+ resampler.processOut(block44k, block);
}
- resampler.processOut(block44k, block);
+
// Master Volume
diff --git a/src/RTNeuralLSTM.cpp b/src/RTNeuralLSTM.cpp
@@ -37,7 +37,7 @@ void RT_LSTM::set_weights(T1 model, const char* filename)
std::vector<float> lstm_bias_ih = weights_json["/state_dict/rec.bias_ih_l0"_json_pointer];
std::vector<float> lstm_bias_hh = weights_json["/state_dict/rec.bias_hh_l0"_json_pointer];
- for (int i = 0; i < 80; ++i)
+ for (int i = 0; i < 160; ++i)
lstm_bias_hh[i] += lstm_bias_ih[i];
lstm.setBVals(lstm_bias_hh);
diff --git a/src/RTNeuralLSTM.h b/src/RTNeuralLSTM.h
@@ -21,16 +21,16 @@ public:
private:
RTNeural::ModelT<float, 1, 1,
- RTNeural::LSTMLayerT<float, 1, 20>,
- RTNeural::DenseT<float, 20, 1>> model;
+ RTNeural::LSTMLayerT<float, 1, 40>,
+ RTNeural::DenseT<float, 40, 1>> model;
RTNeural::ModelT<float, 2, 1,
- RTNeural::LSTMLayerT<float, 2, 20>,
- RTNeural::DenseT<float, 20, 1>> model_cond1;
+ RTNeural::LSTMLayerT<float, 2, 40>,
+ RTNeural::DenseT<float, 40, 1>> model_cond1;
RTNeural::ModelT<float, 3, 1,
- RTNeural::LSTMLayerT<float, 3, 20>,
- RTNeural::DenseT<float, 20, 1>> model_cond2;
+ RTNeural::LSTMLayerT<float, 3, 40>,
+ RTNeural::DenseT<float, 40, 1>> model_cond2;
// Pre-Allowcate arrays for feeding the models
float inArray1[2] = { 0.0, 0.0 };