103 Commits

Author SHA1 Message Date
Mike Oliphant d2e3be5d03 Update NeuralAudio (fix composite model receptive field) 2026-06-14 13:30:12 -07:00
Mike Oliphant 7337541c5b Update release.yml 2026-06-14 09:33:33 -07:00
Mike Oliphant 1f79a13947 Visual Studio -> 2026 2026-06-14 09:33:14 -07:00
Mike Oliphant cc13dcb0e7 Merge pull request #115 from mikeoliphant/oversample
Oversampling support
2026-06-14 09:32:40 -07:00
Mike Oliphant 496f602fc2 Update NeuralAudio (oversampling). Pass external sample rate to NeuralAudio. 2026-06-14 09:19:55 -07:00
Mike Oliphant b816ebbc52 Update NeuralAudio (add DEFAULT_INPUT_DBU cmake option) 2026-06-12 13:01:53 -07:00
Mike Oliphant 74503cc67a Update NeuralAudio (internal support for composite models) 2026-06-12 11:45:24 -07:00
Mike Oliphant 37f5071e6a Fix smart bypass cmake message 2026-06-11 10:23:37 -07:00
Mike Oliphant f84082b42d Update NeuralAudio (fix smart bypass on a2 models) 2026-06-11 06:49:07 -07:00
Mike Oliphant 83e197721c Cmake message for smart bypass 2026-06-10 12:40:19 -07:00
Mike Oliphant f76554aea0 Switch tonehunt link to tone3000 2026-06-10 07:31:38 -07:00
Mike Oliphant 9e704c0ce9 Update issue templates 2026-06-09 19:14:08 -07:00
Mike Oliphant f813aa449c Add usage info 2026-06-05 08:18:28 -07:00
Mike Oliphant c48fd2d230 Update README.md 2026-06-02 13:05:35 -07:00
Mike Oliphant 23c97c61e3 Delete models directory 2026-06-02 13:02:24 -07:00
Mike Oliphant 844766e614 Bump version -> 0.2.0 2026-06-02 07:41:07 -07:00
Mike Oliphant 437b8cc254 Update NeuralAudio (Fix NAM Core A2 fast path issue with Tone3000 models) 2026-06-02 07:32:53 -07:00
Mike Oliphant 02ad319440 Update NeuralAudio (fix static LSTM loading) 2026-05-27 12:47:16 -07:00
Mike Oliphant 8ee50ccdbf Update NeuralAudio 2026-05-27 12:23:07 -07:00
Mike Oliphant 4d4f613be9 Update NeuralAudio. Switch to NeuralModelLoader. Work around NAM Core prewarm issues. 2026-05-27 12:04:36 -07:00
Mike Oliphant 01642fa580 Merge pull request #104 from mikeoliphant/pi_build
Refactor build and add Raspberry Pi 4/5 builds
2026-05-22 14:22:48 -07:00
Mike Oliphant f774aad19d Try again for gcc12 rpi 2026-05-22 14:06:08 -07:00
Mike Oliphant cab4b549d7 Try again to force gcc12 for rpi build 2026-05-22 14:01:58 -07:00
Mike Oliphant 4047eea241 Force gcc12 for rpi build 2026-05-22 13:50:34 -07:00
Mike Oliphant 1072326eb1 Fixed rpi archive name 2026-05-22 13:02:36 -07:00
Mike Oliphant fe172b94b5 Specify docker cmake toolchain 2026-05-22 12:50:14 -07:00
Mike Oliphant d15d078b23 Don't use clang+ for rpi build
Removed environment variable setting for CXX in Build Plugin step.
2026-05-22 12:42:13 -07:00
Mike Oliphant 2ae1cb7a05 Add Raspberry Pi build workflow to release process 2026-05-22 12:40:06 -07:00
Mike Oliphant 6896f40711 Matrix build for windows 2026-05-22 12:27:56 -07:00
Mike Oliphant a19b9bab8b Fix environment variable usage in release workflow 2026-05-22 12:22:01 -07:00
Mike Oliphant 17dc4edff2 Update Linux x64 build workflow with matrix strategy 2026-05-22 12:12:09 -07:00
Mike Oliphant a8ba46997b Explicitly force build of internal static WaveNet and LSTM 2026-05-20 13:04:16 -07:00
Mike Oliphant aca77c2590 Explicitly force build of internal static WaveNet and LSTM 2026-05-20 13:01:54 -07:00
Mike Oliphant d35db9c0c1 Explicitly force build of internal static WaveNet and LSTM 2026-05-20 13:01:11 -07:00
Mike Oliphant fcbe0a24db Update sample model license 2026-05-20 12:44:45 -07:00
Mike Oliphant 1b98cb8891 Update NeuralAudio 2026-05-20 11:07:50 -07:00
Mike Oliphant 8493866b21 Update NeuralAudio 2026-05-18 08:56:34 -07:00
Mike Oliphant 2e103a104b Update NeuralAudio 2026-05-18 08:21:38 -07:00
Mike Oliphant c7d55312c0 Merge pull request #101 from mikeoliphant/nam_a2
Add NAM A2 model support
2026-05-17 09:37:33 -07:00
Mike Oliphant 8ac44e3ee0 Add quality scaling support 2026-05-17 09:24:26 -07:00
Mike Oliphant b4dbac6042 Update NeuralAudio 2026-05-17 07:29:42 -07:00
Mike Oliphant 5a5865a8a4 Switch to NeuralAudio release branch 2025-12-25 08:54:23 -08:00
Mike Oliphant 5880267d49 Revert NeuralAudio update 2025-12-25 07:18:09 -08:00
Mike Oliphant 6cd11a9e57 Revert "Update NeuralAudio (refactored convolution buffer)"
This reverts commit 513a537d43.
2025-12-25 07:16:04 -08:00
Mike Oliphant 513a537d43 Update NeuralAudio (refactored convolution buffer) 2025-12-02 10:20:17 -08:00
Mike Oliphant 1193da70ca Merge pull request #94 from mikeoliphant/smart_bypass 2025-11-11 08:16:31 -08:00
Mike Oliphant 2f81ad2b81 Merge branch 'smart_bypass' of https://github.com/mikeoliphant/neural-amp-modeler-lv2 into smart_bypass 2025-11-11 07:23:48 -08:00
Mike Oliphant eeaeeecf24 Start new models bypassed. Prevent silentSamples from overflowing. 2025-11-11 07:23:47 -08:00
Mike Oliphant 0fd82dc816 Document SMART_BYPASS_ENABLED CMake option 2025-11-10 10:56:01 -08:00
Mike Oliphant d998b95e45 Added cmake option for smart bypass 2025-11-10 10:52:26 -08:00
Mike Oliphant 42d9d8b4c3 Smart bypass on silence 2025-11-10 10:45:29 -08:00
Mike Oliphant b5b934d4e7 Merge pull request #93 from Nakmak98/fix_libstdc++_linking
Fixed std::filesystem library linking for gcc>=9
2025-11-09 08:50:51 -08:00
nakmak98 c3bcac7085 Fixed std::filesystem library linking for gcc>=9
libstdc++fs may not be present in the system, as std::filesystem is included in libstdc++ starting from gcc9, so a conditional statement has been added to CMakeLists.txt to handle linking depending on the compiler version.
2025-11-09 18:01:44 +03:00
Mike Oliphant 94d86f5bc6 Fix formatting issues in README.md 2025-11-08 10:04:36 -08:00
Mike Oliphant 4b5f7d9051 Update NeuralAudio 2025-08-05 12:26:44 -07:00
Mike Oliphant 91259b8eb6 Update README.md 2025-07-04 15:15:48 -07:00
Mike Oliphant 4c8c341fdd Update README.md 2025-07-04 15:14:07 -07:00
Mike Oliphant ccfa2e3882 Update README.md 2025-06-27 08:25:43 -07:00
Mike Oliphant 2fdabf74ce Update README.md 2025-06-27 08:25:02 -07:00
Mike Oliphant ce7cbeb8f3 Update NeuralAudio. Bump version -> 0.1.9 2025-06-09 08:46:52 -07:00
Mike Oliphant 8e3b71c13d Bump version -> 0.1.8 2025-05-27 13:35:48 -07:00
Mike Oliphant 8dc56d247c Update NeuralAudio 2025-05-27 10:44:14 -07:00
Mike Oliphant 77731797d1 Update CREDITS.md 2025-05-23 13:58:26 -07:00
Mike Oliphant 10aebb7329 Update NeuralAudio 2025-05-23 12:52:53 -07:00
Mike Oliphant bd455b50a9 Update NeuralAudio 2025-04-01 11:13:10 +07:00
Mike Oliphant 81bc4a2247 Update NeuralAudio 2025-04-01 08:52:51 +07:00
Mike Oliphant 50be3658e6 Update NeuralAudio 2025-03-11 09:15:03 +08:00
Mike Oliphant 9a60937f64 Merge pull request #87 from timlau/main
fix hardcode lib dir
2025-02-21 13:49:10 -08:00
Tim Lauridsen 8ddad7168d fix hardcode lib dir
Some system store 64 bit libs in /usr/lib64
This change make it possible to set the bib dir using -DLIB_INSTALL_DIR=/usr/lib64 when building.
2025-02-21 15:15:37 +01:00
Mike Oliphant 5566a69731 fix MSVC detection 2025-02-20 13:07:59 -08:00
Mike Oliphant 994a68c4f0 detect clang properly even if it is running under MSVC 2025-02-20 12:38:26 -08:00
Mike Oliphant b4144b9027 use /arch:AVX2 for MSVC when USE_NATIVE_ARCH is on 2025-02-20 12:31:49 -08:00
Mike Oliphant fcb5963f05 Update NeuralAudio 2025-02-11 10:05:36 -08:00
Mike Oliphant 8401d65129 Merge pull request #85 from mikeoliphant/modgui
Add modgui
2025-02-10 13:28:37 -08:00
Mike Oliphant 4952d8e787 Update CREDITS.md 2025-02-10 13:27:28 -08:00
Mike Oliphant a0a8f8af32 Add modgui 2025-02-10 13:23:46 -08:00
Mike Oliphant 40a58b8ef2 Bump version -> 0.1.7 2025-02-10 11:38:54 -08:00
Mike Oliphant 3ca0fdc51f Update build.yml 2025-02-09 14:03:01 -08:00
Mike Oliphant 0227fdc1fc Update NeuralAudio 2025-02-09 14:02:10 -08:00
Mike Oliphant b8dee789b5 Update build.yml 2025-02-07 18:35:32 -08:00
Mike Oliphant f8f73bff29 Update NeuralAudio 2025-02-07 18:17:28 -08:00
Mike Oliphant fc5ff29f12 Merge branch 'main' of https://github.com/mikeoliphant/neural-amp-modeler-lv2 2025-02-07 18:06:33 -08:00
Mike Oliphant ae14f2f13b Update NeuralAudio (add dynamic internal LSTM model loading) 2025-02-07 18:06:32 -08:00
Mike Oliphant c747bb8f4d Update README.md 2025-02-07 16:52:27 -08:00
Mike Oliphant 937e7764b8 Update README.md 2025-02-07 16:51:40 -08:00
Mike Oliphant 1590c9c53b Merge branch 'main' of https://github.com/mikeoliphant/neural-amp-modeler-lv2 2025-02-07 16:24:43 -08:00
Mike Oliphant c21f7d7254 Update NeuralAudio (support internal dynamic WaveNet model loading) 2025-02-07 16:24:42 -08:00
Mike Oliphant 9bb3a3f34d Update README.md 2025-02-07 09:26:57 -08:00
Mike Oliphant 46a9691259 Update README.md 2025-02-07 08:26:22 -08:00
Mike Oliphant 2b27baa15e Update NeuralAudio 2025-02-07 08:22:42 -08:00
Mike Oliphant 2d3e4115e4 Update README.md 2025-02-07 08:13:44 -08:00
Mike Oliphant 2da7a84a4d Update CREDITS.md 2025-02-06 08:00:04 -08:00
Mike Oliphant 2f525e1a2a Merge pull request #84 from mikeoliphant/naopt
Use new internal NeuralAudio WaveNet and LSTM implementations
2025-02-06 07:57:31 -08:00
Mike Oliphant 9c55e904cb Update README.md 2025-02-06 07:56:33 -08:00
Mike Oliphant 3960aa75e7 Remove "prefer" cmake options 2025-02-06 07:55:46 -08:00
Mike Oliphant 436fb12664 Update NeuralAudio 2025-02-05 15:54:28 -08:00
Mike Oliphant 7e03d2bd3d Use naopt NeuralAudio branch 2025-02-05 10:40:59 -08:00
Mike Oliphant 46c2bb823f Update release.yml 2025-01-28 08:55:50 -08:00
Mike Oliphant 5f91734de9 Update README.md 2025-01-28 08:55:13 -08:00
Mike Oliphant d60ae6f369 Update release.yml 2025-01-28 08:42:14 -08:00
Mike Oliphant 6905406e95 Don't use RTNeural for WaveNet by default 2025-01-28 08:39:44 -08:00
Mike Oliphant 011b741bbc Update NeuralAudio 2025-01-28 08:36:50 -08:00
Mike Oliphant c4733d53bc Added aidadspmodel to ttl 2024-12-22 07:37:25 -08:00
29 changed files with 408 additions and 124 deletions
+17
View File
@@ -0,0 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is. Please do not include AI chat transcripts.
**Environment**
Please include information on the operating system and plugin host environment where you are experiencing the issue. If you can, please test in multiple different contexts (ie: different DAWs)
**Additional Information**
Please add any additional detail here.
+10 -2
View File
@@ -20,10 +20,14 @@ jobs:
env: env:
CXX: clang++ CXX: clang++
run: | run: |
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_UTILS=ON -DBUILD_INTERNAL_STATIC_WAVENET=ON -DBUILD_INTERNAL_STATIC_LSTM=ON -DBUILD_NAMCORE=ON -DBUILD_STATIC_RTNEURAL=ON
cmake --build . --config $BUILD_TYPE -j4 cmake --build . --config $BUILD_TYPE -j4
cpack cpack
- name: Run ModelTest
working-directory: ${{github.workspace}}/build/src/NeuralAudio/Utils/ModelTest
run: ./ModelTest
- name: Upload binary - name: Upload binary
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@@ -47,9 +51,13 @@ jobs:
- name: Build Plugin - name: Build Plugin
working-directory: ${{github.workspace}}/build working-directory: ${{github.workspace}}/build
run: | run: |
cmake.exe -G "Visual Studio 17 2022" -A x64 -T ClangCL .. cmake.exe -G "Visual Studio 18 2026" -A x64 -DBUILD_UTILS=ON -DBUILD_INTERNAL_STATIC_WAVENET=ON -DBUILD_INTERNAL_STATIC_LSTM=ON -DBUILD_NAMCORE=ON -DBUILD_STATIC_RTNEURAL=ON -T ClangCL ..
cmake --build . --config=release -j4 cmake --build . --config=release -j4
- name: Run ModelTest
working-directory: ${{github.workspace}}/build/src/NeuralAudio/Utils/ModelTest/Release
run: ./ModelTest.exe
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
+31 -44
View File
@@ -31,7 +31,12 @@ jobs:
build-linux-x64: build-linux-x64:
name: Build Linux x64 name: Build Linux x64
needs: create_release needs: create_release
strategy:
matrix:
native_arch: [ON, OFF]
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
ARCHIVE_NAME: neural_amp_modeler_lv2_linux_x64${{ matrix.native_arch == 'ON' && 'v3' || '' }}.tgz
steps: steps:
- uses: actions/checkout@v3.3.0 - uses: actions/checkout@v3.3.0
with: with:
@@ -42,12 +47,12 @@ jobs:
env: env:
CXX: clang++ CXX: clang++
run: | run: |
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_NATIVE_ARCH=${{ matrix.native_arch }} -DBUILD_NAMCORE=ON -DBUILD_INTERNAL_STATIC_WAVENET=ON -DBUILD_INTERNAL_STATIC_LSTM=ON
cmake --build . --config $BUILD_TYPE -j4 cmake --build . --config $BUILD_TYPE -j4
- name: Add LV2 Archive - name: Add LV2 Archive
working-directory: ${{github.workspace}}/build working-directory: ${{github.workspace}}/build
run: tar -czf neural_amp_modeler_lv2_linux_x64.tgz neural_amp_modeler.lv2 run: tar -czf ${{ env.ARCHIVE_NAME }} neural_amp_modeler.lv2
- name: Upload Plugin Asset - name: Upload Plugin Asset
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
@@ -55,14 +60,21 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ needs.create_release.outputs.upload_url }} upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build/neural_amp_modeler_lv2_linux_x64.tgz asset_path: ./build/${{ env.ARCHIVE_NAME }}
asset_name: neural_amp_modeler_lv2_linux_x64.tgz asset_name: ${{ env.ARCHIVE_NAME }}
asset_content_type: application/tgz asset_content_type: application/tgz
build-linux-x64v3: build-rpi:
name: Build Linux x64v3 name: Build Raspberry Pi
needs: create_release needs: create_release
strategy:
matrix:
native_arch: [rpi4, rpi5]
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: ghcr.io/tttapa/docker-arm-cross-toolchain:aarch64-rpi3-linux-gnu-gcc12
env:
ARCHIVE_NAME: neural_amp_modeler_lv2_${{ matrix.native_arch }}.tgz
steps: steps:
- uses: actions/checkout@v3.3.0 - uses: actions/checkout@v3.3.0
with: with:
@@ -70,15 +82,13 @@ jobs:
- name: Build Plugin - name: Build Plugin
working-directory: ${{github.workspace}}/build working-directory: ${{github.workspace}}/build
env:
CXX: clang++
run: | run: |
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_NATIVE_ARCH=ON cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_NAMCORE=ON -DBUILD_INTERNAL_STATIC_WAVENET=ON -DBUILD_INTERNAL_STATIC_LSTM=ON -DCMAKE_TOOLCHAIN_FILE=/home/develop/opt/x-tools/aarch64-rpi3-linux-gnu/aarch64-${{ matrix.native_arch }}-linux-gnu.toolchain.cmake
cmake --build . --config $BUILD_TYPE -j4 cmake --build . --config $BUILD_TYPE -j4
- name: Add LV2 Archive - name: Add LV2 Archive
working-directory: ${{github.workspace}}/build working-directory: ${{github.workspace}}/build
run: tar -czf neural_amp_modeler_lv2_linux_x64v3.tgz neural_amp_modeler.lv2 run: tar -czf ${{ env.ARCHIVE_NAME }} neural_amp_modeler.lv2
- name: Upload Plugin Asset - name: Upload Plugin Asset
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
@@ -86,14 +96,19 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ needs.create_release.outputs.upload_url }} upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build/neural_amp_modeler_lv2_linux_x64v3.tgz asset_path: ./build/${{ env.ARCHIVE_NAME }}
asset_name: neural_amp_modeler_lv2_linux_x64v3.tgz asset_name: ${{ env.ARCHIVE_NAME }}
asset_content_type: application/tgz asset_content_type: application/tgz
build-windows: build-windows:
name: Build Windows name: Build Windows
needs: create_release needs: create_release
strategy:
matrix:
native_arch: [ON, OFF]
runs-on: windows-latest runs-on: windows-latest
env:
ARCHIVE_NAME: neural_amp_modeler_lv2_win_x64${{ matrix.native_arch == 'ON' && 'v3' || '' }}.zip
steps: steps:
- uses: actions/checkout@v3.3.0 - uses: actions/checkout@v3.3.0
with: with:
@@ -102,11 +117,11 @@ jobs:
- name: Build Plugin - name: Build Plugin
working-directory: ${{github.workspace}}/build working-directory: ${{github.workspace}}/build
run: | run: |
cmake.exe -G "Visual Studio 17 2022" -A x64 -T ClangCL .. cmake.exe -G "Visual Studio 18 2026" -A x64 -T ClangCL -DUSE_NATIVE_ARCH=${{ matrix.native_arch }} -DBUILD_NAMCORE=ON -DBUILD_INTERNAL_STATIC_WAVENET=ON -DBUILD_INTERNAL_STATIC_LSTM=ON ..
cmake --build . --config=release -j4 cmake --build . --config=release -j4
- name: Add LV2 Archive - name: Add LV2 Archive
run: Compress-Archive -Path ${{github.workspace}}\build\neural_amp_modeler.lv2 -Destination neural_amp_modeler_lv2_win_x64.zip run: Compress-Archive -Path ${{github.workspace}}\build\neural_amp_modeler.lv2 -Destination ${{ env.ARCHIVE_NAME }}
- name: Upload Plugin Asset - name: Upload Plugin Asset
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
@@ -114,34 +129,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ needs.create_release.outputs.upload_url }} upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./neural_amp_modeler_lv2_win_x64.zip asset_path: ./${{ env.ARCHIVE_NAME }}
asset_name: neural_amp_modeler_lv2_win_x64.zip asset_name: ${{ env.ARCHIVE_NAME }}
asset_content_type: application/zip
build-windows-x64v3:
name: Build Windows x64v3
needs: create_release
runs-on: windows-latest
steps:
- uses: actions/checkout@v3.3.0
with:
submodules: recursive
- name: Build Plugin
working-directory: ${{github.workspace}}/build
run: |
cmake.exe -G "Visual Studio 17 2022" -A x64 -DUSE_NATIVE_ARCH=ON -T ClangCL ..
cmake --build . --config=release -j4
- name: Add LV2 Archive
run: Compress-Archive -Path ${{github.workspace}}\build\neural_amp_modeler.lv2 -Destination neural_amp_modeler_lv2_win_x64v3.zip
- name: Upload Plugin Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./neural_amp_modeler_lv2_win_x64v3.zip
asset_name: neural_amp_modeler_lv2_win_x64v3.zip
asset_content_type: application/zip asset_content_type: application/zip
+7 -3
View File
@@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(NeuralAmpModelerLv2 VERSION 0.1.6) project(NeuralAmpModelerLv2 VERSION 0.2.0)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib CACHE PATH "The library install dir (default: lib)")
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED OFF) set(CMAKE_CXX_STANDARD_REQUIRED OFF)
@@ -11,7 +12,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
include_directories(SYSTEM /usr/local/include) include_directories(SYSTEM /usr/local/include)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
link_libraries(stdc++fs) link_libraries( "$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:-lstdc++fs>" )
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows") elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_compile_definitions(NOMINMAX WIN32_LEAN_AND_MEAN) add_compile_definitions(NOMINMAX WIN32_LEAN_AND_MEAN)
else() else()
@@ -29,11 +30,14 @@ add_custom_target(copy_binaries ALL
DEPENDS neural_amp_modeler DEPENDS neural_amp_modeler
) )
file(COPY resources/modgui.ttl DESTINATION neural_amp_modeler.lv2)
file(COPY resources/modgui DESTINATION neural_amp_modeler.lv2)
configure_file(resources/manifest.ttl.in neural_amp_modeler.lv2/manifest.ttl) configure_file(resources/manifest.ttl.in neural_amp_modeler.lv2/manifest.ttl)
configure_file(resources/neural_amp_modeler.ttl.in neural_amp_modeler.lv2/neural_amp_modeler.ttl) configure_file(resources/neural_amp_modeler.ttl.in neural_amp_modeler.lv2/neural_amp_modeler.ttl)
install (DIRECTORY ${CMAKE_BINARY_DIR}/neural_amp_modeler.lv2 install (DIRECTORY ${CMAKE_BINARY_DIR}/neural_amp_modeler.lv2
DESTINATION lib/lv2 DESTINATION ${LIB_INSTALL_DIR}/lv2
) )
set(CPACK_GENERATOR "DEB") set(CPACK_GENERATOR "DEB")
+6 -6
View File
@@ -1,11 +1,11 @@
This repository uses code from a number of sources: [GitHub contributers](https://github.com/mikeoliphant/neural-amp-modeler-lv2/graphs/contributors)
https://github.com/sdatkinson/NeuralAmpModelerCore This repository uses code from a number of sources. Please see them for code licensing information:
https://gitlab.com/libeigen/eigen https://github.com/mikeoliphant/NeuralAudio
https://github.com/jatinchowdhury18/RTNeural
https://github.com/lv2/lv2 https://github.com/lv2/lv2
In addition, the CMake structure and LV2 plugin structure are based on code from https://github.com/Dougal-s/Aether. The CMake structure and LV2 plugin structure are based on code from https://github.com/Dougal-s/Aether.
modgui user interface is by Roman Brandstetter (@rominator1983) and Filipe Coelho (@falktk) based on design from Evan Heritage.
+21 -13
View File
@@ -1,33 +1,39 @@
# neural-amp-modeler-lv2 # neural-amp-modeler-lv2
LV2 plugin for using neural network machine learning amp models. LV2 plugin for neural network machine learning amp model playback using the [NeuralAudio](https://github.com/mikeoliphant/NeuralAudio) engine.
**There is no custom plugin user interface**. Setting the model to use requires that your LV2 host supports atom:Path parameters. Reaper does as of v6.82. Carla and Ardour do. If your favorite LV2 host does not support atom:Path, let them know you want it. **There is no custom plugin user interface**. Setting the model to use requires that your LV2 host supports atom:Path parameters. Reaper does as of v6.82. Carla and Ardour do. If your favorite LV2 host does not support atom:Path, let them know you want it.
If you are looking for a GUI version, @brummer10 [has one here](https://github.com/brummer10/neural-amp-modeler-ui) that works for Linux and Windows. You may also be interested in the the version shipped with the [MOD Desktop App](https://github.com/moddevices/mod-desktop-app), or my digital pedalboard app [Stompbox](https://github.com/mikeoliphant/StompboxUI). If you are looking for a GUI version, @brummer10 [has one here](https://github.com/brummer10/neural-amp-modeler-ui) that works for Linux and Windows. You may also be interested in the the version shipped with the [MOD Desktop App](https://github.com/moddevices/mod-desktop-app), or my digital pedalboard app [Stompbox](https://github.com/mikeoliphant/Stompbox).
To get the intended behavior, **you must run your audio host at the same sample rate the model was trained at** (usually 48kHz) - no resampling is done by the plugin. To get the intended behavior, **you must run your audio host at the same sample rate the model was trained at** (usually 48kHz) - no resampling is done by the plugin.
For amp-only models (the most typical), **you will need to run an impulse reponse after this plugin** to model the cabinet. For amp-only models (the most typical), **you will need to run an impulse reponse after this plugin** to model the cabinet.
### Models and Performance ## Usage
The plugin supports both [Neural Amp Modeler (NAM)](https://github.com/sdatkinson/neural-amp-modeler) models and [RTNeural keras json models](https://github.com/jatinchowdhury18/RTNeural) (like those used by [Aida-X](https://github.com/AidaDSP/AIDA-X)). Your DAW should expose the following input controls:
The best source of models is [ToneHunt](https://tonehunt.org/). **Input:** - Input (pre-model) gain in dB.
NAM WaveNet models are generally quite expensive to run. This isn't (much of) an issue on modern PCs, but you may have trouble running on less powerful hardware. **Output:** - Output (post-model) volume in dB.
A Raspberry Pi 4 running a 64bit OS can run "standard" NAM models with a bit of room to spare for a cabinet IR and some lightweight effects. **Quality:** - Model quality (if applicable). For NAM A2 models, a value below 0.5 will give you a "lite" model and a value above 0.5 will give you a "full" model.
If you are having trouble running a "standard" model, try looking for "feather", or even "nano" (the least expensive) models. You can find a list of ["feather"-tagged models on ToneHunt](https://tonehunt.org/models?tags%5B0%5D=feather-mdl). Note that tagging models is up to the submitter, so not all "feather" models are tagged as such - you should be able to find more if you dig around. **Model:** - The model file (ie: xxx.nam) to use.
For more information on model type support, see the [NeuralAudio](https://github.com/mikeoliphant/NeuralAudio) repository, which is where the model handling code lives. ## Models Supported and Performance
The plugin supports both [Neural Amp Modeler (NAM)](https://github.com/sdatkinson/neural-amp-modeler) models (both A1 and A2) and [RTNeural keras json models](https://github.com/jatinchowdhury18/RTNeural) (like those used by [Aida-X](https://github.com/AidaDSP/AIDA-X)).
The best source of models is [Tone3000](https://www.tone3000.com/).
For more information on model type support and performance, see the [NeuralAudio](https://github.com/mikeoliphant/NeuralAudio) repository, which is where the model handling code lives.
## Input Calibration ## Input Calibration
The expected input level to the plugin is 12dBu. For models that include input level information, they will be calibrated against this level. If you know the input level of your audio interface, you should adjust the input level relative to the expected 12dBu to provide the appropriate signal level to the model. The expected input level to the plugin is 12dBu. For models that include input level information, they will be calibrated against this level. If you know the input level of your audio interface, you should adjust the input level relative to the expected 12dBu to provide the appropriate signal level to the model.
### Building ## Building
First clone the repository: First clone the repository:
```bash ```bash
@@ -53,8 +59,10 @@ Note - you'll have to change the Visual Studio version if you are using a differ
After building, the plugin will be in **build/neural_amp_modeler.lv2**. After building, the plugin will be in **build/neural_amp_modeler.lv2**.
### Optimization ## CMake Options
If you have a relatively modern x64 processor, you can pass ```-DUSE_NATIVE_ARCH=ON``` on your cmake command line to enable certain processor-specific optimizations. ```-DUSE_NATIVE_ARCH=ON```: If you have a relatively modern x64 processor, you can pass ```-DUSE_NATIVE_ARCH=ON``` on your cmake command line to enable certain processor-specific optimizations.
You can also alter the default model loading behavior with ```-DLSTM_PREFER_NAM=ON``` (use NAM Core instead of RTNeural for NAM LSTM models) and ```-DWAVENET_PREFER_NAM=ON``` (use NAM Core instead of RTNeural or NAM WaveNet models). ```-DSMART_BYPASS_ENABLED=ON```: If enabled, this will bypass model processing if input has been silent (below -100 dB by default) for a sufficient number of samples (determined by the model's receptive field size).
Also see the [NeuralAudio CMake options](https://github.com/mikeoliphant/NeuralAudio#cmake-options) - adding these to your neural-amp-modeler-lv2 cmake will pass them to the NeuralAudio build.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-12
View File
@@ -1,12 +0,0 @@
These are some sample NAM models designed to be used for performance testing on CPU-limited devices. They are all based on a [LiveSpice model of a Boss SD-1 pedal](https://blog.nostatic.org/2023/04/this-boss-sd-1-pedal-does-not-exist.html).
All models were trained for 300 epochs using the NAM "v1_1_1.wav" capture signal.
| Model | ESR | CPU%<br>(RPi4 64bit) | Notes |
| --- |--- | :-: | --- |
| [BossWN-feather.nam](https://github.com/mikeoliphant/neural-amp-modeler-lv2/blob/main/models/BossWN-feather.nam) | .0001 | 37% | WaveNet "feather" preset |
| [BossWN-4x2x1.nam](https://github.com/mikeoliphant/neural-amp-modeler-lv2/blob/main/models/BossWN-4x2x1.nam) | .0003 | 28% | WaveNet 4x2 channel |
| [BossLSTM-2x16.nam](https://github.com/mikeoliphant/neural-amp-modeler-lv2/blob/main/models/BossLSTM-2x16.nam) | .0013 | 28% | LSTM 2x16 layers |
| [BossLSTM-1x24.nam](https://github.com/mikeoliphant/neural-amp-modeler-lv2/blob/main/models/BossLSTM-1x24.nam) | .0017 | 22% | LSTM 1x24 layer |
| [BossLSTM-2x8.nam](https://github.com/mikeoliphant/neural-amp-modeler-lv2/blob/main/models/BossLSTM-2x8.nam) | .0019 | 17% | LSTM 2x8 layers |
| [BossLSTM-1x16.nam](https://github.com/mikeoliphant/neural-amp-modeler-lv2/blob/main/models/BossLSTM-1x16.nam) | .0041 | 15% | LSTM 1x16 layer |
+1 -1
View File
@@ -5,4 +5,4 @@
<@NAM_LV2_ID@> <@NAM_LV2_ID@>
a lv2:Plugin; a lv2:Plugin;
lv2:binary <neural_amp_modeler@CMAKE_SHARED_MODULE_SUFFIX@>; lv2:binary <neural_amp_modeler@CMAKE_SHARED_MODULE_SUFFIX@>;
rdfs:seeAlso <neural_amp_modeler.ttl>. rdfs:seeAlso <neural_amp_modeler.ttl>,<modgui.ttl>.
+21
View File
@@ -0,0 +1,21 @@
@prefix modgui: <http://moddevices.com/ns/modgui#>.
@prefix lv2: <http://lv2plug.in/ns/lv2core#>.
<http://github.com/mikeoliphant/neural-amp-modeler-lv2>
modgui:gui [
modgui:resourcesDirectory <modgui>;
modgui:iconTemplate <modgui/icon-nam.html>;
modgui:stylesheet <modgui/stylesheet-nam.css>;
modgui:screenshot <modgui/screenshot-nam.png>;
modgui:thumbnail <modgui/thumbnail-nam.png>;
modgui:discussionURL <https://forum.mod.audio/t/neural-amp-modeler/10112> ;
modgui:port [
lv2:index 0;
lv2:symbol "input_level";
lv2:name "Input Lvl";
], [
lv2:index 1;
lv2:symbol "output_level";
lv2:name "Output Lvl";
];
].
Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

+45
View File
@@ -0,0 +1,45 @@
<div class="mod-pedal mod-pedal-nam">
<div mod-role="drag-handle" class="mod-drag-handle"></div>
<div class="mod-control-group group1 clearfix">
{{#controls}}
<div class="mod-knob" title="{{name}}">
<div class="mod-knob-title">{{name}}</div>
<div class="mod-knob-image" mod-role="input-control-port" mod-port-symbol="{{symbol}}"></div>
</div>
{{/controls}}
</div>
<div class="mod-footswitch" mod-role="bypass"></div>
<div class="mod-control-group group2 clearfix">
<div class="mod-control-group mod-enumerated-group bottom clearfix">
{{#effect.parameters}}
{{#path}}
<div class="mod-enumerated" mod-role="input-parameter" mod-parameter-uri="{{uri}}" mod-widget="custom-select-path">
<div mod-role="input-parameter-value" mod-parameter-uri="{{uri}}" class="mod-enumerated-selected">
-- choose a NAM model --
</div>
<div class="mod-enumerated-list">
{{#files}}
<div mod-role="enumeration-option" mod-parameter-value="{{fullname}}">{{basename}}</div>
{{/files}}
</div>
</div>
{{/path}}
{{/effect.parameters}}
</div>
</div>
<div class="mod-pedal-input">
{{#effect.ports.audio.input}}
<div class="mod-input mod-input-disconnected" title="{{name}}" mod-role="input-audio-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-input-image"></div>
</div>
{{/effect.ports.audio.input}}
</div>
<div class="mod-pedal-output">
{{#effect.ports.audio.output}}
<div class="mod-output mod-output-disconnected" title="{{name}}" mod-role="output-audio-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-output-image"></div>
</div>
{{/effect.ports.audio.output}}
</div>
</div>
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

+130
View File
@@ -0,0 +1,130 @@
/* nam */
@import url(/fonts/nexa/stylesheet.css);
@import url(/fonts/questrial/stylesheet.css);
/* = CONTAINER
================================================ */
.mod-pedal-nam {
background-position:center center;
background-repeat:no-repeat;
/* background image is 1121 × 536*/
background-size:560px 268px;
background-image:url(/resources/background.png{{{ns}}});
width:560px;
height:268px;
position:absolute;
border-radius:40px;
}
/* = BYPASS
================================================ */
.mod-pedal-nam .mod-footswitch {
background-image:url(/resources/bypass_on.png{{{ns}}});
background-position:center center;
background-repeat:no-repeat;
background-size:82px 47px;
width:82px;
height:47px;
top:132px;
left:235px;
cursor:pointer;
position:absolute;
}
.mod-pedal-nam .mod-footswitch.on {
background-image:url(/resources/bypass_off.png{{{ns}}});
}
/* = KNOBS
================================================ */
.mod-pedal-nam .mod-control-group {
z-index:30;
position:relative;
margin:0px;
padding:0px;
display:inline;
}
.mod-pedal-nam .group1 {
top:86px;
left:22px;
}
.mod-pedal-nam .group2 {
top:107px;
left:78px;
}
.mod-pedal-nam .mod-control-group .mod-knob .mod-knob-title {
text-align: center;
color:white;
}
.mod-pedal-nam .mod-control-group .mod-knob {
overflow:hidden;
position:relative;
display:inline-block;
}
.mod-pedal-nam .mod-control-group .mod-knob:first-child {
margin-left: 0px;
}
.mod-pedal-nam .mod-control-group .mod-knob:last-child {
margin-left: 315px;
}
.mod-pedal-nam .mod-control-group .mod-knob .mod-knob-image {
background-image:url(/resources/knob.png{{{ns}}});
background-position:left center;
background-repeat:no-repeat;
background-size:5000px 100px;
height:100px;
width:100px;
cursor:pointer;
}
.mod-pedal-nam .mod-enumerated {
position: relative;
font-weight: bold;
cursor: pointer;
color: white;
}
.mod-pedal-nam .mod-enumerated .mod-enumerated-selected {
padding-left: 5px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
background-color: transparent;
color: white;
display: block;
}
/* THE LIST OF OPTIONS */
.mod-pedal-nam .mod-enumerated .mod-enumerated-list {
background: black;
display: none;
overflow: auto;
position: absolute;
padding: 0;
width: 405px;
height: 220px;
border: 2px solid #333;
}
.mod-pedal-nam .mod-enumerated .mod-enumerated-list > div {
padding: 3px 5px;
}
.mod-pedal-nam .mod-enumerated .mod-enumerated-list > div.selected {
background: #333;
}
.mod-pedal-nam .mod-enumerated .mod-enumerated-list > div:hover {
background: #222;
}
.mod-pedal-nam .mod-enumerated .mod-enumerated-list > div.selected:hover {
background: #555;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+10 -2
View File
@@ -16,7 +16,7 @@
<@NAM_LV2_ID@#model> <@NAM_LV2_ID@#model>
a lv2:Parameter; a lv2:Parameter;
mod:fileTypes "nam,nammodel,json,aidax"; mod:fileTypes "nam,nammodel,json,aidax,aidadspmodel";
rdfs:label "Neural Model"; rdfs:label "Neural Model";
rdfs:range atom:Path. rdfs:range atom:Path.
@@ -45,7 +45,7 @@ Models supported:
Neural Amp Modeler (NAM): https://github.com/sdatkinson/neural-amp-modeler Neural Amp Modeler (NAM): https://github.com/sdatkinson/neural-amp-modeler
RTNeural keras/Aida-x models: https://github.com/jatinchowdhury18/RTNeural RTNeural keras/Aida-x models: https://github.com/jatinchowdhury18/RTNeural
A large collection of models is available at https://tonehunt.org A large collection of models is available at https://www.tone3000.com
"""; """;
patch:writable <@NAM_LV2_ID@#model>; patch:writable <@NAM_LV2_ID@#model>;
@@ -101,4 +101,12 @@ A large collection of models is available at https://tonehunt.org
lv2:minimum -20.0; lv2:minimum -20.0;
lv2:maximum 20.0; lv2:maximum 20.0;
units:unit units:db; 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;
]. ].
+13 -16
View File
@@ -18,8 +18,14 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64)|(AMD64)|(x86_64)")
option(USE_NATIVE_ARCH "Enable architecture-specific optimizations" OFF) option(USE_NATIVE_ARCH "Enable architecture-specific optimizations" OFF)
if (USE_NATIVE_ARCH) if (USE_NATIVE_ARCH)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/arch:AVX2)
message(STATUS "Enabling /arch:AVX2")
else()
add_compile_options(-march=x86-64-v3) add_compile_options(-march=x86-64-v3)
message("Enabling -march=x86-64-v3") message(STATUS "Enabling -march=x86-64-v3")
endif()
endif (USE_NATIVE_ARCH) endif (USE_NATIVE_ARCH)
endif () endif ()
@@ -48,23 +54,14 @@ if (DISABLE_DENORMALS)
add_definitions(-DDISABLE_DENORMALS) add_definitions(-DDISABLE_DENORMALS)
endif (DISABLE_DENORMALS) endif (DISABLE_DENORMALS)
option(LSTM_PREFER_NAM "Always use NAM Core for NAM LSTM models" ON) option(SMART_BYPASS_ENABLED "Enable auto-bypass on silence" OFF)
if (LSTM_PREFER_NAM) if (SMART_BYPASS_ENABLED)
add_definitions(-DLSTM_PREFER_NAM) add_definitions(-DSMART_BYPASS_ENABLED)
message("Using NAM Core for LSTM models") message(STATUS "Smart Bypass enabled")
else() else()
message("Using RTNeural for LSTM models") message(STATUS "Smart Bypass NOT enabled")
endif (LSTM_PREFER_NAM) endif (SMART_BYPASS_ENABLED)
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 set_target_properties(neural_amp_modeler
PROPERTIES PROPERTIES
+86 -16
View File
@@ -7,27 +7,33 @@
#define SMOOTH_EPSILON .0001f #define SMOOTH_EPSILON .0001f
#ifndef BYPASS_DB_THRESHOLD
#define BYPASS_DB_THRESHOLD -100
#endif
namespace NAM { namespace NAM {
Plugin::Plugin() Plugin::Plugin()
{ {
// prevent allocations on the audio thread // prevent allocations on the audio thread
currentModelPath.reserve(MAX_FILE_NAME + 1); currentModelPath.reserve(MAX_FILE_NAME + 1);
NeuralAudio::NeuralModel::SetLSTMLoadMode( bypassThresholdLinear = powf(10, BYPASS_DB_THRESHOLD * 0.05f);
#ifdef LSTM_PREFER_NAM
NeuralAudio::PreferNAMCore
#else
NeuralAudio::PreferRTNeural
#endif
);
NeuralAudio::NeuralModel::SetWaveNetLoadMode( // NeuralAudio::NeuralModel::SetLSTMLoadMode(
#ifdef WAVENET_PREFER_NAM //#ifdef LSTM_PREFER_NAM
NeuralAudio::PreferNAMCore // NeuralAudio::PreferNAMCore
#else //#else
NeuralAudio::PreferRTNeural // NeuralAudio::PreferRTNeural
#endif //#endif
); // );
//
// NeuralAudio::NeuralModel::SetWaveNetLoadMode(
//#ifdef WAVENET_PREFER_NAM
// NeuralAudio::PreferNAMCore
//#else
// NeuralAudio::PreferRTNeural
//#endif
//);
} }
Plugin::~Plugin() Plugin::~Plugin()
@@ -39,6 +45,8 @@ namespace NAM {
{ {
this->sampleRate = sampleRate; this->sampleRate = sampleRate;
loader.SetExternalSampleRate((int)sampleRate);
// for fetching initial options, can be null // for fetching initial options, can be null
LV2_Options_Option* options = nullptr; LV2_Options_Option* options = nullptr;
@@ -122,7 +130,7 @@ namespace NAM {
{ {
lv2_log_trace(&nam->logger, "Staging model change: `%s`\n", msg->path); lv2_log_trace(&nam->logger, "Staging model change: `%s`\n", msg->path);
model = NeuralAudio::NeuralModel::CreateFromFile(msg->path); model = nam->loader.CreateFromFile(msg->path);
} }
if (model != nullptr) if (model != nullptr)
@@ -181,6 +189,18 @@ namespace NAM {
nam->currentModelPath = msg->path; nam->currentModelPath = msg->path;
assert(nam->currentModelPath.capacity() >= MAX_FILE_NAME + 1); assert(nam->currentModelPath.capacity() >= MAX_FILE_NAME + 1);
if (nam->currentModel != nullptr)
{
int receptiveFieldSize = nam->currentModel->GetReceptiveFieldSize();
if (receptiveFieldSize > -1)
{
// A newly loaded model is prewarmed to have a silent sample history
nam->silentSamples = receptiveFieldSize;
nam->smartBypassed = true;
}
}
// send reply // send reply
nam->schedule->schedule_work(nam->schedule->handle, sizeof(reply), &reply); nam->schedule->schedule_work(nam->schedule->handle, sizeof(reply), &reply);
@@ -194,7 +214,7 @@ namespace NAM {
{ {
maxBufferSize = size; maxBufferSize = size;
NeuralAudio::NeuralModel::SetDefaultMaxAudioBufferSize(size); loader.SetDefaultMaxAudioBufferSize(size);
} }
void Plugin::process(uint32_t n_samples) noexcept void Plugin::process(uint32_t n_samples) noexcept
@@ -234,6 +254,18 @@ namespace NAM {
} }
} }
if (*(ports.quality_scale) != qualityScale)
{
qualityScale = *(ports.quality_scale);
loader.SetDefaultQualityScaleFactor(qualityScale);
if (currentModel != nullptr)
{
currentModel->SetQualityScaleFactor(qualityScale);
}
}
float level; float level;
float modelInputAdjustmentDB = 0; float modelInputAdjustmentDB = 0;
@@ -241,6 +273,44 @@ namespace NAM {
if (currentModel != nullptr) if (currentModel != nullptr)
{ {
modelInputAdjustmentDB = currentModel->GetRecommendedInputDBAdjustment(); modelInputAdjustmentDB = currentModel->GetRecommendedInputDBAdjustment();
#ifdef SMART_BYPASS_ENABLED
int receptiveFieldSamples = currentModel->GetReceptiveFieldSize();
if (receptiveFieldSamples > -1)
{
for (unsigned int i = 0; i < n_samples; i++)
{
if (abs(ports.audio_in[i]) <= bypassThresholdLinear)
{
silentSamples++;
}
else
{
silentSamples = 0;
}
}
if (silentSamples >= (uint32_t)receptiveFieldSamples)
{
silentSamples = (uint32_t)receptiveFieldSamples; // Prevent silentSamples growing and eventually overflowing uint32
if (smartBypassed)
{
for (unsigned int i = 0; i < n_samples; i++)
{
ports.audio_out[i] = ports.audio_in[i];
}
return;
}
smartBypassed = true; // If we aren't already, we'll be bypassed on the next process call
}
else
smartBypassed = false;
}
#endif
} }
// convert input level from db // convert input level from db
+7
View File
@@ -60,6 +60,7 @@ namespace NAM {
float* audio_out; float* audio_out;
float* input_level; float* input_level;
float* output_level; float* output_level;
float* quality_scale;
}; };
Ports ports = {}; Ports ports = {};
@@ -70,16 +71,19 @@ namespace NAM {
LV2_Log_Logger logger = {}; LV2_Log_Logger logger = {};
LV2_Worker_Schedule* schedule = nullptr; LV2_Worker_Schedule* schedule = nullptr;
NeuralAudio::NeuralModelLoader loader;
NeuralAudio::NeuralModel* currentModel = nullptr; NeuralAudio::NeuralModel* currentModel = nullptr;
std::string currentModelPath; std::string currentModelPath;
float prevDCInput = 0; float prevDCInput = 0;
float prevDCOutput = 0; float prevDCOutput = 0;
float qualityScale = 1.0f;
Plugin(); Plugin();
~Plugin(); ~Plugin();
bool initialize(double rate, const LV2_Feature* const* features) noexcept; bool initialize(double rate, const LV2_Feature* const* features) noexcept;
void set_max_buffer_size(int size) noexcept; void set_max_buffer_size(int size) noexcept;
void activate() noexcept;
void process(uint32_t n_samples) noexcept; void process(uint32_t n_samples) noexcept;
void write_current_path(); void write_current_path();
@@ -120,5 +124,8 @@ namespace NAM {
float inputLevel = 0; float inputLevel = 0;
float outputLevel = 0; float outputLevel = 0;
int32_t maxBufferSize = 512; int32_t maxBufferSize = 512;
float bypassThresholdLinear = 0;
uint32_t silentSamples = 0;
bool smartBypassed = true;
}; };
} }