Skip to content

Commit

Permalink
Merge pull request #30 from GuitarML/v1-3-updates
Browse files Browse the repository at this point in the history
V1 3 updates
  • Loading branch information
GuitarML authored Aug 31, 2022
2 parents 7f90cae + 9771f3a commit e363310
Show file tree
Hide file tree
Showing 50 changed files with 3,060 additions and 516 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

workflow_dispatch:

jobs:
build_and_test:
if: contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
name: Test plugin on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # show all errors for each platform (vs. cancel jobs on error)
matrix:
os: [ubuntu-latest, windows-2019, macOS-latest]

steps:
- name: Install Linux Deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt install libasound2-dev libcurl4-openssl-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev libjack-jackd2-dev lv2-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
- name: Get latest CMake
uses: lukka/get-cmake@latest

- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive

- name: Configure
shell: bash
run: cmake -Bbuild

- name: Build
shell: bash
run: cmake --build build --config Release --parallel 4

# Failing validation, fix
#- name: Validate
# if: runner.os == 'Windows'
# run: bash validate.sh

- name: Upload Linux Artifact GitHub Action
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: linux-assets
path: /home/runner/work/TS-M1N3/TS-M1N3/build/TS-M1N3_artefacts

- name: Upload Mac Artifact GitHub Action
if: runner.os == 'macOS'
uses: actions/upload-artifact@v2
with:
name: mac-assets
path: /Users/runner/work/TS-M1N3/TS-M1N3/build/TS-M1N3_artefacts

- name: Upload Windows Artifact GitHub Action
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
with:
name: win-assets
path: D:/a/TS-M1N3/TS-M1N3/build/TS-M1N3_artefacts
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "modules/JUCE"]
path = modules/JUCE
url = https://github.com/juce-framework/JUCE.git
[submodule "modules/chowdsp_utils"]
path = modules/chowdsp_utils
url = https://github.com/Chowdhury-DSP/chowdsp_utils
[submodule "modules/libsamplerate"]
path = modules/libsamplerate
url = https://github.com/libsndfile/libsamplerate
[submodule "modules/eigen"]
path = modules/eigen
url = https://gitlab.com/libeigen/eigen.git
58 changes: 58 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
cmake_minimum_required(VERSION 3.15)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment target")
project(SmartAmp VERSION 1.3)

set(CMAKE_CXX_STANDARD 17)

add_subdirectory(modules)
include_directories(modules)

juce_set_aax_sdk_path(C:/SDKs/AAX_SDK/)

set(JUCE_FORMATS AU VST3)

# Build LV2 only on Linux
if(UNIX AND NOT APPLE)
message(STATUS "Building LV2 plugin format")
list(APPEND JUCE_FORMATS LV2)
endif()

# Build AAX if SDK target exists
if(TARGET juce_aax_sdk)
message(STATUS "Building AAX plugin format")
list(APPEND JUCE_FORMATS AAX)
endif()

juce_add_plugin(SmartAmp
COMPANY_NAME GuitarML
PLUGIN_MANUFACTURER_CODE GtML
PLUGIN_CODE Npi3
FORMATS ${JUCE_FORMATS}
ProductName "SmartAmp"
LV2_URI https://github.com/GuitarML/SmartAmp
ICON_BIG resources/logo.png
MICROPHONE_PERMISSION_ENABLED TRUE
)

# create JUCE header
juce_generate_juce_header(SmartAmp)

# add sources
add_subdirectory(src)
include_directories(src)
add_subdirectory(resources)

target_compile_definitions(SmartAmp
PUBLIC
JUCE_DISPLAY_SPLASH_SCREEN=0
JUCE_REPORT_APP_USAGE=0
JUCE_WEB_BROWSER=0
JUCE_USE_CURL=0
JUCE_VST3_CAN_REPLACE_VST2=0
JUCE_MODAL_LOOPS_PERMITTED=1
)

target_link_libraries(SmartAmp PUBLIC
juce_plugin_modules
)

File renamed without changes.
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,32 @@ Model training is done using PyTorch on pre recorded .wav samples. More info in
To share your best models, email the json files to smartguitarml@gmail.com and they may be included
in the latest release as a downloadable zip.

Also see companion plugin, the [SmartGuitarPedal](https://github.com/GuitarML/SmartGuitarPedal)
Also see companion plugin, the [SmartGuitarPedal](https://github.com/GuitarML/SmartGuitarPedal)<br>
Note: As of SmartAmp version 1.3, the custom model load was removed to simplify the plugin. To load user
trained models, use the SmartGuitarPedal, which plays all models trained with PedalNetRT.

## Installing the plugin

1. Download plugin (Windows 10, Mac, Ubuntu Linux) [here](https://github.com/keyth72/SmartGuitarAmp/releases)
2. Copy to your DAW's VST directory (for Mac, use .dmg installer or copy AU/VST3 to desired folder)
1. Download the appropriate plugin installer (Windows, Mac, Linux)
2. Run the installer and follow the instructions. May need to reboot to allow your DAW to recognize the new plugin.

## Build Instructions

1. Clone or download this repository.
2. Download and install [JUCE](https://juce.com/) This project uses the "Projucer" application from the JUCE website.
3. Download [Eigen](http://eigen.tuxfamily.org)
Extract Eigen to a convenient location on your system (will be linked with Projucer)
4. Open SmartGuitarPedal.jucer file with Projucer
5. Add the <full_path_to>/ Eigen folder to "Header Search Paths" in Exporters -> Debug/Release
6. Open and build project in Visual Studio (Windows), Xcode (Mac), or Code::Blocks/Makefile (Linux)
### Build with Cmake

Note: Make sure to build in Release mode unless actually debugging. Debug mode will not keep up with real time playing.
```bash
# Clone the repository
$ git clone https://github.com/GuitarML/SmartGuitarAmp.git
$ cd SmartGuitarAmp

## Using your own custom trained models (or models from the TonePack)
# initialize and set up submodules
$ git submodule update --init --recursive

Use the "Load Tone" button in the plugin to load tone models trained with PedalNetRT. The current channel's
EQ/gain will be applied to the custom tone. Switching the clean/lead channel unloads the custom tone and
reloads the channel's default tone.
# build with CMake
$ cmake -Bbuild
$ cmake --build build --config Release
```
The binaries will be located in `SmartAmp/build/SmartAmp_artefacts/`

## License
This project is licensed under the Apache License, Version 2.0 - see the [LICENSE](LICENSE) file for details.
Expand Down
115 changes: 115 additions & 0 deletions aax_builds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#!/bin/bash

# exit on failure
set -e

# need to run in sudo mode on Mac
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ "$EUID" -ne 0 ]; then
echo "This script must be run in sudo mode! Exiting..."
exit 1
fi
fi

if [[ "$*" = *debug* ]]; then
echo "Making DEBUG build"
build_config="Debug"
else
echo "Making RELEASE build"
build_config="Release"
fi

# clean up old builds
if [[ $* = *clean* ]]; then
echo "Cleaning previous build..."
rm -rf build-aax/
fi

sed_cmakelist()
{
sed_args="$1"

if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "$sed_args" CMakeLists.txt
else
sed -i -e "$sed_args" CMakeLists.txt
fi
}

# set up OS-dependent variables
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Building for MAC"
AAX_PATH=~/Developer/AAX_SDK/
ilok_pass=$(more ~/Developer/ilok_pass)
aax_target_dir="/Library/Application Support/Avid/Audio/Plug-Ins"
TEAM_ID=$(more ~/Developer/mac_id)
TARGET_DIR="Mac"

else # Windows
echo "Building for WINDOWS"
AAX_PATH=C:/SDKs/AAX_SDK/
ilok_pass=$(cat /c/SDKs/ilok_pass)
aax_target_dir="/c/Program Files/Common Files/Avid/Audio/Plug-Ins"
TARGET_DIR="Win64"
fi

# set up build AAX
#sed_cmakelist "s~# juce_set_aax_sdk_path.*~juce_set_aax_sdk_path(${AAX_PATH})~"

# cmake new builds
if [[ "$OSTYPE" == "darwin"* ]]; then
cmake -Bbuild-aax -GXcode -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="Developer ID Application" \
-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM="$TEAM_ID" \
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE="Manual" \
-D"CMAKE_OSX_ARCHITECTURES=x86_64" \
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_INJECT_BASE_ENTITLEMENTS=NO \
-DCMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS="--timestamp" \
-DMACOS_RELEASE=ON

cmake --build build-aax --config $build_config --target SmartAmp_AAX | xcpretty

else # Windows
cmake -Bbuild-aax -G"Visual Studio 16 2019" -A x64
cmake --build build-aax --config $build_config --parallel $(nproc) --target SmartAmp_AAX
fi

# sign with PACE
aax_location=build-aax/SmartAmp_artefacts/$build_config/AAX/SmartAmp.aaxplugin
wcguid="" # Update
if [[ "$OSTYPE" == "darwin"* ]]; then
/Applications/PACEAntiPiracy/Eden/Fusion/Current/bin/wraptool sign --verbose \
--account keyth72 \
--password "$ilok_pass" \
--wcguid $wcguid \
--dsig1-compat off \
--signid "Developer ID Application: Keith Bloemer" \
--in $aax_location \
--out $aax_location

/Applications/PACEAntiPiracy/Eden/Fusion/Current/bin/wraptool verify --verbose --in $aax_location

else # Windows
wraptool sign --verbose \
--account keyth72 \
--password "$ilok_pass" \
--wcguid $wcguid \
--keyfile /c/SDKs/keith_aax_cert.p12 \
--keypassword "$ilok_pass" \
--in $aax_location \
--out $aax_location

wraptool verify --verbose --in $aax_location/Contents/x64/SmartAmp.aaxplugin
fi

# reset AAX SDK field...
#sed_cmakelist "s~juce_set_aax_sdk_path.*~# juce_set_aax_sdk_path(NONE)~"

rm -rf "$aax_target_dir/SmartAmp.aaxplugin"
cp -R "$aax_location" "$aax_target_dir/SmartAmp.aaxplugin"

if [[ "$*" = *deploy* ]]; then
set +e

ssh "smartguitarml@gmail.com" "rm -r ~/aax_builds/${TARGET_DIR}/SmartAmp.aaxplugin"
scp -r "$aax_location" "smartguitarml@gmail.com:~/aax_builds/${TARGET_DIR}/"
fi
39 changes: 39 additions & 0 deletions installers/linux/build_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# This script builds a .deb package for installing the VST3, and LV2 plugins on Linux

# Set the app name and version here
app_name=SmartAmp
version=1.3


# 1. Create the package directory structure and control file

mkdir -p $app_name"/DEBIAN"

printf "Package: $app_name\n\
Version: $version\n\
Section: custom\n\
Priority: optional\n\
Architecture: all\n\
Essential: no\n\
Installed-Size: 16480128\n\
Maintainer: GuitarML\n\
Description: GuitarML Plugin Debian Package (VST3, LV2)\n" > $app_name"/DEBIAN/control"


# 2. Copy VST3 and LV2 plugins to the package directory (assumes project is already built)

mkdir -p $app_name/usr/local/lib/vst3/
echo "Copying ../../build/"$app_name"_artefacts/Release/VST3/"$app_name".vst3"
cp -r "../../build/"$app_name"_artefacts/Release/VST3/"$app_name".vst3" $app_name"/usr/local/lib/vst3/"

mkdir -p $app_name/usr/local/lib/lv2/
echo "Copying ../../build/"$app_name"_artefacts/Release/LV2/"$app_name".lv2"
cp -r "../../build/"$app_name"_artefacts/Release/LV2/"$app_name".lv2" $app_name"/usr/local/lib/lv2/"


# 3. Build the .deb package and rename

dpkg-deb --build $app_name

mv $app_name.deb $app_name-Linux-x64-$version.deb
1 change: 1 addition & 0 deletions installers/mac/Intro.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This application will install the SmartAmp audio plugin version ##APPVERSION## to your computer.
Loading

0 comments on commit e363310

Please sign in to comment.