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

Method process

src/core/MIDI_Gate.cpp:79–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 }
78
79 void process(const ProcessArgs& args) override {
80 midi::Message msg;
81 while (midiInput.tryPop(&msg, args.frame)) {
82 processMessage(msg);
83 }
84
85 int channels = mpeMode ? 16 : 1;
86
87 for (int i = 0; i < 16; i++) {
88 for (int c = 0; c < channels; c++) {
89 bool pulse = trigPulses[i][c].process(args.sampleTime);
90 bool gate = pulse || (!trigMode && gates[i][c]);
91 float velocity = gate ? 1.f : 0.f;
92 if (velocityMode != FIXED_MODE)
93 velocity *= velocities[i][c] / 127.f;
94 outputs[GATE_OUTPUTS + i].setVoltage(velocity * 10.f, c);
95 }
96 outputs[GATE_OUTPUTS + i].setChannels(channels);
97 }
98 }
99
100 void processMessage(const midi::Message& msg) {
101 switch (msg.getStatus()) {

Callers

nothing calls this directly

Calls 3

tryPopMethod · 0.80
setVoltageMethod · 0.80
setChannelsMethod · 0.45

Tested by

no test coverage detected