From 8da120a35a0107d50cd746ab131e884efc0fb83c Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 30 May 2024 21:25:34 -0400 Subject: [PATCH] Add a mono scale-by-float block function (#104) --- include/sst/basic-blocks/mechanics/block-ops.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/sst/basic-blocks/mechanics/block-ops.h b/include/sst/basic-blocks/mechanics/block-ops.h index de94d57..ce6069f 100644 --- a/include/sst/basic-blocks/mechanics/block-ops.h +++ b/include/sst/basic-blocks/mechanics/block-ops.h @@ -146,6 +146,14 @@ inline void scale_by(const float *__restrict scale, float *__restrict targetL, } } +template inline void scale_by(const float scale, float *__restrict target) +{ + for (auto i = 0U; i < blockSize; ++i) + { + target[i] *= scale; + } +} + template inline void scale_by(const float scale, float *__restrict targetL, float *__restrict targetR) {