diff options
author | David Robillard <d@drobilla.net> | 2014-01-05 23:25:28 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-01-05 23:25:28 +0000 |
commit | cc0feac524685bbdaac4d49dd89f745a78099d5b (patch) | |
tree | 2bcebd85b83df2f2de7f34296bd0ebbd1fa4d7ff /src | |
parent | 39ed72e3795ffeb0e8ca7192fa30fafca412850a (diff) | |
download | blop.lv2-cc0feac524685bbdaac4d49dd89f745a78099d5b.tar.gz blop.lv2-cc0feac524685bbdaac4d49dd89f745a78099d5b.tar.bz2 blop.lv2-cc0feac524685bbdaac4d49dd89f745a78099d5b.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/include/vector_op.h | 10 |
1 files 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; \ } |