144 Commits

Author SHA1 Message Date
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
Mike Oliphant 42b2173e57 Bump version -> 0.1.6 2024-12-02 10:37:27 -08:00
Mike Oliphant 695f129e7f Update README.md 2024-12-01 09:13:01 -08:00
Mike Oliphant 952fc0edaf Update NeuralAudio 2024-12-01 09:05:17 -08:00
Mike Oliphant 76d29579b0 Update NeuralAudio 2024-12-01 07:46:02 -08:00
Mike Oliphant 00fde9f172 Update NeuralAudio 2024-11-30 12:42:18 -08:00
Mike Oliphant 14a05cbd27 Update NeuralAudio 2024-11-30 12:38:13 -08:00
Mike Oliphant 2a6aa910fc Fix NeuralAudio 2024-11-30 12:34:07 -08:00
Mike Oliphant 24fd1504ae fix NeuralAudio 2024-11-30 12:33:07 -08:00
Mike Oliphant af73122323 Update NeuralAudio 2024-11-30 12:16:55 -08:00
Mike Oliphant 2c4fdeafbd Update NeuralAudio 2024-11-30 12:09:36 -08:00
Mike Oliphant 05eb9c3669 Update release.yml 2024-11-27 12:55:56 -08:00
Mike Oliphant f15a88e392 Update release.yml 2024-11-27 12:51:06 -08:00
Mike Oliphant 1732b0e46a Update release.yml 2024-11-27 12:43:26 -08:00
Mike Oliphant d17b169e5c Update release.yml 2024-11-27 12:37:35 -08:00
Mike Oliphant bd4b2e997f Update release.yml 2024-11-27 12:33:12 -08:00
Mike Oliphant b7dd908297 Update release.yml 2024-11-27 12:28:44 -08:00
Mike Oliphant 8668125890 Update release.yml 2024-11-27 12:26:06 -08:00
Mike Oliphant 873e17f5b0 Update release.yml 2024-11-27 12:23:03 -08:00
Mike Oliphant d326635556 Update release.yml 2024-11-27 12:20:00 -08:00
Mike Oliphant fe662d4273 Update release.yml 2024-11-27 12:18:21 -08:00
Mike Oliphant 368e47e12e Update NeuralAudio (better RTNeural NAM performance) 2024-11-27 09:17:49 -08:00
Mike Oliphant 429ce7ac4b Update NeuralAudio (add NAM model input level calibration) 2024-11-25 09:42:43 -08:00
Mike Oliphant 979b8f4cf1 Default WAVENET_PREFER_NAM to ON 2024-11-22 07:58:28 -08:00
Mike Oliphant f14faca788 Update NeuralAudio (prefer NAM Core for NAM models) 2024-11-20 12:12:27 -08:00
Mike Oliphant 7fd72e3fe1 Revert last update 2024-11-19 12:24:14 -08:00
Mike Oliphant fcd3d6b93c Update NeuralAudio 2024-11-19 09:48:05 -08:00
Mike Oliphant 48b6765d72 Merge branch 'main' of https://github.com/mikeoliphant/neural-amp-modeler-lv2 2024-11-18 08:58:01 -08:00
Mike Oliphant e5984f6e0c Update NeuralAudio 2024-11-18 08:57:59 -08:00
Mike Oliphant 54516bd618 Update README.md 2024-11-17 07:21:05 -08:00
Mike Oliphant 4b10ae103a Update NeuralAudio 2024-11-16 14:06:55 -08:00
Mike Oliphant e9f6f01d8e Update NeuralAudio 2024-11-16 12:00:50 -08:00
Mike Oliphant e2caafbb2d Merge branch 'main' of https://github.com/mikeoliphant/neural-amp-modeler-lv2 2024-11-16 08:09:59 -08:00
Mike Oliphant 9d2e7ae205 Fixed propagation of native arch optimizations 2024-11-16 08:09:58 -08:00
Mike Oliphant 84a74d51ff Update README.md 2024-11-15 13:24:48 -08:00
Mike Oliphant b7595d2750 Add "aidax" file type to ttl 2024-11-15 09:56:38 -08:00
Mike Oliphant ac4f7d1a50 Update NeuralAudio 2024-11-15 07:44:56 -08:00
Mike Oliphant eeaa4649a4 Update NeuralAudio (add ".aidax" extension") 2024-11-15 07:25:59 -08:00
Mike Oliphant 3f5872cc78 CMake options for forcing use of NAM Core for LSTM or WaveNet 2024-11-14 07:47:52 -08:00
Mike Oliphant 5dd03764c5 Merge branch 'main' of https://github.com/mikeoliphant/neural-amp-modeler-lv2 2024-11-14 07:42:25 -08:00
Mike Oliphant 43870cc0da Update NeuralAudio - use RTNeural for WaveNet 2024-11-14 07:42:24 -08:00
Mike Oliphant 69bfdb4370 Update README.md 2024-11-04 08:12:04 -08:00
Mike Oliphant 84f5851b5d Update README.md 2024-11-04 08:10:54 -08:00
Mike Oliphant 75fcc78bae Update README.md 2024-11-04 08:10:07 -08:00
Mike Oliphant 5b2c9a154f Update README.md 2024-11-04 08:09:45 -08:00
Mike Oliphant 94a48c2862 Create release.yml 2024-11-04 07:50:26 -08:00
Mike Oliphant 09166f198b Update CREDITS.md 2024-11-04 07:37:52 -08:00
Mike Oliphant ad593b4038 Bump version -> 0.1.5 2024-11-04 07:36:33 -08:00
Mike Oliphant 32f18a242a Handle model input gain adjustment 2024-11-04 07:35:34 -08:00
Mike Oliphant d48e4a4080 Update NeuralAudio (load non-LSTM RTNeural models, prewarm RTNeural models) 2024-11-04 07:20:56 -08:00
Mike Oliphant 5ed03b558c Update NeuralAudio 2024-11-03 15:47:52 -08:00
Mike Oliphant b9e6cf65ca Update NeuralAudio 2024-11-03 15:20:35 -08:00
Mike Oliphant a7d19ecfab Update NeuralAudio 2024-11-03 15:18:01 -08:00
Mike Oliphant be05479671 Update NeuralAudio - use RTNeural for NAM LSTM models. Support RTNeural keras/Aida-x LSTM models 2024-11-03 15:08:58 -08:00
Mike Oliphant 38456dae4a Fix linux build? 2024-10-31 13:51:09 -07:00
Mike Oliphant d2cc00186f fixed model loudness 2024-10-31 13:46:54 -07:00
Mike Oliphant ec34afb608 build shared library 2024-10-31 12:41:00 -07:00
Mike Oliphant 7326960e2a another try to get both linux and windows builds working 2024-10-31 10:54:04 -07:00
Mike Oliphant 000925228f try again 2024-10-31 10:47:22 -07:00
Mike Oliphant ecf21c6c62 Merge branch 'main' of https://github.com/mikeoliphant/neural-amp-modeler-lv2 2024-10-31 10:46:31 -07:00
Mike Oliphant 276dafd832 try to fixe linux build 2024-10-31 10:46:30 -07:00
Mike Oliphant 29b52ae3e9 Update CREDITS.md 2024-10-31 10:36:41 -07:00
Mike Oliphant b06904b56b Merge branch 'main' of https://github.com/mikeoliphant/neural-amp-modeler-lv2 2024-10-31 10:35:30 -07:00
Mike Oliphant 19d3abb12d Switch to NeuralAudio for model handling 2024-10-31 10:35:28 -07:00
Mike Oliphant 567719af61 Switch to NeuralAudio for model handling 2024-10-31 10:35:24 -07:00
Mike Oliphant eb5bd17f70 Update build.yml 2024-10-31 09:53:44 -07:00
Mike Oliphant 57f79945de Update build.yml 2024-10-31 09:52:49 -07:00
Mike Oliphant 4643e66e08 Removed dc blocker for now 2024-10-31 08:29:42 -07:00
Mike Oliphant 0649b4a822 Bump version -> 0.1.4 2024-08-17 11:27:04 -07:00
Mike Oliphant 61bbce1e2a Add "nam" namespace 2024-08-17 11:23:52 -07:00
Mike Oliphant 1dc54bc5f9 Update NeuralAmpModelerCore 2024-08-17 11:17:46 -07:00
Mike Oliphant 40bae2bd87 c++ version -> 17 2024-08-01 12:41:26 -07:00
Mike Oliphant 1ff6dab119 Update LV2 description 2024-05-03 17:50:54 -07:00
Mike Oliphant baff908f93 Update README.md 2024-04-29 12:42:37 -07:00
Mike Oliphant 72fd4a1e3d Make DC blocker coefficient depend on sample rate 2024-04-09 08:00:35 -07:00
Mike Oliphant 1626e74d0e Update README.md 2024-01-31 07:15:04 -08:00
Mike Oliphant d1794e1bbd Update README.md 2024-01-06 07:52:52 -08:00
Mike Oliphant b8c6333955 Merge branch 'main' of https://github.com/mikeoliphant/neural-amp-modeler-lv2 2024-01-06 07:49:52 -08:00
Mike Oliphant 02256b4349 Default x64 optimizations to OFF 2024-01-06 07:49:33 -08:00
Mike Oliphant f07c40c16f Update README.md 2024-01-01 15:36:33 -08:00
Mike Oliphant 5605b03acc Update README.md 2024-01-01 15:33:50 -08:00
Mike Oliphant 43fb036706 Update submodules 2023-11-12 09:20:40 +08:00
Mike Oliphant b40df0945c Merge branch 'main' of https://github.com/mikeoliphant/neural-amp-modeler-lv2 2023-10-24 13:11:17 -07:00
Mike Oliphant 24f03afd69 Add x86_64 to 64-bit check 2023-10-24 13:11:04 -07:00
Mike Oliphant db3603e134 Update build.yml 2023-10-24 10:14:46 -07:00
Mike Oliphant 97cff04114 Enable architecture-specific optimization by default. Added option to turn it off. 2023-10-24 10:09:16 -07:00
Mike Oliphant 067b3236ea remove deb artifact for now 2023-10-19 13:25:30 -07:00
Mike Oliphant 191ae3786e proper indent 2023-10-19 13:11:05 -07:00
Mike Oliphant 2b5a4c9912 Try to add .deb artifact 2023-10-19 13:10:17 -07:00
Mike Oliphant 23200eb566 Add Linux artifact 2023-10-19 12:57:19 -07:00
Mike Oliphant 3434ba0b7d <sigh> 2023-10-19 12:49:31 -07:00
Mike Oliphant 3e9ffee4e7 Update build.yml 2023-10-19 12:45:32 -07:00
Mike Oliphant 3cff8ca37a Update build.yml 2023-10-19 12:40:40 -07:00
Mike Oliphant fcec78fa0f First try at an artifact 2023-10-19 12:36:58 -07:00
Mike Oliphant 34be69df6d Remove AudioDSPTools dependency. Do simple DC blocker instead of HPF. 2023-10-17 12:25:14 -07:00
Mike Oliphant 34c7628202 Bump version to 0.1.3 2023-10-16 08:17:06 -07:00
Mike Oliphant 8384827981 Removed test value. 2023-10-15 18:12:27 -07:00
Mike Oliphant e3c5b6bd4f Update for normalization->loudness in NAM core. 2023-10-15 18:11:36 -07:00
Mike Oliphant eb46377d71 Update to latest NAM core. Handle model normalization with output gain. 2023-10-15 12:09:52 -07:00
Mike Oliphant b22f02c84e Update NAM core. Switch to new simplified NAM process method. 2023-10-06 11:51:30 -07:00
Mike Oliphant 52810a3f9c Switched to AudioDSPTools for highpass filter implementation 2023-10-02 08:12:33 -07:00
27 changed files with 536 additions and 23008 deletions
+28 -2
View File
@@ -20,10 +20,26 @@ jobs:
env:
CXX: clang++
run: |
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_UTILS=ON -DBUILD_NAMCORE=ON -DBUILD_STATIC_RTNEURAL=ON
cmake --build . --config $BUILD_TYPE -j4
cpack
- name: Run ModelTest
working-directory: ${{github.workspace}}/build/src/NeuralAudio/Utils/ModelTest
run: ./ModelTest
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: neural_amp_modeler.lv2-linux-amd64
path: ${{github.workspace}}/build/neural_amp_modeler.lv2
# - name: Upload deb
# uses: actions/upload-artifact@v4
# with:
# name: neural_amp_modeler.lv2-linux-deb-amd64
# path: ${{github.workspace}}/build/*.deb
build-windows:
name: Build Windows
runs-on: windows-latest
@@ -35,5 +51,15 @@ jobs:
- name: Build Plugin
working-directory: ${{github.workspace}}/build
run: |
cmake.exe -G "Visual Studio 17 2022" -A x64 ..
cmake.exe -G "Visual Studio 17 2022" -A x64 -DBUILD_UTILS=ON -DBUILD_NAMCORE=ON -DBUILD_STATIC_RTNEURAL=ON -T ClangCL ..
cmake --build . --config=release -j4
- name: Run ModelTest
working-directory: ${{github.workspace}}/build/src/NeuralAudio/Utils/ModelTest/Release
run: ./ModelTest.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: neural_amp_modeler.lv2-win
path: ${{github.workspace}}/build/neural_amp_modeler.lv2
+147
View File
@@ -0,0 +1,147 @@
name: Release
on:
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{steps.create_release.outputs.upload_url}}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
draft: true
tag_name: ${{github.ref}}
release_name: Release ${{github.ref}}
build-linux-x64:
name: Build Linux x64
needs: create_release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.3.0
with:
submodules: recursive
- name: Build Plugin
working-directory: ${{github.workspace}}/build
env:
CXX: clang++
run: |
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DLSTM_PREFER_NAM=OFF -DWAVENET_PREFER_NAM=OFF
cmake --build . --config $BUILD_TYPE -j4
- name: Add LV2 Archive
working-directory: ${{github.workspace}}/build
run: tar -czf neural_amp_modeler_lv2_linux_x64.tgz neural_amp_modeler.lv2
- 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: ./build/neural_amp_modeler_lv2_linux_x64.tgz
asset_name: neural_amp_modeler_lv2_linux_x64.tgz
asset_content_type: application/tgz
build-linux-x64v3:
name: Build Linux x64v3
needs: create_release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.3.0
with:
submodules: recursive
- name: Build Plugin
working-directory: ${{github.workspace}}/build
env:
CXX: clang++
run: |
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_NATIVE_ARCH=ON -DLSTM_PREFER_NAM=OFF -DWAVENET_PREFER_NAM=OFF
cmake --build . --config $BUILD_TYPE -j4
- name: Add LV2 Archive
working-directory: ${{github.workspace}}/build
run: tar -czf neural_amp_modeler_lv2_linux_x64v3.tgz neural_amp_modeler.lv2
- 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: ./build/neural_amp_modeler_lv2_linux_x64v3.tgz
asset_name: neural_amp_modeler_lv2_linux_x64v3.tgz
asset_content_type: application/tgz
build-windows:
name: Build Windows
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 -T ClangCL -DLSTM_PREFER_NAM=OFF -DWAVENET_PREFER_NAM=OFF ..
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_x64.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_x64.zip
asset_name: neural_amp_modeler_lv2_win_x64.zip
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 -DLSTM_PREFER_NAM=OFF -DWAVENET_PREFER_NAM=OFF -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
+3 -7
View File
@@ -1,10 +1,6 @@
[submodule "lv2"]
path = deps/lv2
url = https://github.com/lv2/lv2
[submodule "eigen"]
path = deps/eigen
url = https://gitlab.com/libeigen/eigen
[submodule "NeuralAmpModelerCore"]
path = deps/NeuralAmpModelerCore
url = https://github.com/mikeoliphant/NeuralAmpModelerCore
branch = devel
[submodule "deps/NeuralAudio"]
path = deps/NeuralAudio
url = https://github.com/mikeoliphant/NeuralAudio
+6 -12
View File
@@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 3.10)
project(NeuralAmpModelerLv2 VERSION 0.1.2)
project(NeuralAmpModelerLv2 VERSION 0.1.9)
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_REQUIRED OFF)
@@ -20,16 +21,6 @@ endif()
set(NAM_LV2_ID http://github.com/mikeoliphant/neural-amp-modeler-lv2)
include_directories(SYSTEM deps/eigen)
include_directories(SYSTEM deps/lv2/include)
include_directories(SYSTEM deps/NeuralAmpModelerCore)
include_directories(SYSTEM deps/NeuralAmpModelerCore)
include_directories(SYSTEM deps/json)
include_directories(SYSTEM deps/denormal)
add_definitions(-DNAM_SAMPLE_FLOAT)
add_definitions(-DDSP_SAMPLE_FLOAT)
add_subdirectory(src)
@@ -39,11 +30,14 @@ add_custom_target(copy_binaries ALL
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/neural_amp_modeler.ttl.in neural_amp_modeler.lv2/neural_amp_modeler.ttl)
install (DIRECTORY ${CMAKE_BINARY_DIR}/neural_amp_modeler.lv2
DESTINATION lib/lv2
DESTINATION ${LIB_INSTALL_DIR}/lv2
)
set(CPACK_GENERATOR "DEB")
+6 -4
View File
@@ -1,9 +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/NeuralAmpModelerPlugin
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/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 -7
View File
@@ -1,24 +1,33 @@
# neural-amp-modeler-lv2
Bare-bones implementation of [Neural Amp Modeler](https://github.com/sdatkinson/neural-amp-modeler) (NAM) models in an LV2 plugin.
LV2 plugin for using neural network machine learning amp models.
**There is no 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).
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.
### Models and Performance
## Models and Performance
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)).
The best source of models is [ToneHunt](https://tonehunt.org/).
NAM 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.
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.
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.
A Raspberry Pi 4 running a 64bit OS can run "standard" NAM models with plenty of room to spare for a cabinet IR and some effects. It is also capable of running two "standard" NAM models, but with less headroom for other effects.
If you are having trouble running a "standard" model, try looking for "feather" (the least expensive) models. You can find a list of ["feather"-tagged models on ToneHunt](https://tonehunt.org/?tags=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.
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.
### Building
For more information on model type support, see the [NeuralAudio](https://github.com/mikeoliphant/NeuralAudio) repository, which is where the model handling code lives.
## 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.
## Building
First clone the repository:
```bash
@@ -44,3 +53,8 @@ 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**.
## CMake Options
```-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.
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.
Vendored Submodule
+1
Submodule deps/NeuralAudio added at 4c9d20ee1c
Vendored
-1
Submodule deps/eigen deleted from 7bf2968fed
-22875
View File
File diff suppressed because it is too large Load Diff
Vendored
+1 -1
Submodule deps/lv2 updated: dbdbe3e518...e9d9432874
+1 -1
View File
@@ -5,4 +5,4 @@
<@NAM_LV2_ID@>
a lv2:Plugin;
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

+6 -4
View File
@@ -16,7 +16,7 @@
<@NAM_LV2_ID@#model>
a lv2:Parameter;
mod:fileTypes "nam,nammodel";
mod:fileTypes "nam,nammodel,json,aidax,aidadspmodel";
rdfs:label "Neural Model";
rdfs:range atom:Path.
@@ -39,11 +39,13 @@
opts:supportedOption <http://lv2plug.in/ns/ext/buf-size#maxBlockLength>;
rdfs:comment """
An LV2 implementation of Neural Amp Modeler.
LV2 plugin for neural network machine learning guitar amplifier simulation models
NAM accepts Neural Amp Modeler .nam files.
Models supported:
Neural Amp Modeler (NAM): https://github.com/sdatkinson/neural-amp-modeler
RTNeural keras/Aida-x models: https://github.com/jatinchowdhury18/RTNeural
A large collection of .nam files is available at https://tonehunt.org/
A large collection of models is available at https://tonehunt.org
""";
patch:writable <@NAM_LV2_ID@#model>;
+43 -40
View File
@@ -1,40 +1,58 @@
if (MSVC)
add_compile_options(
"$<$<CONFIG:DEBUG>:/W4>"
"$<$<CONFIG:RELEASE>:/O2>"
)
else()
add_compile_options(
-Wall
# -Wpedantic -Wextra -Wstrict-aliasing -Wunreachable-code -Weffc++ -Wno-unused-parameter
"$<$<CONFIG:DEBUG>:-Og;-ggdb>"
"$<$<CONFIG:RELWITHDEBINFO>:-Ofast>"
"$<$<CONFIG:RELEASE>:-Ofast>"
)
endif()
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64)|(AMD64)|(x86_64)")
option(USE_NATIVE_ARCH "Enable architecture-specific optimizations" OFF)
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)
message(STATUS "Enabling -march=x86-64-v3")
endif()
endif (USE_NATIVE_ARCH)
endif ()
add_subdirectory(../deps/NeuralAudio NeuralAudio)
set(SOURCES nam_lv2.cpp
nam_plugin.cpp
nam_plugin.h)
set(NAM_SOURCES ../deps/NeuralAmpModelerCore/NAM/activations.h
../deps/NeuralAmpModelerCore/NAM/activations.cpp
../deps/NeuralAmpModelerCore/NAM/version.h
../deps/NeuralAmpModelerCore/NAM/lstm.h
../deps/NeuralAmpModelerCore/NAM/lstm.cpp
../deps/NeuralAmpModelerCore/NAM/dsp.h
../deps/NeuralAmpModelerCore/NAM/dsp.cpp
../deps/NeuralAmpModelerCore/NAM/get_dsp.cpp
../deps/NeuralAmpModelerCore/NAM/util.cpp
../deps/NeuralAmpModelerCore/NAM/util.h
../deps/NeuralAmpModelerCore/NAM/wavenet.cpp
../deps/NeuralAmpModelerCore/NAM/wavenet.h
../deps/NeuralAmpModelerCore/NAM/convnet.cpp
../deps/NeuralAmpModelerCore/NAM/convnet.h)
set(NA_SOURCES ../deps/NeuralAudio/NeuralAudio/NeuralModel.h)
set(DSP_SOURCES ../deps/NeuralAmpModelerCore/dsp/dsp.h
../deps/NeuralAmpModelerCore/dsp/dsp.cpp
../deps/NeuralAmpModelerCore/dsp/RecursiveLinearFilter.h
../deps/NeuralAmpModelerCore/dsp/RecursiveLinearFilter.cpp)
add_library(neural_amp_modeler SHARED ${SOURCES} ${NA_SOURCES})
add_library(neural_amp_modeler MODULE ${SOURCES} ${NAM_SOURCES} ${DSP_SOURCES})
target_include_directories(neural_amp_modeler PUBLIC ../deps/NeuralAudio)
target_include_directories(neural_amp_modeler PUBLIC ../deps/lv2/include)
target_include_directories(neural_amp_modeler PUBLIC ../deps/denormal)
target_link_libraries(neural_amp_modeler PRIVATE NeuralAudio)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES})
source_group(NAM ${CMAKE_CURRENT_SOURCE_DIR} FILES ${NAM_SOURCES})
source_group(dsp ${CMAKE_CURRENT_SOURCE_DIR} FILES ${DSP_SOURCES})
source_group(NAM ${CMAKE_CURRENT_SOURCE_DIR} FILES ${NA_SOURCES})
option(DISABLE_DENORMALS "Disable floating point denormals" ON)
if(DISABLE_DENORMALS)
if (DISABLE_DENORMALS)
add_definitions(-DDISABLE_DENORMALS)
endif(DISABLE_DENORMALS)
target_compile_features(neural_amp_modeler PUBLIC cxx_std_17)
endif (DISABLE_DENORMALS)
set_target_properties(neural_amp_modeler
PROPERTIES
@@ -48,18 +66,3 @@ set_target_properties(neural_amp_modeler
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_compile_definitions(neural_amp_modeler PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN)
endif()
if (MSVC)
target_compile_options(neural_amp_modeler PRIVATE
"$<$<CONFIG:DEBUG>:/W4>"
"$<$<CONFIG:RELEASE>:/O2>"
)
else()
target_compile_options(neural_amp_modeler PRIVATE
-Wall
# -Wpedantic -Wextra -Wstrict-aliasing -Wunreachable-code -Weffc++ -Wno-unused-parameter
"$<$<CONFIG:DEBUG>:-Og;-ggdb>"
"$<$<CONFIG:RELWITHDEBINFO>:-Ofast>"
"$<$<CONFIG:RELEASE>:-Ofast>"
)
endif()
+2 -5
View File
@@ -14,8 +14,8 @@
#include "nam_plugin.h"
// LV2 Functions
static LV2_Handle instantiate(const LV2_Descriptor*, double rate, const char*, const LV2_Feature* const* features
) {
static LV2_Handle instantiate(const LV2_Descriptor*, double rate, const char*, const LV2_Feature* const* features)
{
try
{
auto nam = std::make_unique<NAM::Plugin>();
@@ -95,9 +95,6 @@ static const LV2_Descriptor descriptor =
LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index)
{
if (index == 0) {
// Turn on fast tanh approximation
activations::Activation::enable_fast_tanh();
return &descriptor;
}
+67 -39
View File
@@ -4,7 +4,6 @@
#include <cassert>
#include "nam_plugin.h"
#include <NAM/activations.h>
#define SMOOTH_EPSILON .0001f
@@ -12,7 +11,23 @@ namespace NAM {
Plugin::Plugin()
{
// prevent allocations on the audio thread
currentModelPath.reserve(MAX_FILE_NAME+1);
currentModelPath.reserve(MAX_FILE_NAME + 1);
// NeuralAudio::NeuralModel::SetLSTMLoadMode(
//#ifdef LSTM_PREFER_NAM
// NeuralAudio::PreferNAMCore
//#else
// NeuralAudio::PreferRTNeural
//#endif
// );
//
// NeuralAudio::NeuralModel::SetWaveNetLoadMode(
//#ifdef WAVENET_PREFER_NAM
// NeuralAudio::PreferNAMCore
//#else
// NeuralAudio::PreferRTNeural
//#endif
//);
}
Plugin::~Plugin()
@@ -24,10 +39,6 @@ namespace NAM {
{
this->sampleRate = sampleRate;
const double highPassCutoffFreq = 5.0;
const recursive_linear_filter::HighPassParams highPassParams(sampleRate, highPassCutoffFreq);
mHighPass.SetParams(highPassParams);
// for fetching initial options, can be null
LV2_Options_Option* options = nullptr;
@@ -92,7 +103,7 @@ namespace NAM {
auto msg = static_cast<const LV2LoadModelMsg*>(data);
auto nam = static_cast<NAM::Plugin*>(instance);
::DSP* model = nullptr;
NeuralAudio::NeuralModel* model = nullptr;
LV2SwitchModelMsg response = { kWorkTypeSwitch, {}, {} };
LV2_Worker_Status result = LV2_WORKER_SUCCESS;
@@ -111,36 +122,25 @@ namespace NAM {
{
lv2_log_trace(&nam->logger, "Staging model change: `%s`\n", msg->path);
model = get_dsp(msg->path).release();
// Enable model loudness normalization
model->SetNormalize(true);
// Pre-run model to ensure all needed buffers are allocated in advance
if (const int32_t numSamples = nam->maxBufferSize)
{
float* buffer = new float[numSamples];
memset(buffer, 0, numSamples * sizeof(float));
std::unordered_map<std::string, double> params = {};
model->process(&buffer, &buffer, 1, numSamples, 1.0, 1.0, params);
model->finalize_(numSamples);
delete[] buffer;
}
model = NeuralAudio::NeuralModel::CreateFromFile(msg->path);
}
response.model = model;
if (model != nullptr)
{
response.model = model;
memcpy(response.path, msg->path, pathlen);
memcpy(response.path, msg->path, pathlen);
}
}
catch (const std::exception&)
{
}
if (model == nullptr)
{
response.path[0] = '\0';
lv2_log_error(&nam->logger, "Unable to load model from: '%s'\n", msg->path);
//result = LV2_WORKER_ERR_UNKNOWN;
}
respond(handle, sizeof(response), &response);
@@ -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);
@@ -229,8 +236,15 @@ namespace NAM {
float level;
float modelInputAdjustmentDB = 0;
if (currentModel != nullptr)
{
modelInputAdjustmentDB = currentModel->GetRecommendedInputDBAdjustment();
}
// convert input level from db
float desiredInputLevel = powf(10, *(ports.input_level) * 0.05f);
float desiredInputLevel = powf(10, (*(ports.input_level) + modelInputAdjustmentDB) * 0.05f);
if (fabs(desiredInputLevel - inputLevel) > SMOOTH_EPSILON)
{
@@ -242,6 +256,7 @@ namespace NAM {
ports.audio_out[i] = ports.audio_in[i] * level;
}
inputLevel = level;
}
else
@@ -254,30 +269,30 @@ namespace NAM {
}
}
float** outputPtrs = &ports.audio_out;
float modelLoudnessAdjustmentDB = 0;
if (currentModel != nullptr)
{
currentModel->process(&ports.audio_out, &ports.audio_out, 1, n_samples, 1.0, 1.0, mNAMParams);
currentModel->finalize_(n_samples);
currentModel->Process(ports.audio_out, ports.audio_out, n_samples);
// Apply a high pass filter at 5Hz to eliminate any DC offset
outputPtrs = mHighPass.Process(outputPtrs, 1, n_samples);
modelLoudnessAdjustmentDB = currentModel->GetRecommendedOutputDBAdjustment();
}
// convert output level from db
float desiredOutputLevel = powf(10, *(ports.output_level) * 0.05f);
// Convert output level from db
float desiredOutputLevel = powf(10, (*(ports.output_level) + modelLoudnessAdjustmentDB) * 0.05f);
if (fabs(desiredOutputLevel - outputLevel) > SMOOTH_EPSILON)
{
level = outputLevel;
for (unsigned int i = 0; i < n_samples; i++)
{
// do very basic smoothing
level = (.99f * level) + (.01f * desiredOutputLevel);
ports.audio_out[i] = outputPtrs[0][i] * outputLevel;
ports.audio_out[i] = ports.audio_out[i] * outputLevel;
}
outputLevel = level;
}
else
@@ -286,9 +301,22 @@ namespace NAM {
for (unsigned int i = 0; i < n_samples; i++)
{
ports.audio_out[i] = outputPtrs[0][i] * level;
ports.audio_out[i] = ports.audio_out[i] * level;
}
}
//float dcBlockCoefficient = 1 - (220.0 / sampleRate);
//for (unsigned int i = 0; i < n_samples; i++)
//{
// float dcInput = ports.audio_out[i];
// // dc blocker
// ports.audio_out[i] = ports.audio_out[i] - prevDCInput + dcBlockCoefficient * prevDCOutput;
// prevDCInput = dcInput;
// prevDCOutput = ports.audio_out[i];
//}
}
uint32_t Plugin::options_get(LV2_Handle, LV2_Options_Option*)
@@ -305,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;
}
}
+8 -9
View File
@@ -21,8 +21,7 @@
#include <lv2/state/state.h>
#include <lv2/units/units.h>
#include <NAM/dsp.h>
#include <dsp/RecursiveLinearFilter.h>
#include <NeuralAudio/NeuralModel.h>
#define PlUGIN_URI "http://github.com/mikeoliphant/neural-amp-modeler-lv2"
#define MODEL_URI PlUGIN_URI "#model"
@@ -44,12 +43,12 @@ namespace NAM {
struct LV2SwitchModelMsg {
LV2WorkType type;
char path[MAX_FILE_NAME];
::DSP* model;
NeuralAudio::NeuralModel* model;
};
struct LV2FreeModelMsg {
LV2WorkType type;
::DSP* model;
NeuralAudio::NeuralModel* model;
};
class Plugin {
@@ -71,16 +70,16 @@ namespace NAM {
LV2_Log_Logger logger = {};
LV2_Worker_Schedule* schedule = nullptr;
::DSP* currentModel = nullptr;
NeuralAudio::NeuralModel* currentModel = nullptr;
std::string currentModelPath;
recursive_linear_filter::HighPass mHighPass;
std::unordered_map<std::string, double> mNAMParams = {};
float prevDCInput = 0;
float prevDCOutput = 0;
Plugin();
~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();
@@ -120,6 +119,6 @@ namespace NAM {
float inputLevel = 0;
float outputLevel = 0;
int32_t maxBufferSize = 0;
int32_t maxBufferSize = 512;
};
}