mirror of
https://github.com/mikeoliphant/neural-amp-modeler-lv2.git
synced 2026-05-07 04:00:09 +02:00
input and output level control ports
This commit is contained in:
+14
-5
@@ -147,17 +147,26 @@ namespace NAM {
|
||||
}
|
||||
}
|
||||
|
||||
float inputLevel = pow(10, *(ports.input_level) * 0.05);
|
||||
float outputLevel = pow(10, *(ports.output_level) * 0.05);
|
||||
|
||||
for (unsigned int i = 0; i < n_samples; i++)
|
||||
{
|
||||
ports.audio_out[i] = ports.audio_in[i] * inputLevel;
|
||||
}
|
||||
|
||||
if (currentModel == nullptr)
|
||||
{
|
||||
for (unsigned int i = 0; i < n_samples; i++)
|
||||
{
|
||||
ports.audio_out[i] = ports.audio_in[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
currentModel->process(ports.audio_in, ports.audio_out, n_samples, 1.0, 1.0, mNAMParams);
|
||||
currentModel->process(ports.audio_out, ports.audio_out, n_samples, 1.0, 1.0, mNAMParams);
|
||||
currentModel->finalize_(n_samples);
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < n_samples; i++)
|
||||
{
|
||||
ports.audio_out[i] *= outputLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -40,6 +40,8 @@ namespace NAM {
|
||||
LV2_Atom_Sequence* notify;
|
||||
const float* audio_in;
|
||||
float* audio_out;
|
||||
float* input_level;
|
||||
float* output_level;
|
||||
};
|
||||
|
||||
Ports ports = {};
|
||||
@@ -51,11 +53,7 @@ namespace NAM {
|
||||
std::unique_ptr<::DSP> currentModel;
|
||||
std::unique_ptr<::DSP> stagedModel;
|
||||
|
||||
std::unordered_map<std::string, double> mNAMParams =
|
||||
{
|
||||
{"Input", 0.0},
|
||||
{"Output", 0.0}
|
||||
};
|
||||
std::unordered_map<std::string, double> mNAMParams = {};
|
||||
|
||||
|
||||
Plugin(float rate);
|
||||
|
||||
Reference in New Issue
Block a user