mirror of
https://github.com/mikeoliphant/neural-amp-modeler-lv2.git
synced 2026-05-07 20:10:11 +02:00
Compare commits
106 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a5865a8a4 | |||
| 5880267d49 | |||
| 6cd11a9e57 | |||
| 513a537d43 | |||
| 1193da70ca | |||
| 2f81ad2b81 | |||
| eeaeeecf24 | |||
| 0fd82dc816 | |||
| d998b95e45 | |||
| 42d9d8b4c3 | |||
| b5b934d4e7 | |||
| c3bcac7085 | |||
| 94d86f5bc6 | |||
| 4b5f7d9051 | |||
| 91259b8eb6 | |||
| 4c8c341fdd | |||
| ccfa2e3882 | |||
| 2fdabf74ce | |||
| ce7cbeb8f3 | |||
| 8e3b71c13d | |||
| 8dc56d247c | |||
| 77731797d1 | |||
| 10aebb7329 | |||
| bd455b50a9 | |||
| 81bc4a2247 | |||
| 50be3658e6 | |||
| 9a60937f64 | |||
| 8ddad7168d | |||
| 5566a69731 | |||
| 994a68c4f0 | |||
| b4144b9027 | |||
| fcb5963f05 | |||
| 8401d65129 | |||
| 4952d8e787 | |||
| a0a8f8af32 | |||
| 40a58b8ef2 | |||
| 3ca0fdc51f | |||
| 0227fdc1fc | |||
| b8dee789b5 | |||
| f8f73bff29 | |||
| fc5ff29f12 | |||
| ae14f2f13b | |||
| c747bb8f4d | |||
| 937e7764b8 | |||
| 1590c9c53b | |||
| c21f7d7254 | |||
| 9bb3a3f34d | |||
| 46a9691259 | |||
| 2b27baa15e | |||
| 2d3e4115e4 | |||
| 2da7a84a4d | |||
| 2f525e1a2a | |||
| 9c55e904cb | |||
| 3960aa75e7 | |||
| 436fb12664 | |||
| 7e03d2bd3d | |||
| 46c2bb823f | |||
| 5f91734de9 | |||
| d60ae6f369 | |||
| 6905406e95 | |||
| 011b741bbc | |||
| c4733d53bc | |||
| 42b2173e57 | |||
| 695f129e7f | |||
| 952fc0edaf | |||
| 76d29579b0 | |||
| 00fde9f172 | |||
| 14a05cbd27 | |||
| 2a6aa910fc | |||
| 24fd1504ae | |||
| af73122323 | |||
| 2c4fdeafbd | |||
| 05eb9c3669 | |||
| f15a88e392 | |||
| 1732b0e46a | |||
| d17b169e5c | |||
| bd4b2e997f | |||
| b7dd908297 | |||
| 8668125890 | |||
| 873e17f5b0 | |||
| d326635556 | |||
| fe662d4273 | |||
| 368e47e12e | |||
| 429ce7ac4b | |||
| 979b8f4cf1 | |||
| f14faca788 | |||
| 7fd72e3fe1 | |||
| fcd3d6b93c | |||
| 48b6765d72 | |||
| e5984f6e0c | |||
| 54516bd618 | |||
| 4b10ae103a | |||
| e9f6f01d8e | |||
| e2caafbb2d | |||
| 9d2e7ae205 | |||
| 84a74d51ff | |||
| b7595d2750 | |||
| ac4f7d1a50 | |||
| eeaa4649a4 | |||
| 3f5872cc78 | |||
| 5dd03764c5 | |||
| 43870cc0da | |||
| 69bfdb4370 | |||
| 84f5851b5d | |||
| 75fcc78bae | |||
| 5b2c9a154f |
@@ -20,10 +20,14 @@ 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:
|
||||
@@ -47,8 +51,12 @@ jobs:
|
||||
- name: Build Plugin
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
cmake.exe -G "Visual Studio 17 2022" -A x64 -T ClangCL ..
|
||||
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
|
||||
|
||||
@@ -27,7 +27,69 @@ jobs:
|
||||
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
|
||||
@@ -40,11 +102,11 @@ jobs:
|
||||
- name: Build Plugin
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
cmake.exe -G "Visual Studio 17 2022" -A x64 -T ClangCL ..
|
||||
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.zip
|
||||
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
|
||||
@@ -52,6 +114,34 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: ./neural_amp_modeler.lv2.zip
|
||||
asset_name: neural_amp_modeler.lv2.zip
|
||||
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
|
||||
|
||||
+8
-4
@@ -1,17 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(NeuralAmpModelerLv2 VERSION 0.1.5)
|
||||
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 17)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
include_directories(SYSTEM /usr/local/include)
|
||||
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")
|
||||
add_compile_definitions(NOMINMAX WIN32_LEAN_AND_MEAN)
|
||||
else()
|
||||
@@ -29,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
-6
@@ -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/jatinchowdhury18/RTNeural
|
||||
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.
|
||||
|
||||
@@ -1,25 +1,34 @@
|
||||
# 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 neural network machine learning amp model playback using the [NeuralAudio](https://github.com/mikeoliphant/NeuralAudio) engine.
|
||||
|
||||
**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.
|
||||
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).
|
||||
**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/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.
|
||||
|
||||
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 Supported
|
||||
|
||||
The best source of models is [ToneHunt](https://tonehunt.org/).
|
||||
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)).
|
||||
|
||||
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.
|
||||
The best source of models is [Tone3000](https://www.tone3000.com/).
|
||||
|
||||
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.
|
||||
For more information on model type support, see the [NeuralAudio](https://github.com/mikeoliphant/NeuralAudio) repository, which is where the model handling code lives.
|
||||
|
||||
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.
|
||||
## Performance
|
||||
|
||||
### Building
|
||||
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.
|
||||
|
||||
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 Tone3000](https://www.tone3000.com/search?sizes=feather). 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.
|
||||
|
||||
|
||||
## 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
|
||||
@@ -45,6 +54,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**.
|
||||
|
||||
### 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.
|
||||
|
||||
```-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.
|
||||
|
||||
Vendored
+1
-1
Submodule deps/NeuralAudio updated: 2f6f136dc3...842f675179
@@ -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>.
|
||||
|
||||
@@ -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 |
@@ -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 |
@@ -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 |
@@ -16,7 +16,7 @@
|
||||
|
||||
<@NAM_LV2_ID@#model>
|
||||
a lv2:Parameter;
|
||||
mod:fileTypes "nam,nammodel,json";
|
||||
mod:fileTypes "nam,nammodel,json,aidax,aidadspmodel";
|
||||
rdfs:label "Neural Model";
|
||||
rdfs:range atom:Path.
|
||||
|
||||
|
||||
+39
-26
@@ -1,8 +1,35 @@
|
||||
add_subdirectory(../deps/NeuralAudio NeuralAudio)
|
||||
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()
|
||||
|
||||
include_directories(SYSTEM ../deps/NeuralAudio)
|
||||
include_directories(SYSTEM ../deps/lv2/include)
|
||||
include_directories(SYSTEM ../deps/denormal)
|
||||
|
||||
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
|
||||
@@ -12,6 +39,10 @@ set(NA_SOURCES ../deps/NeuralAudio/NeuralAudio/NeuralModel.h)
|
||||
|
||||
add_library(neural_amp_modeler SHARED ${SOURCES} ${NA_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})
|
||||
@@ -23,14 +54,11 @@ if (DISABLE_DENORMALS)
|
||||
add_definitions(-DDISABLE_DENORMALS)
|
||||
endif (DISABLE_DENORMALS)
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64)|(AMD64)|(x86_64)")
|
||||
option(USE_NATIVE_ARCH "Enable architecture-specific optimizations" OFF)
|
||||
option(SMART_BYPASS_ENABLED "Enable auto-bypass on silence" OFF)
|
||||
|
||||
if (USE_NATIVE_ARCH)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64-v3")
|
||||
message("Enabling -march=x86-64-v3")
|
||||
endif (USE_NATIVE_ARCH)
|
||||
endif ()
|
||||
if (SMART_BYPASS_ENABLED)
|
||||
add_definitions(-DSMART_BYPASS_ENABLED)
|
||||
endif (SMART_BYPASS_ENABLED)
|
||||
|
||||
set_target_properties(neural_amp_modeler
|
||||
PROPERTIES
|
||||
@@ -44,18 +72,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
-2
@@ -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>();
|
||||
|
||||
+90
-18
@@ -7,11 +7,33 @@
|
||||
|
||||
#define SMOOTH_EPSILON .0001f
|
||||
|
||||
#ifndef BYPASS_DB_THRESHOLD
|
||||
#define BYPASS_DB_THRESHOLD -100
|
||||
#endif
|
||||
|
||||
namespace NAM {
|
||||
Plugin::Plugin()
|
||||
{
|
||||
// prevent allocations on the audio thread
|
||||
currentModelPath.reserve(MAX_FILE_NAME+1);
|
||||
currentModelPath.reserve(MAX_FILE_NAME + 1);
|
||||
|
||||
bypassThresholdLinear = powf(10, BYPASS_DB_THRESHOLD * 0.05f);
|
||||
|
||||
// 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()
|
||||
@@ -107,31 +129,24 @@ namespace NAM {
|
||||
lv2_log_trace(&nam->logger, "Staging model change: `%s`\n", msg->path);
|
||||
|
||||
model = NeuralAudio::NeuralModel::CreateFromFile(msg->path);
|
||||
|
||||
// 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));
|
||||
|
||||
// model->Process(buffer, buffer, numSamples);
|
||||
// //model->finalize_(numSamples);
|
||||
|
||||
// delete[] buffer;
|
||||
//}
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -172,6 +187,18 @@ namespace NAM {
|
||||
nam->currentModelPath = msg->path;
|
||||
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
|
||||
nam->schedule->schedule_work(nam->schedule->handle, sizeof(reply), &reply);
|
||||
|
||||
@@ -181,6 +208,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);
|
||||
@@ -225,6 +259,44 @@ namespace NAM {
|
||||
if (currentModel != nullptr)
|
||||
{
|
||||
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
|
||||
@@ -317,7 +389,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;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-1
@@ -79,6 +79,8 @@ namespace NAM {
|
||||
~Plugin();
|
||||
|
||||
bool initialize(double rate, const LV2_Feature* const* features) noexcept;
|
||||
void set_max_buffer_size(int size) noexcept;
|
||||
void activate() noexcept;
|
||||
void process(uint32_t n_samples) noexcept;
|
||||
|
||||
void write_current_path();
|
||||
@@ -118,6 +120,9 @@ namespace NAM {
|
||||
|
||||
float inputLevel = 0;
|
||||
float outputLevel = 0;
|
||||
int32_t maxBufferSize = 0;
|
||||
int32_t maxBufferSize = 512;
|
||||
float bypassThresholdLinear = 0;
|
||||
uint32_t silentSamples = 0;
|
||||
bool smartBypassed = true;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user