Skip to content

Commit

Permalink
Presets improvements (#311)
Browse files Browse the repository at this point in the history
* Normalizing factory preset output levels

* CI tweaks and making mix group parameter preset agnostic

* Update validation script for MacOS
  • Loading branch information
jatinchowdhury18 committed Oct 17, 2023
1 parent 6283854 commit 0404408
Show file tree
Hide file tree
Showing 38 changed files with 224 additions and 154 deletions.
96 changes: 48 additions & 48 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
name: clang-tidy

on:
pull_request:
branches:
- main
- develop
paths:
- '**.cpp'
- '**.h'

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: Run clang-tidy on pull request
runs-on: ubuntu-latest
steps:
- name: Install Linux Deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt install clang-tidy
- name: Checkout code
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0

- name: Run clang-tidy
shell: bash
working-directory: ${{github.workspace}}/Plugin
run: find Source -iname "*.cpp" -not -path "Source/Headless*" | xargs clang-tidy > tidy_log.txt && status=0 || status=1

- name: Check results
shell: bash
working-directory: ${{github.workspace}}/Plugin
run: |
num_failures=$(grep "" -c tidy_log.txt)
num_ignore=$(echo $(($(grep "file not found" -c tidy_log.txt)*3)))
num_actual=$(($num_failures - $num_ignore))
if [ "$num_actual" -gt 1 ]; then
more tidy_log.txt
exit 1
fi
#name: clang-tidy
#
#on:
# pull_request:
# branches:
# - main
# - develop
# paths:
# - '**.cpp'
# - '**.h'
#
# 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: Run clang-tidy on pull request
# runs-on: ubuntu-latest
#
# steps:
# - name: Install Linux Deps
# if: runner.os == 'Linux'
# run: |
# sudo apt-get update
# sudo apt install clang-tidy
#
# - name: Checkout code
# uses: actions/checkout@v2
# with:
# persist-credentials: false
# fetch-depth: 0
#
# - name: Run clang-tidy
# shell: bash
# working-directory: ${{github.workspace}}/Plugin
# run: find Source -iname "*.cpp" -not -path "Source/Headless*" | xargs clang-tidy > tidy_log.txt && status=0 || status=1
#
# - name: Check results
# shell: bash
# working-directory: ${{github.workspace}}/Plugin
# run: |
# num_failures=$(grep "" -c tidy_log.txt)
# num_ignore=$(echo $(($(grep "file not found" -c tidy_log.txt)*3)))
# num_actual=$(($num_failures - $num_ignore))
# if [ "$num_actual" -gt 1 ]; then
# more tidy_log.txt
# exit 1
# fi
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Configure
shell: bash
working-directory: ${{github.workspace}}/Plugin
run: cmake -Bbuild -DBUILD_HEADLESS=ON
run: cmake -Bbuild -DBUILD_HEADLESS=ON -DCMAKE_BUILD_TYPE=Release

- name: Build
shell: bash
Expand Down
126 changes: 63 additions & 63 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
name: CI-iOS

on:
push:
branches:
- master
- develop
paths-ignore:
- 'Manual/**'
- 'Paper/**'
- 'Simulations/**'
- 'Testing/**'
- 'Scripts/**'
- '*.md'
pull_request:
branches:
- master
- develop
paths-ignore:
- 'Manual/**'
- 'Paper/**'
- 'Simulations/**'
- 'Testing/**'
- 'Scripts/**'
- '*.md'

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: Build AUv3 plugin for iOS
runs-on: macos-latest
steps:
- name: Get latest CMake
uses: lukka/get-cmake@latest

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

- uses: Apple-Actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.MAC_CERTIFICATES_BASE64 }}
p12-password: ${{ secrets.MAC_CERTIFICATES_PASS }}

- uses: Apple-Actions/download-provisioning-profiles@v1
with:
bundle-id: com.chowdsp.CHOWTapeModel*
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}

- name: Configure
shell: bash
run: cmake -Bbuild-ios Plugin -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=11.4 -DCMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY="1,2" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE="Manual" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="Apple Distribution" -DCMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER="ChowTapeModel" -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=${{ secrets.APPLE_TEAM_ID }}


- name: Build
shell: bash
run: cmake --build build-ios --config Release --parallel 4 | xcpretty
#name: CI-iOS
#
#on:
# push:
# branches:
# - master
# - develop
# paths-ignore:
# - 'Manual/**'
# - 'Paper/**'
# - 'Simulations/**'
# - 'Testing/**'
# - 'Scripts/**'
# - '*.md'
# pull_request:
# branches:
# - master
# - develop
# paths-ignore:
# - 'Manual/**'
# - 'Paper/**'
# - 'Simulations/**'
# - 'Testing/**'
# - 'Scripts/**'
# - '*.md'
#
# 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: Build AUv3 plugin for iOS
# runs-on: macos-latest
#
# steps:
# - name: Get latest CMake
# uses: lukka/get-cmake@latest
#
# - name: Checkout code
# uses: actions/checkout@v2
# with:
# submodules: recursive
#
# - uses: Apple-Actions/import-codesign-certs@v1
# with:
# p12-file-base64: ${{ secrets.MAC_CERTIFICATES_BASE64 }}
# p12-password: ${{ secrets.MAC_CERTIFICATES_PASS }}
#
# - uses: Apple-Actions/download-provisioning-profiles@v1
# with:
# bundle-id: com.chowdsp.CHOWTapeModel*
# issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
# api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
# api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
#
# - name: Configure
# shell: bash
# run: cmake -Bbuild-ios Plugin -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=11.4 -DCMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY="1,2" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE="Manual" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="Apple Distribution" -DCMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER="ChowTapeModel" -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=${{ secrets.APPLE_TEAM_ID }}
#
#
# - name: Build
# shell: bash
# run: cmake --build build-ios --config Release --parallel 4 | xcpretty
1 change: 1 addition & 0 deletions Plugin/Source/Headless/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ target_sources(ChowTapeModel_Headless PRIVATE
UnitTests/MultiChannelTest.cpp
UnitTests/SpeedTest.cpp
UnitTests/STNTest.cpp
UnitTests/PresetLevelTest.cpp
)

target_include_directories(ChowTapeModel_Headless PRIVATE ../)
Expand Down
63 changes: 63 additions & 0 deletions Plugin/Source/Headless/UnitTests/PresetLevelTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include "PluginProcessor.h"

class PresetLevelTest : public UnitTest
{
public:
PresetLevelTest() : UnitTest ("PresetLevelTest")
{
}

void runTest() override
{
beginTest ("Preset Level Test");

std::unique_ptr<ChowtapeModelAudioProcessor> proc {
dynamic_cast<ChowtapeModelAudioProcessor*> (createPluginFilterOfType (
AudioProcessor::WrapperType::wrapperType_Standalone))
};

static constexpr double sampleRate = 48000.0;
static constexpr int blockSize = 512;
const auto numChannels = proc->getMainBusNumInputChannels();

auto rand = getRandom();

juce::AudioBuffer<float> buffer { numChannels, blockSize };
juce::MidiBuffer midi;

for (int programIdx = 0; programIdx < proc->getNumPrograms(); ++programIdx)
{
proc->setCurrentProgram (programIdx);
logMessage ("Loading preset: " + proc->getProgramName (programIdx));
proc->prepareToPlay (sampleRate, blockSize);

float maxMagnitudeDB = 0.0f;
for (int i = 0; i < 10; ++i)
{
for (int ch = 0; ch < numChannels; ++ch)
{
for (int n = 0; n < blockSize; ++n)
buffer.setSample (ch, n, rand.nextFloat() * 2.0f - 1.0f);
}

proc->processBlock (buffer, midi);

const auto magnitudeDB = chowdsp::BufferMath::getMagnitude (buffer);
expectGreaterThan (magnitudeDB, -60.0f);
expectLessOrEqual (magnitudeDB, 3.0f);

maxMagnitudeDB = juce::jmax (magnitudeDB, maxMagnitudeDB);
}
expectGreaterThan (maxMagnitudeDB, -3.0f);

proc->releaseResources();
}
}
};

static PresetLevelTest presetLevelTest;

// Sink / Chorus4
// Carter / Bass - 808 Maker
// Carter / Guitar - Short Plucked
// COolWAV / Drift with me
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PARAM id="h_bass" value="-0.2000000476837158"/>
<PARAM id="h_treble" value="0.7999999523162842"/>
<PARAM id="ingain" value="2.0"/>
<PARAM id="mode" value="4.0"/>
<PARAM id="mode" value="2"/>
<PARAM id="os" value="2.0"/>
<PARAM id="outgain" value="0.0"/>
<PARAM id="rate" value="0.5"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PARAM id="h_bass" value="-0.6000000238418579"/>
<PARAM id="h_treble" value="-0.4000000357627869"/>
<PARAM id="ingain" value="0.0"/>
<PARAM id="mode" value="4.0"/>
<PARAM id="mode" value="2"/>
<PARAM id="os" value="3.0"/>
<PARAM id="outgain" value="0.0"/>
<PARAM id="rate" value="0.199999988079071"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<PARAM id="ingain" value="-2.0"/>
<PARAM id="loss_onoff" value="1.0"/>
<PARAM id="mix_group" value="0.0"/>
<PARAM id="mode" value="4.0"/>
<PARAM id="mode" value="2"/>
<PARAM id="os" value="2.0"/>
<PARAM id="os_mode" value="0.0"/>
<PARAM id="os_render_factor" value="1.0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PARAM id="ingain" value="0.0"/>
<PARAM id="loss_onoff" value="1.0"/>
<PARAM id="mix_group" value="0.0"/>
<PARAM id="mode" value="0.0"/>
<PARAM id="mode" value="2"/>
<PARAM id="os" value="1.0"/>
<PARAM id="outgain" value="0.0"/>
<PARAM id="preset" value="33"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PARAM id="ingain" value="1.329999923706055"/>
<PARAM id="loss_onoff" value="1.0"/>
<PARAM id="mix_group" value="0.0"/>
<PARAM id="mode" value="0.0"/>
<PARAM id="mode" value="2"/>
<PARAM id="os" value="1.0"/>
<PARAM id="outgain" value="-3.220001220703125"/>
<PARAM id="preset" value="38"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<PARAM id="ingain" value="0.0"/>
<PARAM id="loss_onoff" value="1.0"/>
<PARAM id="mix_group" value="0.0"/>
<PARAM id="mode" value="0.0"/>
<PARAM id="os" value="1.0"/>
<PARAM id="mode" value="2"/>
<PARAM id="os" value="2"/>
<PARAM id="outgain" value="-2.120000839233398"/>
<PARAM id="preset" value="47"/>
<PARAM id="rate" value="0.009999999776482582"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
<PARAM id="ingain" value="0.0"/>
<PARAM id="loss_onoff" value="1.0"/>
<PARAM id="mix_group" value="0.0"/>
<PARAM id="mode" value="0.0"/>
<PARAM id="mode" value="2"/>
<PARAM id="os" value="2.0"/>
<PARAM id="outgain" value="3.75"/>
<PARAM id="outgain" value="0.0"/>
<PARAM id="preset" value="60"/>
<PARAM id="rate" value="0.3599999845027924"/>
<PARAM id="sat" value="0.5"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<PARAM id="ingain" value="0.0"/>
<PARAM id="loss_onoff" value="1.0"/>
<PARAM id="mix_group" value="0.0"/>
<PARAM id="mode" value="4.0"/>
<PARAM id="mode" value="2"/>
<PARAM id="os" value="1.0"/>
<PARAM id="outgain" value="1.979999542236328"/>
<PARAM id="outgain" value="0.0"/>
<PARAM id="preset" value="61"/>
<PARAM id="rate" value="0.199999988079071"/>
<PARAM id="sat" value="0.5"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PARAM id="ingain" value="0.0"/>
<PARAM id="loss_onoff" value="1.0"/>
<PARAM id="mix_group" value="0.0"/>
<PARAM id="mode" value="0.0"/>
<PARAM id="mode" value="2"/>
<PARAM id="os" value="1.0"/>
<PARAM id="outgain" value="0.0"/>
<PARAM id="preset" value="30"/>
Expand Down
Loading

0 comments on commit 0404408

Please sign in to comment.