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

Class ArrayOp4

Opcodes/arrayops.cpp:119–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117 */
118template <MYFLT (*trop)(MYFLT, MYFLT, MYFLT)>
119struct ArrayOp4 : csnd::Plugin<1, 3> {
120
121 int process(csnd::myfltvec &out, csnd::myfltvec &in, MYFLT v1, MYFLT v2) {
122 for (MYFLT *s = in.begin(), *o = out.begin(); s != in.end(); s++, o++)
123 *o = trop(*s, v1, v2);
124 return OK;
125 }
126
127 int init() {
128 csnd::myfltvec &out = outargs.myfltvec_data(0);
129 csnd::myfltvec &in = inargs.myfltvec_data(0);
130 out.init(csound, in.len());
131 if(!is_perf()) process(out, in, inargs[1], inargs[2]);
132 return OK;
133 }
134
135 int kperf() {
136 return process(outargs.myfltvec_data(0), inargs.myfltvec_data(0), inargs[1],
137 inargs[2]);
138 }
139};
140
141/** k-rate operator
142 kout[] sort[a,d] kin[]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected