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

Method process

src/core/MIDI_CV.cpp:60–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 }
59
60 void process(const ProcessArgs& args) override {
61 midi::Message msg;
62 while (midiInput.tryPop(&msg, args.frame)) {
63 midiParser.processMessage(msg);
64 }
65
66 midiParser.processFilters(args.sampleTime);
67
68 // Set note outputs
69 outputs[PITCH_OUTPUT].setChannels(midiParser.channels);
70 outputs[GATE_OUTPUT].setChannels(midiParser.channels);
71 outputs[VELOCITY_OUTPUT].setChannels(midiParser.channels);
72 outputs[AFTERTOUCH_OUTPUT].setChannels(midiParser.channels);
73 outputs[RETRIGGER_OUTPUT].setChannels(midiParser.channels);
74 for (uint8_t c = 0; c < midiParser.channels; c++) {
75 outputs[PITCH_OUTPUT].setVoltage(midiParser.getPitchVoltage(c), c);
76 outputs[GATE_OUTPUT].setVoltage(midiParser.gates[c] ? 10.f : 0.f, c);
77 outputs[VELOCITY_OUTPUT].setVoltage(midiParser.velocities[c] / 127.f * 10.f, c);
78 outputs[AFTERTOUCH_OUTPUT].setVoltage(midiParser.aftertouches[c] / 127.f * 10.f, c);
79 outputs[RETRIGGER_OUTPUT].setVoltage(midiParser.retriggerPulses[c].isHigh() ? 10.f : 0.f, c);
80 }
81
82 // Pitch and mod wheel outputs
83 uint8_t wheelChannels = midiParser.getWheelChannels();
84 outputs[PW_OUTPUT].setChannels(wheelChannels);
85 outputs[MOD_OUTPUT].setChannels(wheelChannels);
86 for (uint8_t c = 0; c < wheelChannels; c++) {
87 outputs[PW_OUTPUT].setVoltage(midiParser.getPw(c) * 5.f, c);
88 outputs[MOD_OUTPUT].setVoltage(midiParser.getMod(c) * 10.f, c);
89 }
90
91 // Set clock and transport outputs
92 outputs[CLOCK_OUTPUT].setVoltage(midiParser.clockPulse.isHigh() ? 10.f : 0.f);
93 outputs[CLOCK_DIV_OUTPUT].setVoltage(midiParser.clockDividerPulse.isHigh() ? 10.f : 0.f);
94 outputs[START_OUTPUT].setVoltage(midiParser.startPulse.isHigh() ? 10.f : 0.f);
95 outputs[STOP_OUTPUT].setVoltage(midiParser.stopPulse.isHigh() ? 10.f : 0.f);
96 outputs[CONTINUE_OUTPUT].setVoltage(midiParser.continuePulse.isHigh() ? 10.f : 0.f);
97
98 midiParser.processPulses(args.sampleTime);
99 }
100
101 json_t* dataToJson() override {
102 json_t* rootJ = midiParser.toJson();

Callers

nothing calls this directly

Calls 11

tryPopMethod · 0.80
processFiltersMethod · 0.80
setVoltageMethod · 0.80
getPitchVoltageMethod · 0.80
getWheelChannelsMethod · 0.80
getPwMethod · 0.80
getModMethod · 0.80
processPulsesMethod · 0.80
processMessageMethod · 0.45
setChannelsMethod · 0.45
isHighMethod · 0.45

Tested by

no test coverage detected