Skip to content

Commit

Permalink
Move to github actions (#59)
Browse files Browse the repository at this point in the history
Part of the late-july-lets-leave-azure push
  • Loading branch information
baconpaul authored Jul 29, 2024
1 parent 97839f0 commit 1e037cd
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 169 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test Runner

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/tests/sst-filters-tests
- os: macos-latest
name: mac
testExe: build/tests/sst-filters-tests
- os: windows-latest
name: win
testExe: build/tests/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 }}
19 changes: 19 additions & 0 deletions .github/workflows/publish-doxygen.yml
Original file line number Diff line number Diff line change
@@ -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 }}
122 changes: 0 additions & 122 deletions azure-pipelines.yml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions include/sst/filters/CytomicSVF.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 6 additions & 7 deletions tests/BiquadTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

struct TP
{

};

TEST_CASE( "Simple Biquad" )
TEST_CASE("Simple Biquad")
{
using bqt = sst::filters::Biquad::BiquadFilter<TP, 32>;

Expand All @@ -16,22 +15,22 @@ 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;
if (phase > 0)
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]));
Expand Down
41 changes: 23 additions & 18 deletions tests/HalfRateTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

#include "TestUtils.h"

template<int BS=32>
template <int BS = 32>
std::array<double, 3> upDown(int M, bool steep, const std::function<float(float)> &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];
Expand All @@ -19,14 +19,15 @@ std::array<double, 3> upDown(int M, bool steep, const std::function<float(float)
double avgRatioUp{0}, avgRatioDn{0};
auto hrfUp = sst::filters::HalfRate::HalfRateFilter(M, steep);
auto hrfDn = sst::filters::HalfRate::HalfRateFilter(M, steep);
for (int i=0; i<nblocks; ++i)
for (int i = 0; i < nblocks; ++i)
{
int s0 = i * BS;
for (int s=0; s<BS; ++s)
for (int s = 0; s < BS; ++s)
{
// This is just a test - doesn't have to be efficient
float phase = (s0 + s) * sri;
while(phase > 1) phase -= 1;
while (phase > 1)
phase -= 1;

L[s] = gen(phase);
R[s] = gen(phase);
Expand Down Expand Up @@ -71,7 +72,7 @@ std::array<double, 3> upDown(int M, bool steep, const std::function<float(float)
rmsDn += dL * dL + dR * dR;
}

for (int s=0; s<BS; ++s)
for (int s = 0; s < BS; ++s)
{
auto dL = Ld[s] - Lu[s * 2];
auto dR = Rd[s] - Ru[s * 2];
Expand All @@ -88,18 +89,20 @@ std::array<double, 3> upDown(int M, bool steep, const std::function<float(float)
rmsDn /= smp;
rmsSelf /= smp;

// std::cout << "AvgRatio is " << avgRatioUp / ( smp * 2 ) << " " << avgRatioDn / (smp) << std::endl;
// std::cout << "AvgRatio is " << avgRatioUp / ( smp * 2 ) << " " << avgRatioDn / (smp) <<
// std::endl;
return {rmsUp, rmsDn, rmsSelf};
};

TEST_CASE("HalfRate Filter") {
TEST_CASE("HalfRate Filter")
{

for (int order=1; order <=sst::filters::HalfRate::halfrate_max_M; ++order)
for (int order = 1; order <= sst::filters::HalfRate::halfrate_max_M; ++order)
{
for (const auto &steep : { true, false})
for (const auto &steep : {true, false})
{

DYNAMIC_SECTION( "Silence order=" << order << " steep=" << (steep? "true":"false") )
DYNAMIC_SECTION("Silence order=" << order << " steep=" << (steep ? "true" : "false"))
{
auto hrf = sst::filters::HalfRate::HalfRateFilter(order, steep);
auto res = upDown(order, steep, [](float phase) { return 0.f; });
Expand All @@ -109,7 +112,7 @@ TEST_CASE("HalfRate Filter") {
REQUIRE(res[2] == 0.0);
}

DYNAMIC_SECTION( "Naive Saw order=" << order << " steep=" << (steep? "true":"false") )
DYNAMIC_SECTION("Naive Saw order=" << order << " steep=" << (steep ? "true" : "false"))
{
auto hrf = sst::filters::HalfRate::HalfRateFilter(order, steep);
auto res = upDown(order, steep, [](float phase) { return 2 * phase - 1; });
Expand All @@ -119,21 +122,23 @@ TEST_CASE("HalfRate Filter") {
REQUIRE(res[2] < 5e-5);
}

DYNAMIC_SECTION( "Slow Sin order=" << order << " steep=" << (steep? "true":"false") )
DYNAMIC_SECTION("Slow Sin order=" << order << " steep=" << (steep ? "true" : "false"))
{
auto hrf = sst::filters::HalfRate::HalfRateFilter(order, steep);
auto res = upDown(order, steep, [](float phase) { return std::sin(2 * M_PI * phase); });
auto res =
upDown(order, steep, [](float phase) { return std::sin(2 * M_PI * phase); });

REQUIRE(res[0] < 5e-5);
REQUIRE(res[1] < 5e-5);
REQUIRE(res[2] < 5e-5);;
REQUIRE(res[2] < 5e-5);
;
}


DYNAMIC_SECTION( "Fast Sin order=" << order << " steep=" << (steep? "true":"false") )
DYNAMIC_SECTION("Fast Sin order=" << order << " steep=" << (steep ? "true" : "false"))
{
auto hrf = sst::filters::HalfRate::HalfRateFilter(order, steep);
auto res = upDown(order, steep, [](float phase) { return std::sin(10 * 2 * M_PI * phase); });
auto res = upDown(order, steep,
[](float phase) { return std::sin(10 * 2 * M_PI * phase); });

REQUIRE(res[0] < 5e-5);
REQUIRE(res[1] < 5e-5);
Expand Down
Loading

0 comments on commit 1e037cd

Please sign in to comment.