From 6bd74114c720c8a806f0e0c9f76029ed50af199d Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 15 Aug 2022 17:28:54 +0200 Subject: [PATCH 1/7] add befaco light permission --- docs/LICENSE-PERMISSIONS.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/LICENSE-PERMISSIONS.md b/docs/LICENSE-PERMISSIONS.md index 3ae4519..7cea36b 100644 --- a/docs/LICENSE-PERMISSIONS.md +++ b/docs/LICENSE-PERMISSIONS.md @@ -55,6 +55,28 @@ Below follows a direct copy and paste of each individual request. > All the best, > Manu +### Light Panels + +*On Monday, July 25, 2022, 4:31 PM CET, Alexander Chalikiopoulos wrote:* + +> I have another panel-question for you. Filipe has been working on a (silly) feature for Cardinal that brings "real light mode" to all the panels. This is something we have been doing for "dark mode" already. This was not applicable to Befaco panels of course, since they are already dark. However now it will be possible to also flip a switch and turn all panels to "light". +> +> What we are wondering is if you are OK with us changing the panels in this way. We do not modify the source files, but this is done in real time in the rendering itself. If you have any remarks or suggestions we'll be happy to take those into consideration as well of course. +> +> A picture says more than just some words -> https://i.imgur.com/fKBhHCn.png +> +> cheers, +> Alexander + +*On Monday, August 15, 2022, 11:21 AM CET, Manu Retamuro wrote:* + +> I do not see too much trouble on this mod, for the light version! +> +> Thanks a bunch for this!! +> +> All the best, +> Manu + ## ESeries (Paul Schreiber @ SynthTech) *On Wednesday, January 19, 2022, 04:53:44 AM CST, Filipe Coelho wrote:* From 25b70b99312ca7633e09aff59591aec344bd73cb Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 18 Aug 2022 22:57:28 +0100 Subject: [PATCH 2/7] Consistent macos build flags, allow debug jucewrapper --- .github/workflows/build.yml | 4 ++-- deps/Makefile | 9 ++------- dpf | 2 +- jucewrapper/CMakeLists.txt | 24 ++++++++++++------------ 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a55067f..f979cc2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -438,7 +438,7 @@ jobs: git clone --depth=1 -b 6.1.6 https://github.com/juce-framework/JUCE.git jucewrapper/JUCE sed -i -e 's/kAudioUnitProperty_SupportsMPE/kAudioUnitProperty_ignore_SupportsMPE/' jucewrapper/JUCE/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h mkdir -p jucewrapper/build - pushd jucewrapper/build; cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.8 -DCMAKE_OSX_SYSROOT=$(xcrun --sdk macosx --show-sdk-path) -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd + pushd jucewrapper/build; cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.8 -DCMAKE_OSX_SYSROOT="macosx" -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/ - name: Build macOS intel (packaging) env: @@ -521,7 +521,7 @@ jobs: pushd deps/PawPaw; source local.env macos-universal; popd git clone --depth=1 -b 6.1.6 https://github.com/juce-framework/JUCE.git jucewrapper/JUCE mkdir -p jucewrapper/build - pushd jucewrapper/build; cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DCMAKE_OSX_SYSROOT=$(xcrun --sdk macosx --show-sdk-path) -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd + pushd jucewrapper/build; cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DCMAKE_OSX_SYSROOT="macosx" -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/ - name: Build macOS universal (packaging) env: diff --git a/deps/Makefile b/deps/Makefile index e4d1db9..28e4f39 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -120,7 +120,7 @@ ifeq ($(MACOS),true) ifneq (,$(findstring -arch$(SPACE),$(CXXFLAGS))) CMAKE += -DCMAKE_OSX_ARCHITECTURES='$(subst $(SPACE),;,$(subst -arch=,,$(filter -arch=%,$(subst -arch$(SPACE),-arch=,$(CXXFLAGS)))))' else ifeq ($(CIBUILD),true) -$(error CI build requires -march flag on macOS) +$(error CI build requires -arch flag on macOS) endif ifneq (,$(findstring -mmacosx-version-min=,$(CXXFLAGS))) export MACOSX_DEPLOYMENT_TARGET = $(subst -mmacosx-version-min=,,$(filter -mmacosx-version-min=%,$(CXXFLAGS))) @@ -128,7 +128,7 @@ CMAKE += -DCMAKE_OSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET) else ifeq ($(CIBUILD),true) $(error CI build requires -mmacosx-version-min flag on macOS) endif -CMAKE += -DCMAKE_OSX_SYSROOT=$(shell xcrun --sdk macosx --show-sdk-path) +CMAKE += -DCMAKE_OSX_SYSROOT="macosx" endif # fix emar and emranlib usage @@ -147,11 +147,6 @@ CMAKE += -DCMAKE_SYSTEM_NAME=Generic endif endif -# fix cmake forcing SDK for us -ifeq ($(MACOS),true) -CMAKE += -DCMAKE_OSX_SYSROOT="macosx" -endif - # fix cross-compilation for windows ifeq ($(WINDOWS),true) CMAKE += -G 'Unix Makefiles' diff --git a/dpf b/dpf index 923c4fb..bd92cf2 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 923c4fbca043b5a0a69226b738dbf9fac1c087f2 +Subproject commit bd92cf20616f59a6e55c6204b35a284e61e9bb12 diff --git a/jucewrapper/CMakeLists.txt b/jucewrapper/CMakeLists.txt index b9144bb..9d78d06 100644 --- a/jucewrapper/CMakeLists.txt +++ b/jucewrapper/CMakeLists.txt @@ -14,40 +14,40 @@ add_library(dgl STATIC IMPORTED) set_property(TARGET dgl PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../dpf/build/libdgl-opengl.a") add_library(carla_host_plugin STATIC IMPORTED) -set_property(TARGET carla_host_plugin PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/plugin/Release/carla-host-plugin.cpp.o") +set_property(TARGET carla_host_plugin PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/plugin/${CMAKE_BUILD_TYPE}/carla-host-plugin.cpp.o") add_library(carla_engine_plugin STATIC IMPORTED) -set_property(TARGET carla_engine_plugin PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/carla_engine_plugin.a") +set_property(TARGET carla_engine_plugin PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/carla_engine_plugin.a") add_library(carla_plugin STATIC IMPORTED) -set_property(TARGET carla_plugin PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/carla_plugin.a") +set_property(TARGET carla_plugin PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/carla_plugin.a") add_library(native_plugins STATIC IMPORTED) -set_property(TARGET native_plugins PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/native-plugins.a") +set_property(TARGET native_plugins PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/native-plugins.a") add_library(audio_decoder STATIC IMPORTED) -set_property(TARGET audio_decoder PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/audio_decoder.a") +set_property(TARGET audio_decoder PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/audio_decoder.a") add_library(jackbridge STATIC IMPORTED) -set_property(TARGET jackbridge PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/jackbridge.min.a") +set_property(TARGET jackbridge PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/jackbridge.min.a") add_library(lilv STATIC IMPORTED) -set_property(TARGET lilv PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/lilv.a") +set_property(TARGET lilv PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/lilv.a") add_library(rtmempool STATIC IMPORTED) -set_property(TARGET rtmempool PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/rtmempool.a") +set_property(TARGET rtmempool PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/rtmempool.a") add_library(sfzero STATIC IMPORTED) -set_property(TARGET sfzero PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/sfzero.a") +set_property(TARGET sfzero PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/sfzero.a") add_library(water STATIC IMPORTED) -set_property(TARGET water PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/water.a") +set_property(TARGET water PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/water.a") add_library(ysfx STATIC IMPORTED) -set_property(TARGET ysfx PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/ysfx.a") +set_property(TARGET ysfx PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/ysfx.a") add_library(zita_resampler STATIC IMPORTED) -set_property(TARGET zita_resampler PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/Release/zita-resampler.a") +set_property(TARGET zita_resampler PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../carla/build/modules/${CMAKE_BUILD_TYPE}/zita-resampler.a") add_library(sCardinal STATIC IMPORTED) set_property(TARGET sCardinal PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../bin/Cardinal.a") From 67526eb97867980c92c95f2660594a8519075f96 Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 18 Aug 2022 23:44:24 +0100 Subject: [PATCH 3/7] Fix AU crash if host does not provide time signature (x64 auval) --- jucewrapper/CardinalWrapper.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jucewrapper/CardinalWrapper.cpp b/jucewrapper/CardinalWrapper.cpp index 984f23d..a4fd7e1 100644 --- a/jucewrapper/CardinalWrapper.cpp +++ b/jucewrapper/CardinalWrapper.cpp @@ -368,6 +368,12 @@ protected: else timePosition.frame = 0; + // use 4/4 as fallback time signature if not provided by the host + if (posInfo.timeSigNumerator == 0) + posInfo.timeSigNumerator = 4; + if (posInfo.timeSigDenominator == 0) + posInfo.timeSigDenominator = 4; + timePosition.bbt.beatsPerMinute = posInfo.bpm; const double ppqPos = std::abs(posInfo.ppqPosition); From c376854a96d5d10b1acfed0302e9a592e2271f87 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 19 Aug 2022 03:02:38 +0100 Subject: [PATCH 4/7] Introduce run-time self-tests (needs special build) --- .github/workflows/build.yml | 7 ++- dpf | 2 +- src/CardinalUI.cpp | 93 ++++++++++++++++++++++++++++++++++++- 3 files changed, 97 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f979cc2..e468b44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1050,15 +1050,18 @@ jobs: # build-deps sudo apt-get install -yqq liblo-dev # runtime testing - sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint valgrind + sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint valgrind xvfb - name: Build Cardinal env: CFLAGS: -g - CXXFLAGS: -g -DDPF_ABORT_ON_ERROR + CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING LDFLAGS: -static-libgcc -static-libstdc++ run: | make HEADLESS=true features make HEADLESS=true NOOPT=true NOPLUGINS=true SKIP_STRIPPING=true -j $(nproc) + - name: Run Cardinal self-tests + run: | + xvfb-run ./bin/Cardinal selftest - name: Validate LV2 ttl syntax run: | lv2_validate \ diff --git a/dpf b/dpf index bd92cf2..0280609 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit bd92cf20616f59a6e55c6204b35a284e61e9bb12 +Subproject commit 028060954a99720de194a43d8d03b6d694c66850 diff --git a/src/CardinalUI.cpp b/src/CardinalUI.cpp index 17f85ee..425975c 100644 --- a/src/CardinalUI.cpp +++ b/src/CardinalUI.cpp @@ -30,6 +30,10 @@ #include #include +#ifdef DPF_RUNTIME_TESTING +# include +#endif + #ifdef DISTRHO_OS_WASM # include # include @@ -301,7 +305,12 @@ class CardinalUI : public CardinalBaseUI, rack::math::Vec lastMousePos; WindowParameters windowParameters; int rateLimitStep = 0; + #ifdef DISTRHO_OS_WASM int8_t counterForFirstIdlePoint = 0; + #endif + #ifdef DPF_RUNTIME_TESTING + bool inSelfTest = false; + #endif struct ScopedContext { CardinalPluginContext* const context; @@ -444,11 +453,67 @@ public: void uiIdle() override { + #ifdef DPF_RUNTIME_TESTING + if (inSelfTest) + { + context->window->step(); + return; + } + + if (context->plugin->isSelfTestInstance()) + { + inSelfTest = true; + + Application& app(getApp()); + + const ScopedContext sc(this); + + context->patch->clear(); + context->window->step(); + app.idle(); + + const rack::math::Vec mousePos(getWidth()/2,getHeight()/2); + context->event->handleButton(mousePos, GLFW_MOUSE_BUTTON_LEFT, GLFW_RELEASE, 0x0); + context->event->handleHover(mousePos, rack::math::Vec(0,0)); + context->window->step(); + app.idle(); + + for (rack::plugin::Plugin* p : rack::plugin::plugins) + { + for (rack::plugin::Model* m : p->models) + { + rack::engine::Module* const module = m->createModule(); + DISTRHO_SAFE_ASSERT_CONTINUE(module != nullptr); + + rack::CardinalPluginModelHelper* const helper = dynamic_cast(m); + DISTRHO_SAFE_ASSERT_CONTINUE(helper != nullptr); + + rack::app::ModuleWidget* const moduleWidget = helper->createModuleWidget(module); + DISTRHO_SAFE_ASSERT_CONTINUE(moduleWidget != nullptr); + + context->engine->addModule(module); + context->scene->rack->addModuleAtMouse(moduleWidget); + + for (int i=5; --i>=0;) + app.idle(); + + context->scene->rack->removeModule(moduleWidget); + context->engine->removeModule(module); + context->window->step(); + delete module; + app.idle(); + } + } + + inSelfTest = false; + } + #endif + + #ifdef DISTRHO_OS_WASM if (counterForFirstIdlePoint >= 0 && ++counterForFirstIdlePoint == 30) { counterForFirstIdlePoint = -1; - #ifdef DISTRHO_OS_WASM if (rack::patchStorageSlug != nullptr) { std::string url("/patchstorage.php?slug="); @@ -469,8 +534,8 @@ public: emscripten_async_wget(url.c_str(), context->patch->templatePath.c_str(), downloadRemotePatchSucceeded, downloadRemotePatchFailed); } - #endif } + #endif if (filebrowserhandle != nullptr && fileBrowserIdle(filebrowserhandle)) { @@ -715,6 +780,10 @@ protected: bool onMouse(const MouseEvent& ev) override { + #ifdef DPF_RUNTIME_TESTING + if (inSelfTest) return false; + #endif + if (ev.press) getWindow().focus(); @@ -752,6 +821,10 @@ protected: bool onMotion(const MotionEvent& ev) override { + #ifdef DPF_RUNTIME_TESTING + if (inSelfTest) return false; + #endif + const rack::math::Vec mousePos = rack::math::Vec(ev.pos.getX(), ev.pos.getY()).div(getScaleFactor()).round(); const rack::math::Vec mouseDelta = mousePos.minus(lastMousePos); @@ -763,6 +836,10 @@ protected: bool onScroll(const ScrollEvent& ev) override { + #ifdef DPF_RUNTIME_TESTING + if (inSelfTest) return false; + #endif + rack::math::Vec scrollDelta = rack::math::Vec(ev.delta.getX(), ev.delta.getY()); #ifndef DISTRHO_OS_MAC scrollDelta = scrollDelta.mult(50.0); @@ -775,6 +852,10 @@ protected: bool onCharacterInput(const CharacterInputEvent& ev) override { + #ifdef DPF_RUNTIME_TESTING + if (inSelfTest) return false; + #endif + if (ev.character < ' ' || ev.character >= kKeyDelete) return false; @@ -785,6 +866,10 @@ protected: bool onKeyboard(const KeyboardEvent& ev) override { + #ifdef DPF_RUNTIME_TESTING + if (inSelfTest) return false; + #endif + const int action = ev.press ? GLFW_PRESS : GLFW_RELEASE; const int mods = glfwMods(ev.mod); @@ -880,6 +965,10 @@ protected: void uiFocus(const bool focus, CrossingMode) override { + #ifdef DPF_RUNTIME_TESTING + if (inSelfTest) return; + #endif + if (!focus) { const ScopedContext sc(this, 0); From 9d121a1e0366957e3ea516da032befca8e7fc496 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 19 Aug 2022 04:27:23 +0100 Subject: [PATCH 5/7] Update bidoo, adds encore module --- plugins/Bidoo | 2 +- plugins/plugins.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Bidoo b/plugins/Bidoo index 7579f13..5d2f572 160000 --- a/plugins/Bidoo +++ b/plugins/Bidoo @@ -1 +1 @@ -Subproject commit 7579f13bffc11548c857393408f3c2e030ee2483 +Subproject commit 5d2f5721e2701f747d0410fc407e6b1e782f16dc diff --git a/plugins/plugins.cpp b/plugins/plugins.cpp index 9653f4d..f783375 100644 --- a/plugins/plugins.cpp +++ b/plugins/plugins.cpp @@ -1388,6 +1388,8 @@ static void initStatic__Bidoo() p->addModel(modelBORDL); p->addModel(modelZOUMAI); p->addModel(modelZOUMAIExpander); + p->addModel(modelENCORE); + p->addModel(modelENCOREExpander); p->addModel(modelMU); p->addModel(modelCHUTE); p->addModel(modelLOURDE); From 392aafe17ba707f6c2ef0a6f444aa5796071b4cb Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 19 Aug 2022 04:28:04 +0100 Subject: [PATCH 6/7] Tweak helpers.hpp to more easily find misbehaving module widgets --- include/helpers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/helpers.hpp b/include/helpers.hpp index 2a30f1a..7126f3f 100644 --- a/include/helpers.hpp +++ b/include/helpers.hpp @@ -68,7 +68,7 @@ struct CardinalPluginModel : CardinalPluginModelHelper tm = dynamic_cast(m); } app::ModuleWidget* const tmw = new TModuleWidget(tm); - DISTRHO_SAFE_ASSERT_RETURN(tmw->module == m, nullptr); + DISTRHO_CUSTOM_SAFE_ASSERT_RETURN(m != nullptr ? m->model->name.c_str() : "null", tmw->module == m, nullptr); tmw->setModel(this); return tmw; } From 1746e4b7efc32aeab9c5e3520248d7ad1a987c87 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 19 Aug 2022 04:30:55 +0100 Subject: [PATCH 7/7] Fix runtime checks from dpf Signed-off-by: falkTX --- dpf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpf b/dpf index 0280609..71b1797 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 028060954a99720de194a43d8d03b6d694c66850 +Subproject commit 71b17971f63dc9def67faea500dcbaced979efb4