MCPcopy Create free account
hub / github.com/csound/csound / ArrayOp3

Class ArrayOp3

Opcodes/arrayops.cpp:93–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91 kout[] op kin1[], kin2
92 */
93template <MYFLT (*bop)(MYFLT, MYFLT)> struct ArrayOp3 : csnd::Plugin<1, 2> {
94
95 int process(csnd::myfltvec &out, csnd::myfltvec &in, MYFLT v) {
96 for (MYFLT *s = in.begin(), *o = out.begin(); s != in.end(); s++, o++)
97 *o = bop(*s, v);
98 return OK;
99 }
100
101 int init() {
102 csnd::myfltvec &out = outargs.myfltvec_data(0);
103 csnd::myfltvec &in = inargs.myfltvec_data(0);
104 out.init(csound, in.len());
105 if (!is_perf()) process(out, in, inargs[1]);
106 return OK;
107 }
108
109 int kperf() {
110 return process(outargs.myfltvec_data(0), inargs.myfltvec_data(0),
111 inargs[1]);
112 }
113};
114
115/** k-rate binary operator with array and two scalar
116 kout[] op kin1[], kin2, kin3

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected