diff --git a/src/nam_lv2.cpp b/src/nam_lv2.cpp index 2468801..771440d 100644 --- a/src/nam_lv2.cpp +++ b/src/nam_lv2.cpp @@ -90,5 +90,12 @@ static const LV2_Descriptor descriptor = LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { - return index == 0 ? &descriptor : nullptr; + if (index == 0) { + // Turn on fast tanh approximation + activations::Activation::enable_fast_tanh(); + + return &descriptor; + } + + return nullptr; } diff --git a/src/nam_plugin.cpp b/src/nam_plugin.cpp index 05f1624..c3ac658 100644 --- a/src/nam_plugin.cpp +++ b/src/nam_plugin.cpp @@ -11,9 +11,6 @@ namespace NAM { Plugin::Plugin() { - // Turn on fast tanh approximation - activations::Activation::enable_fast_tanh(); - // prevent allocations on the audio thread currentModelPath.reserve(MAX_FILE_NAME+1); }