From 11569378abe23d464322f75812de4811e7e48948 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 13 Apr 2020 01:15:53 +0200 Subject: [PATCH 1/3] Fix the arm64 test CI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6753d573..83722930 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ jobs: script: .travis/script_test.sh - name: "Linux arm64 tests" - arch: amd64 + arch: arm64 addons: apt: packages: From 5bd80b4834ebfb18f45090db57ce0ea18615566f Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 13 Apr 2020 02:08:35 +0200 Subject: [PATCH 2/3] Try alternative curve formula --- src/sfizz/Curve.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sfizz/Curve.cpp b/src/sfizz/Curve.cpp index b29fbf15..9ad56959 100644 --- a/src/sfizz/Curve.cpp +++ b/src/sfizz/Curve.cpp @@ -79,20 +79,20 @@ Curve Curve::buildPredefinedCurve(int index) break; case 4: for (unsigned i = 0; i < NumValues; ++i) { - double x = i * (1.0 / (NumValues - 1)); + double x = i / static_cast(NumValues - 1); curve._points[i] = x * x; } break; case 5: for (unsigned i = 0; i < NumValues; ++i) { - double x = i * (1.0 / (NumValues - 1)); - curve._points[i] = std::pow(x, 0.5); + double x = i / static_cast(NumValues - 1); + curve._points[i] = std::sqrt(x); } break; case 6: for (unsigned i = 0; i < NumValues; ++i) { - double x = i * (1.0 / (NumValues - 1)); - curve._points[i] = std::pow(1.0 - x, 0.5); + double x = i / static_cast(NumValues - 1); + curve._points[i] = std::sqrt(1.0 - x); } break; } From 12e9cf88962c9cd68d2b80164ce370b725636031 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 13 Apr 2020 02:18:20 +0200 Subject: [PATCH 3/3] Ensure the extreme values of xfade curves are exact --- src/sfizz/Curve.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sfizz/Curve.cpp b/src/sfizz/Curve.cpp index 9ad56959..44aa3c24 100644 --- a/src/sfizz/Curve.cpp +++ b/src/sfizz/Curve.cpp @@ -84,13 +84,17 @@ Curve Curve::buildPredefinedCurve(int index) } break; case 5: - for (unsigned i = 0; i < NumValues; ++i) { + curve._points[0] = 0.0; + curve._points[NumValues - 1] = 1.0; + for (unsigned i = 1; i < NumValues - 1; ++i) { double x = i / static_cast(NumValues - 1); curve._points[i] = std::sqrt(x); } break; case 6: - for (unsigned i = 0; i < NumValues; ++i) { + curve._points[0] = 1.0; + curve._points[NumValues - 1] = 0.0; + for (unsigned i = 1; i < NumValues - 1; ++i) { double x = i / static_cast(NumValues - 1); curve._points[i] = std::sqrt(1.0 - x); }