From f3a9cf95906e785e04469dcdd3b740bc4adf2651 Mon Sep 17 00:00:00 2001 From: Randy Jones Date: Tue, 21 Nov 2023 14:15:17 -0800 Subject: [PATCH] Add processArrays() for Bank<> --- Tests/textTest.cpp | 1 - source/DSP/MLDSPFunctional.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Tests/textTest.cpp b/Tests/textTest.cpp index 48dbb4fc..08c15e41 100644 --- a/Tests/textTest.cpp +++ b/Tests/textTest.cpp @@ -67,4 +67,3 @@ TEST_CASE("madronalib/core/text", "[text]") REQUIRE(textUtils::stripExtension(footxt) == "foo"); REQUIRE(textUtils::getExtension(footxt) == "txt"); } - diff --git a/source/DSP/MLDSPFunctional.h b/source/DSP/MLDSPFunctional.h index 2dc92760..64e4f733 100644 --- a/source/DSP/MLDSPFunctional.h +++ b/source/DSP/MLDSPFunctional.h @@ -339,6 +339,18 @@ class Bank return output; } + // process: each processor gets arguments by calling the subscript operator on the input args. + template + inline DSPVectorArray processArrays(Args... args) + { + DSPVectorArray output; + for (int i = 0; i < ROWS; ++i) + { + output.row(i) = _processors[i](args[i]...); + } + return output; + } + inline void clear() { for (int i = 0; i < ROWS; ++i)