MCPcopy Create free account
hub / github.com/VCVRack/Befaco / process

Method process

src/Rampage.cpp:127–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 }
126
127 void process(const ProcessArgs& args) override {
128 int channels_in[2] = {};
129 int channels_trig[2] = {};
130 int channels[2] = {}; // the larger of in or trig (per-part)
131
132 // determine number of channels:
133
134 for (int part = 0; part < 2; part++) {
135
136 channels_in[part] = inputs[IN_A_INPUT + part].getChannels();
137 channels_trig[part] = inputs[TRIGG_A_INPUT + part].getChannels();
138 channels[part] = std::max(channels_in[part], channels_trig[part]);
139 channels[part] = std::max(1, channels[part]);
140
141 outputs[OUT_A_OUTPUT + part].setChannels(channels[part]);
142 outputs[RISING_A_OUTPUT + part].setChannels(channels[part]);
143 outputs[FALLING_A_OUTPUT + part].setChannels(channels[part]);
144 outputs[EOC_A_OUTPUT + part].setChannels(channels[part]);
145 }
146
147 // total number of active polyphony engines, accounting for both halves
148 // (channels[0] / channels[1] are the number of active engines per section)
149 const int channels_max = std::max(channels[0], channels[1]);
150
151 outputs[COMPARATOR_OUTPUT].setChannels(channels_max);
152 outputs[MIN_OUTPUT].setChannels(channels_max);
153 outputs[MAX_OUTPUT].setChannels(channels_max);
154
155 // loop over two parts of Rampage:
156 for (int part = 0; part < 2; part++) {
157
158 float_4 in[4] = {};
159 float_4 in_trig[4] = {};
160 float_4 riseCV[4] = {};
161 float_4 fallCV[4] = {};
162 float_4 cycle[4] = {};
163
164 // get parameters:
165 float minTime;
166 switch ((int) params[RANGE_A_PARAM + part].getValue()) {
167 case 0:
168 minTime = 1e-2;
169 break;
170 case 1:
171 minTime = 1e-3;
172 break;
173 default:
174 minTime = 1e-1;
175 break;
176 }
177
178 float_4 param_rise = params[RISE_A_PARAM + part].getValue() * 10.0f;
179 float_4 param_fall = params[FALL_A_PARAM + part].getValue() * 10.0f;
180 float_4 param_trig = params[TRIGG_A_PARAM + part].getValue() * 20.0f;
181 float_4 param_cycle = params[CYCLE_A_PARAM + part].getValue() * 10.0f;
182
183 for (int c = 0; c < channels[part]; c += 4) {
184 riseCV[c / 4] = param_rise;

Callers

nothing calls this directly

Calls 4

shapeDeltaFunction · 0.85
getChannelsMethod · 0.80
getValueMethod · 0.80
triggerMethod · 0.45

Tested by

no test coverage detected