From cc0feac524685bbdaac4d49dd89f745a78099d5b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 5 Jan 2014 23:25:28 +0000 Subject: Fix VECTOR_OP to actually apply operator, and not always *. git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/blop.lv2@5283 a436a847-0d15-0410-975c-d299462d15a1 --- src/include/vector_op.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/vector_op.h b/src/include/vector_op.h index f8ea8dd..f261ff8 100644 --- a/src/include/vector_op.h +++ b/src/include/vector_op.h @@ -1,6 +1,6 @@ /* Apply a C arithmetical operator to two sample buffers. - Copyright 2012 David Robillard + Copyright 2012-2014 David Robillard This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,21 +22,21 @@ #define VECTOR_OP(op, output, input1, input1_is_cv, input2, input2_is_cv) \ switch ((input1_is_cv << 1) + input2_is_cv) { \ case 0: /* 00 (control * control) */ \ - output[0] = input1[0] * input2[0]; \ + output[0] = input1[0] op input2[0]; \ break; \ case 1: /* 01 (control * cv) */ \ for (uint32_t s = 0; s < sample_count; ++s) { \ - output[s] = input1[0] * input2[s]; \ + output[s] = input1[0] op input2[s]; \ } \ break; \ case 2: /* 10 (cv * control) */ \ for (uint32_t s = 0; s < sample_count; ++s) { \ - output[s] = input1[s] * input2[0]; \ + output[s] = input1[s] op input2[0]; \ } \ break; \ case 3: /* 11 (cv * cv) */ \ for (uint32_t s = 0; s < sample_count; ++s) { \ - output[s] = input1[s] * input2[s]; \ + output[s] = input1[s] op input2[s]; \ } \ break; \ } -- cgit v1.2.1