mirror of
https://github.com/mikeoliphant/neural-amp-modeler-lv2.git
synced 2026-05-10 04:30:14 +02:00
do smoothing per-sample
This commit is contained in:
+8
-4
@@ -186,12 +186,11 @@ namespace NAM {
|
|||||||
if (dblData.size() != n_samples)
|
if (dblData.size() != n_samples)
|
||||||
dblData.resize(n_samples);
|
dblData.resize(n_samples);
|
||||||
|
|
||||||
// Convert input/output levels from db and do very basic smoothing
|
|
||||||
inputLevel = (.99f * inputLevel) + (.01f * powf(10, *(ports.input_level) * 0.05f));
|
|
||||||
outputLevel = (.99f * outputLevel) + (.01f * powf(10, *(ports.output_level) * 0.05f));
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < n_samples; i++)
|
for (unsigned int i = 0; i < n_samples; i++)
|
||||||
{
|
{
|
||||||
|
// Convert input level from db and do very basic smoothing
|
||||||
|
inputLevel = (.99f * inputLevel) + (.01f * powf(10, *(ports.input_level) * 0.05f));
|
||||||
|
|
||||||
dblData[i] = ports.audio_in[i] * inputLevel;
|
dblData[i] = ports.audio_in[i] * inputLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,14 +207,19 @@ namespace NAM {
|
|||||||
|
|
||||||
for (unsigned int i = 0; i < n_samples; i++)
|
for (unsigned int i = 0; i < n_samples; i++)
|
||||||
{
|
{
|
||||||
|
// Convert output level from db and do very basic smoothing
|
||||||
|
outputLevel = (.99f * outputLevel) + (.01f * powf(10, *(ports.output_level) * 0.05f));
|
||||||
|
|
||||||
ports.audio_out[i] = (float)(dblData[i] * outputLevel);
|
ports.audio_out[i] = (float)(dblData[i] * outputLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stateChanged)
|
if (stateChanged)
|
||||||
{
|
{
|
||||||
stateChanged = false;
|
stateChanged = false;
|
||||||
lv2_atom_forge_frame_time(&atom_forge, 0);
|
lv2_atom_forge_frame_time(&atom_forge, 0);
|
||||||
write_state_changed();
|
write_state_changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
lv2_atom_forge_pop(&atom_forge,&sequence_frame);
|
lv2_atom_forge_pop(&atom_forge,&sequence_frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user