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

Class ArrayOp

Opcodes/arrayops.cpp:43–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 kout[] op kin[]
42 */
43template <MYFLT (*op)(MYFLT)> struct ArrayOp : csnd::Plugin<1, 1> {
44 int process(csnd::myfltvec &out, csnd::myfltvec &in) {
45 std::transform(in.begin(), in.end(), out.begin(),
46 [](MYFLT f) { return op(f); });
47 return OK;
48 }
49
50 int init() {
51 csnd::myfltvec &out = outargs.myfltvec_data(0);
52 csnd::myfltvec &in = inargs.myfltvec_data(0);
53 out.init(csound, in.len());
54 if (!is_perf()) process(out, in);
55 return OK;
56 }
57
58 int kperf() {
59 return process(outargs.myfltvec_data(0), inargs.myfltvec_data(0));
60 }
61};
62
63/** k-rate binary operator
64 kout[] op kin1[], kin2[]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected