Skip to content

Commit

Permalink
Add processArrays() for Bank<>
Browse files Browse the repository at this point in the history
  • Loading branch information
madronalabs committed Nov 21, 2023
1 parent 29dce13 commit f3a9cf9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion Tests/textTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ TEST_CASE("madronalib/core/text", "[text]")
REQUIRE(textUtils::stripExtension(footxt) == "foo");
REQUIRE(textUtils::getExtension(footxt) == "txt");
}

12 changes: 12 additions & 0 deletions source/DSP/MLDSPFunctional.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,18 @@ class Bank
return output;
}

// process: each processor gets arguments by calling the subscript operator on the input args.
template <typename... Args>
inline DSPVectorArray<ROWS> processArrays(Args... args)
{
DSPVectorArray<ROWS> 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)
Expand Down

0 comments on commit f3a9cf9

Please sign in to comment.