| 41 | kout[] op kin[] |
| 42 | */ |
| 43 | template <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[] |
nothing calls this directly
no outgoing calls
no test coverage detected