From 6473d59df51b2999bfd71ba44957900363470cc1 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sun, 28 Jul 2024 22:35:57 -0400 Subject: [PATCH 1/7] Move to github actions For PR, CodeQual, and Doxygen --- .github/workflows/build-pr.yml | 76 ++++++++++++++++ .github/workflows/publish-doxygen.yml | 19 ++++ azure-pipelines.yml | 122 -------------------------- 3 files changed, 95 insertions(+), 122 deletions(-) create mode 100644 .github/workflows/build-pr.yml create mode 100644 .github/workflows/publish-doxygen.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml new file mode 100644 index 0000000..b070021 --- /dev/null +++ b/.github/workflows/build-pr.yml @@ -0,0 +1,76 @@ +name: Build Tests + +on: + pull_request: + branches: + - main + +jobs: + build_tests: + name: Test ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + include: + - os: ubuntu-latest + name: linux + testExe: build/sst-filters-tests + - os: macos-latest + name: mac + testExe: build/sst-filters-tests + - os: windows-latest + name: win + testExe: build/Release/sst-filters-tests.exe + + steps: + + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Build Smoke test + run: | + cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release -DSST_FILTERS_BUILD_TESTS=TRUE -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" + cmake --build ./build --config Release + + - name: Run Smoke Test + run: | + ls ${{ matrix.testExe }} + ${{ matrix.testExe }} + + build_examples: + name: Examples ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + include: + - os: ubuntu-latest + name: linux + testExe: build/sst-filters-tests + - os: macos-latest + name: mac + testExe: build/sst-filters-tests + - os: windows-latest + name: win + testExe: build/Release/sst-filters-tests.exe + + steps: + + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Prepare for JUCE + uses: surge-synthesizer/sst-githubactions/prepare-for-juce@main + with: + os: ${{ runner.os }} + + - name: Build Examples + run: | + cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DSST_FILTERS_BUILD_EXAMPLES=ON + cmake --build build --config Debug --target filter_plot_tool + cmake --build build --config Debug --target FiltersPlugin_VST3 diff --git a/.github/workflows/publish-doxygen.yml b/.github/workflows/publish-doxygen.yml new file mode 100644 index 0000000..2656079 --- /dev/null +++ b/.github/workflows/publish-doxygen.yml @@ -0,0 +1,19 @@ +name: Publish Doxygen + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + publish_doxygen: + name: Publish Doxygen + runs-on: ubuntu-latest + + steps: + - name: Publish Doxygen + uses: surge-synthesizer/sst-githubactions/publish-doxygen@main + with: + destination: ${{ github.event.repository.name }} + token: ${{ secrets.SST_DOCS_ACCESS_TOKEN }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 6afa0b5..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,122 +0,0 @@ -# Build dexed with JUCE buidls - -trigger: - - main - -pr: - - main - -jobs: - - - job: Test - condition: eq(variables['Build.Reason'], 'PullRequest') - strategy: - matrix: - mac: - imageName: 'macos-latest' - isMac: True - win: - imageName: 'windows-2019' - isWindows: True - lin: - imageName: 'ubuntu-20.04' - isLinux: True - - pool: - vmImage: $(imageName) - - steps: - - checkout: self - fetchDepth: 1 - - - bash: | - cmake -Bbuild -DCMAKE_BUILD_TYPE=Release - cmake --build build --config Release - ./build/test-binary/sst-filters-tests - displayName: Run tests with cmake - - - job: Examples - condition: eq(variables['Build.Reason'], 'PullRequest') - strategy: - matrix: - mac: - imageName: 'macos-latest' - isMac: True - win: - imageName: 'windows-2019' - isWindows: True - lin: - imageName: 'ubuntu-20.04' - isLinux: True - - pool: - vmImage: $(imageName) - - steps: - - checkout: self - fetchDepth: 1 - - - bash: | - sudo apt-get update - sudo apt install ninja-build libasound2-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev libfreetype6-dev libglu1-mesa-dev libjack-jackd2-dev - condition: variables.isLinux - displayName: Install Linux dependencies - - - bash: cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DSST_FILTERS_BUILD_EXAMPLES=ON - displayName: Run cmake configure - - - bash: cmake --build build --config Release --target filter_plot_tool - displayName: Build filter_plot_tool - - - bash: cmake --build build --config Release --target FiltersPlugin_VST3 - displayName: Build filters_example_plugin - - - - job: MacARM - condition: eq(variables['Build.Reason'], 'PullRequest') - pool: - vmImage: 'macos-latest' - - steps: - - checkout: self - fetchDepth: 1 - - - bash: cmake -Bbuild -GXcode -DSST_FILTERS_BUILD_TESTS=ON -D\"CMAKE_OSX_ARCHITECTURES=arm64\" - displayName: Run cmake configure - - - bash: cmake --build build --config Debug --parallel --target sst-filters-tests | xcpretty - displayName: Build tests - - - job: Doxygenate - condition: not(eq(variables['Build.Reason'], 'PullRequest')) - pool: - vmImage: 'ubuntu-20.04' - steps: - - checkout: self - fetchDepth: 1 - - - task: DownloadSecureFile@1 - inputs: - secureFile: sru-token.txt - - - bash: | - sudo apt-get install doxygen graphviz - doxygen doxygen/Doxyfile - - HASH=`git rev-parse --short HEAD` - TOK=`cat $AGENT_TEMPDIRECTORY/sru-token.txt` - git clone https://surge-rackupdater:${TOK}@github.com/surge-synthesizer/sst-docs - git config --global user.email "surge-rackupdater@dev.null" - git config --global user.name "surge-rackupdater" - - mkdir -p sst-docs/docs/sst-filters - pushd doxy-out - tar cf - . | (cd ../sst-docs/docs/sst-filters && tar xf -) - popd - pushd sst-docs - git add docs - git status - git commit -m "Update sst-filters docs at ${HASH}" - git push origin main - - displayName: "Make Doxygen and Commit it" From 2186a613d6764a81fd80cbe215019ce33d9c7eb1 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sun, 28 Jul 2024 22:37:29 -0400 Subject: [PATCH 2/7] f --- tests/BiquadTest.cpp | 13 ++++++------- tests/HalfRateTest.cpp | 41 +++++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/tests/BiquadTest.cpp b/tests/BiquadTest.cpp index 5766674..882c205 100644 --- a/tests/BiquadTest.cpp +++ b/tests/BiquadTest.cpp @@ -4,10 +4,9 @@ struct TP { - }; -TEST_CASE( "Simple Biquad" ) +TEST_CASE("Simple Biquad") { using bqt = sst::filters::Biquad::BiquadFilter; @@ -16,14 +15,14 @@ TEST_CASE( "Simple Biquad" ) bq.coeff_LP(0.6, 0.01); - float x alignas(16) [32]; - float y alignas(16) [32]; + float x alignas(16)[32]; + float y alignas(16)[32]; // a square wave through an LP will get attenuated float phase = 0; float dphase = 1.0 / 79.4; - for (int i=0; i<50; ++i) + for (int i = 0; i < 50; ++i) { - for (int j=0; j<32; ++j) + for (int j = 0; j < 32; ++j) { x[j] = phase > 0.5 ? 1 : -1; phase += dphase; @@ -31,7 +30,7 @@ TEST_CASE( "Simple Biquad" ) phase -= 1; } bq.process_block_to(x, y); - for (int j=0; j<32; ++j) + for (int j = 0; j < 32; ++j) { // bounded REQUIRE(abs(x[j]) >= abs(y[j])); diff --git a/tests/HalfRateTest.cpp b/tests/HalfRateTest.cpp index 73eab24..984f5dd 100644 --- a/tests/HalfRateTest.cpp +++ b/tests/HalfRateTest.cpp @@ -2,10 +2,10 @@ #include "TestUtils.h" -template +template std::array upDown(int M, bool steep, const std::function &gen) { - static constexpr int BSUP=BS << 1; + static constexpr int BSUP = BS << 1; static constexpr int nblocks = 256; float L alignas(16)[BSUP], R alignas(16)[BSUP]; float Lu alignas(16)[BSUP], Ru alignas(16)[BSUP]; @@ -19,14 +19,15 @@ std::array upDown(int M, bool steep, const std::function 1) phase -= 1; + while (phase > 1) + phase -= 1; L[s] = gen(phase); R[s] = gen(phase); @@ -71,7 +72,7 @@ std::array upDown(int M, bool steep, const std::function upDown(int M, bool steep, const std::function Date: Sun, 28 Jul 2024 22:38:58 -0400 Subject: [PATCH 3/7] f --- include/sst/filters/CytomicSVF.h | 4 ++-- tests/TestUtils.h | 38 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/sst/filters/CytomicSVF.h b/include/sst/filters/CytomicSVF.h index 92d552e..4593734 100644 --- a/include/sst/filters/CytomicSVF.h +++ b/include/sst/filters/CytomicSVF.h @@ -192,8 +192,8 @@ struct CytomicSVF break; } } - - void fetchCoeffs(const CytomicSVF& that) //TODO: Block smoothed version + + void fetchCoeffs(const CytomicSVF &that) // TODO: Block smoothed version { g = that.g; k = that.k; diff --git a/tests/TestUtils.h b/tests/TestUtils.h index 48f5f5d..477a73b 100644 --- a/tests/TestUtils.h +++ b/tests/TestUtils.h @@ -21,11 +21,13 @@ constexpr auto sampleRate = 48000.0f; constexpr int blockSize = 2048; constexpr int numTestFreqs = 5; -constexpr std::array testFreqs { 80.0f, 200.0f, 440.0f, 1000.0f, 10000.0f }; +constexpr std::array testFreqs{80.0f, 200.0f, 440.0f, 1000.0f, 10000.0f}; -inline float runSine(sst::filters::QuadFilterUnitState &filterState, sst::filters::FilterUnitQFPtr &filterUnitPtr, float testFreq, int numSamples) { +inline float runSine(sst::filters::QuadFilterUnitState &filterState, + sst::filters::FilterUnitQFPtr &filterUnitPtr, float testFreq, int numSamples) +{ // reset filter state - std::fill (filterState.R, &filterState.R[sst::filters::n_filter_registers], _mm_setzero_ps()); + std::fill(filterState.R, &filterState.R[sst::filters::n_filter_registers], _mm_setzero_ps()); std::vector y(numSamples, 0.0f); for (int i = 0; i < numSamples; ++i) @@ -35,13 +37,13 @@ inline float runSine(sst::filters::QuadFilterUnitState &filterState, sst::filter auto yVec = filterUnitPtr(&filterState, _mm_set_ps1(x)); float yArr alignas(16)[4]; - _mm_store_ps (yArr, yVec); + _mm_store_ps(yArr, yVec); y[i] = yArr[0]; } auto squareSum = std::inner_product(y.begin(), y.end(), y.begin(), 0.0f); - auto rms = std::sqrt(squareSum / (float) numSamples); - return 20.0f * std::log10 (rms); + auto rms = std::sqrt(squareSum / (float)numSamples); + return 20.0f * std::log10(rms); }; using RMSSet = std::array; @@ -54,16 +56,18 @@ struct TestConfig float resonance = 0.5f; }; -static float delayBufferData[4][utilities::MAX_FB_COMB + utilities::SincTable::FIRipol_N] {}; +static float delayBufferData[4][utilities::MAX_FB_COMB + utilities::SincTable::FIRipol_N]{}; -inline void runTest(const TestConfig& testConfig) +inline void runTest(const TestConfig &testConfig) { auto filterState = sst::filters::QuadFilterUnitState{}; for (int i = 0; i < 4; ++i) { - std::fill (delayBufferData[i], delayBufferData[i] + utilities::MAX_FB_COMB + utilities::SincTable::FIRipol_N, 0.0f); + std::fill(delayBufferData[i], + delayBufferData[i] + utilities::MAX_FB_COMB + utilities::SincTable::FIRipol_N, + 0.0f); filterState.DB[i] = delayBufferData[i]; - filterState.active[i] = (int) 0xffffffff; + filterState.active[i] = (int)0xffffffff; filterState.WP[i] = 0; } @@ -71,20 +75,16 @@ inline void runTest(const TestConfig& testConfig) sst::filters::FilterCoefficientMaker coefMaker; coefMaker.setSampleRateAndBlockSize(sampleRate, blockSize); - coefMaker.MakeCoeffs(testConfig.cutoffFreq, - testConfig.resonance, - testConfig.type, - testConfig.subType, - nullptr, - false); + coefMaker.MakeCoeffs(testConfig.cutoffFreq, testConfig.resonance, testConfig.type, + testConfig.subType, nullptr, false); coefMaker.updateState(filterState); - std::array actualRMSs {}; + std::array actualRMSs{}; for (int i = 0; i < numTestFreqs; ++i) { auto rmsDB = runSine(filterState, filterUnitPtr, testFreqs[i], blockSize); - if constexpr (! printRMSs) + if constexpr (!printRMSs) REQUIRE(rmsDB == Approx(testConfig.expRmsDBs[i]).margin(1.0e-2f)); actualRMSs[i] = rmsDB; @@ -99,6 +99,6 @@ inline void runTest(const TestConfig& testConfig) std::cout << "}" << std::endl; } }; -} +} // namespace TestUtils #endif // TESTS_TESTUTILS_H From e3f2d5b8154ed4c086c07db3555374a84927fdc8 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sun, 28 Jul 2024 22:39:55 -0400 Subject: [PATCH 4/7] f --- .github/workflows/build-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index b070021..e5c8aba 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -1,4 +1,4 @@ -name: Build Tests +name: Tests and Examples on: pull_request: From 35a68b584630fbde67e176fe5f0f1a4b321340e2 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sun, 28 Jul 2024 22:41:30 -0400 Subject: [PATCH 5/7] tests loc --- .github/workflows/build-pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index e5c8aba..d8c4f95 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -15,13 +15,13 @@ jobs: include: - os: ubuntu-latest name: linux - testExe: build/sst-filters-tests + testExe: build/tests/sst-filters-tests - os: macos-latest name: mac - testExe: build/sst-filters-tests + testExe: build/tests/sst-filters-tests - os: windows-latest name: win - testExe: build/Release/sst-filters-tests.exe + testExe: build/tests/Release/sst-filters-tests.exe steps: From f8ca0865ea58e2221056c1741eb5dfda6524525b Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sun, 28 Jul 2024 22:42:08 -0400 Subject: [PATCH 6/7] gcc --- .github/workflows/build-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index d8c4f95..70723c9 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -68,6 +68,7 @@ jobs: uses: surge-synthesizer/sst-githubactions/prepare-for-juce@main with: os: ${{ runner.os }} + gccversion: 9 - name: Build Examples run: | From 339ca03ca6420f39840b8d73e3b807cc7e07d3a4 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sun, 28 Jul 2024 22:47:08 -0400 Subject: [PATCH 7/7] examples-later --- .github/workflows/build-pr.yml | 38 +--------------------------------- examples/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 70723c9..17b87fb 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -1,4 +1,4 @@ -name: Tests and Examples +name: Test Runner on: pull_request: @@ -39,39 +39,3 @@ jobs: run: | ls ${{ matrix.testExe }} ${{ matrix.testExe }} - - build_examples: - name: Examples ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - include: - - os: ubuntu-latest - name: linux - testExe: build/sst-filters-tests - - os: macos-latest - name: mac - testExe: build/sst-filters-tests - - os: windows-latest - name: win - testExe: build/Release/sst-filters-tests.exe - - steps: - - - name: Checkout code - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Prepare for JUCE - uses: surge-synthesizer/sst-githubactions/prepare-for-juce@main - with: - os: ${{ runner.os }} - gccversion: 9 - - - name: Build Examples - run: | - cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DSST_FILTERS_BUILD_EXAMPLES=ON - cmake --build build --config Debug --target filter_plot_tool - cmake --build build --config Debug --target FiltersPlugin_VST3 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 919be7a..3aabb02 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,7 +1,7 @@ message(STATUS "Configuring sst-filters examples...") # The examples need JUCE -CPMAddPackage("gh:juce-framework/JUCE#6.1.5") +CPMAddPackage("gh:juce-framework/JUCE#7.0.12") add_subdirectory(filter_plot_tool) add_subdirectory(filters_example_plugin)