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

Method process

src/Voltio.cpp:39–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 }
38
39 void process(const ProcessArgs& args) override {
40 const int channels = std::max(1, inputs[SUM_INPUT].getChannels());
41
42 for (int c = 0; c < channels; c += 4) {
43 float_4 in = inputs[SUM_INPUT].getPolyVoltageSimd<float_4>(c);
44
45 float offset = params[RANGE_PARAM].getValue() ? -5.f : 0.f;
46 in += params[SEMITONES_PARAM].getValue() / 12.f + params[OCT_PARAM].getValue() + offset;
47
48 outputs[OUT_OUTPUT].setVoltageSimd<float_4>(in, c);
49 }
50
51 outputs[OUT_OUTPUT].setChannels(channels);
52
53 lights[PLUSMINUS5_LIGHT].setBrightness(params[RANGE_PARAM].getValue() ? 1.f : 0.f);
54 lights[ZEROTOTEN_LIGHT].setBrightness(params[RANGE_PARAM].getValue() ? 0.f : 1.f);
55 }
56
57};
58

Callers

nothing calls this directly

Calls 2

getChannelsMethod · 0.80
getValueMethod · 0.80

Tested by

no test coverage detected