Update NeuralAudio (better RTNeural NAM performance)

This commit is contained in:
Mike Oliphant
2024-11-27 09:17:49 -08:00
parent 429ce7ac4b
commit 368e47e12e
5 changed files with 20 additions and 6 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ project(NeuralAmpModelerLv2 VERSION 0.1.5)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
set(CMAKE_CXX_EXTENSIONS OFF)
+8 -2
View File
@@ -48,16 +48,22 @@ if (DISABLE_DENORMALS)
add_definitions(-DDISABLE_DENORMALS)
endif (DISABLE_DENORMALS)
option(LSTM_PREFER_NAM "Always use NAM Core for NAM LSTM models" OFF)
option(LSTM_PREFER_NAM "Always use NAM Core for NAM LSTM models" ON)
if (LSTM_PREFER_NAM)
add_definitions(-DLSTM_PREFER_NAM)
message("Using NAM Core for LSTM models")
else()
message("Using RTNeural for LSTM models")
endif (LSTM_PREFER_NAM)
option(WAVENET_PREFER_NAM "Always use NAM Core for NAM WaveNet models" ON)
option(WAVENET_PREFER_NAM "Always use NAM Core for NAM WaveNet models" OFF)
if (WAVENET_PREFER_NAM)
add_definitions(-DWAVENET_PREFER_NAM)
message("Using NAM Core for WaveNet models")
else()
message("Using RTNeural for WaveNet models")
endif (WAVENET_PREFER_NAM)
set_target_properties(neural_amp_modeler
+8 -1
View File
@@ -190,6 +190,13 @@ namespace NAM {
return LV2_WORKER_SUCCESS;
}
void Plugin::set_max_buffer_size(int size) noexcept
{
maxBufferSize = size;
NeuralAudio::NeuralModel::SetDefaultMaxAudioBufferSize(size);
}
void Plugin::process(uint32_t n_samples) noexcept
{
lv2_atom_forge_set_buffer(&atom_forge, (uint8_t*)ports.notify, ports.notify->atom.size);
@@ -326,7 +333,7 @@ namespace NAM {
{
if (options[i].key == nam->uris.bufSize_maxBlockLength && options[i].type == nam->uris.atom_Int)
{
nam->maxBufferSize = *(const int32_t*)options[i].value;
nam->set_max_buffer_size(*(const int32_t*)options[i].value);
break;
}
}
+2 -1
View File
@@ -79,6 +79,7 @@ namespace NAM {
~Plugin();
bool initialize(double rate, const LV2_Feature* const* features) noexcept;
void set_max_buffer_size(int size) noexcept;
void process(uint32_t n_samples) noexcept;
void write_current_path();
@@ -118,6 +119,6 @@ namespace NAM {
float inputLevel = 0;
float outputLevel = 0;
int32_t maxBufferSize = 0;
int32_t maxBufferSize = 512;
};
}