From 54394928309de38edf6832404fafa11f6b2d0f3b Mon Sep 17 00:00:00 2001 From: Peter Allwin Date: Wed, 28 Oct 2020 21:48:58 +0100 Subject: [PATCH] Disabling sub-voice processing on minilogue-xd and nutekt-digital to reduce issues with high cpu load --- .vscode/c_cpp_properties.json | 3 ++- Makefile | 2 +- junologue-chorus.cpp | 18 +++++++++++------- junologue-chorus.mk | 7 +++++-- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 089c912..634cbc9 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -14,7 +14,8 @@ "DARM_MATH_CM4", "__FPU_PRESENT", "_USE_MATH_DEFINES", - "uint32_t=unsigned long int" + "uint32_t=unsigned long int", + "SUB_ENABLED=true" ], "compilerPath": "${workspaceFolder}/logue-sdk/tools/gcc/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gcc", "cStandard": "c11", diff --git a/Makefile b/Makefile index 5ef4b3e..5fb86be 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ TOPTARGETS := all PLATFORMS := prologue minilogue-xd nutekt-digital -VERSION=1.2-0 +VERSION=1.2-1 PACKAGE = junologue-chorus-$(VERSION).zip $(TOPTARGETS): $(PLATFORMS) package diff --git a/junologue-chorus.cpp b/junologue-chorus.cpp index e2e1384..8f0bd62 100644 --- a/junologue-chorus.cpp +++ b/junologue-chorus.cpp @@ -155,7 +155,9 @@ void MODFX_PROCESS(const float *main_xn, float *main_yn, while(main_output != main_output_end) { main_delay.write(main_pre_lpf.process_fo(SoftLimit(f32pair_reduce(*main_input)))); - sub_delay.write(sub_pre_lpf.process_fo(SoftLimit(f32pair_reduce(*sub_input)))); + if(SUB_ENABLED) { + sub_delay.write(sub_pre_lpf.process_fo(SoftLimit(f32pair_reduce(*sub_input)))); + } lfo_1.cycle(); lfo_2.cycle(); @@ -170,13 +172,15 @@ void MODFX_PROCESS(const float *main_xn, float *main_yn, f32pair_mulscal(*main_input++, dry_gain), f32pair_mulscal(f32pair_process_fo(main_post_lpf_l, main_post_lpf_r, main), wet_gain)); - const auto sub = f32pair_add( - f32pair_mulscal(readDelays(sub_delay, lfo_val1), delay_gain.a), - f32pair_mulscal(readDelays(sub_delay, lfo_val2), delay_gain.b)); + if(SUB_ENABLED) { + const auto sub = f32pair_add( + f32pair_mulscal(readDelays(sub_delay, lfo_val1), delay_gain.a), + f32pair_mulscal(readDelays(sub_delay, lfo_val2), delay_gain.b)); - *sub_output++ = f32pair_add( - f32pair_mulscal(*sub_input++, dry_gain), - f32pair_mulscal(f32pair_process_fo(sub_post_lpf_l, sub_post_lpf_r, sub), wet_gain)); + *sub_output++ = f32pair_add( + f32pair_mulscal(*sub_input++, dry_gain), + f32pair_mulscal(f32pair_process_fo(sub_post_lpf_l, sub_post_lpf_r, sub), wet_gain)); + } } } diff --git a/junologue-chorus.mk b/junologue-chorus.mk index 2909a88..63bd68a 100644 --- a/junologue-chorus.mk +++ b/junologue-chorus.mk @@ -29,14 +29,17 @@ CMSISDIR = $(EXTDIR)/CMSIS/CMSIS ifeq ($(PLATFORM), prologue) PKGSUFFIX = prlgunit + SUB_ENABLED = true endif ifeq ($(PLATFORM), minilogue-xd) PKGSUFFIX = mnlgxdunit + SUB_ENABLED = false endif ifeq ($(PLATFORM), nutekt-digital) PKGSUFFIX = ntkdigunit + SUB_ENABLED = false endif # ############################################################################# @@ -82,10 +85,10 @@ LDSCRIPT = $(LDDIR)/usermodfx.ld DLIBS = -lm DADEFS = -DSTM32F446xE -DCORTEX_USE_FPU=TRUE -DARM_MATH_CM4 -DDEFS = -DSTM32F446xE -DCORTEX_USE_FPU=TRUE -DARM_MATH_CM4 -D__FPU_PRESENT +DDEFS = -DSTM32F446xE -DCORTEX_USE_FPU=TRUE -DARM_MATH_CM4 -D__FPU_PRESENT -DSUB_ENABLED=$(SUB_ENABLED) COPT = -std=c11 -mstructure-size-boundary=8 -CXXOPT = -std=c++14 -fno-rtti -fno-exceptions -fno-non-call-exceptions -funroll-loops +CXXOPT = -std=c++14 -fno-rtti -fno-exceptions -fno-non-call-exceptions -funroll-loops -ffast-math LDOPT = -Xlinker --just-symbols=$(LDDIR)/main_api.syms