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

Method init

Opcodes/trigEnvSegs.cpp:121–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119struct TrigExpseg : csnd::Plugin<1, 64>
120{
121 int init()
122 {
123 uint32_t argCnt = 1;
124 samplingRate = csound->sr();
125 playEnv = 0;
126 counter = 0;
127 outargs[0] = inargs[1];
128 segment = 0;
129 outValue = inargs[1];
130
131 while (argCnt < in_count())
132 {
133 if (argCnt % 2 == 0)
134 durations.push_back (inargs[argCnt]*samplingRate);
135 else
136 {
137 if (inargs[argCnt] <= 0.0)
138 {
139 csound->message ("iVal is 0");
140 return NOTOK;
141 }
142
143 values.push_back (inargs[argCnt]);
144 }
145
146 argCnt++;
147 }
148
149 incr = pow (values[1] / values[0], 1 / (durations[0]));
150
151 return OK;
152 }
153
154 int kperf()
155 {

Callers

nothing calls this directly

Calls 2

srMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected