mirror of
https://github.com/mikeoliphant/neural-amp-modeler-lv2.git
synced 2026-06-10 06:12:18 +02:00
Add quality scaling support
This commit is contained in:
@@ -101,4 +101,12 @@ A large collection of models is available at https://tonehunt.org
|
||||
lv2:minimum -20.0;
|
||||
lv2:maximum 20.0;
|
||||
units:unit units:db;
|
||||
], [
|
||||
a lv2:ControlPort, lv2:InputPort;
|
||||
lv2:index 6;
|
||||
lv2:symbol "quality_scale";
|
||||
lv2:name "Quality";
|
||||
lv2:default 1.0;
|
||||
lv2:minimum 0.0;
|
||||
lv2:maximum 1.0;
|
||||
].
|
||||
|
||||
@@ -252,6 +252,18 @@ namespace NAM {
|
||||
}
|
||||
}
|
||||
|
||||
if (*(ports.quality_scale) != qualityScale)
|
||||
{
|
||||
qualityScale = *(ports.quality_scale);
|
||||
|
||||
NeuralAudio::NeuralModel::SetDefaultQualityScaleFactor(qualityScale);
|
||||
|
||||
if (currentModel != nullptr)
|
||||
{
|
||||
currentModel->SetQualityScaleFactor(qualityScale);
|
||||
}
|
||||
}
|
||||
|
||||
float level;
|
||||
|
||||
float modelInputAdjustmentDB = 0;
|
||||
|
||||
@@ -60,6 +60,7 @@ namespace NAM {
|
||||
float* audio_out;
|
||||
float* input_level;
|
||||
float* output_level;
|
||||
float* quality_scale;
|
||||
};
|
||||
|
||||
Ports ports = {};
|
||||
@@ -74,6 +75,7 @@ namespace NAM {
|
||||
std::string currentModelPath;
|
||||
float prevDCInput = 0;
|
||||
float prevDCOutput = 0;
|
||||
float qualityScale = 1.0f;
|
||||
|
||||
Plugin();
|
||||
~Plugin();
|
||||
|
||||
Reference in New Issue
Block a user