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

Method rescaleVoltageForChannel

src/MidiThing.cpp:256–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254 }
255
256 uint16_t rescaleVoltageForChannel(uint8_t channel, float voltage) {
257 switch (portModes[channel]) {
258 case MODE10V: return rescale(clamp(voltage, 0.f, 10.f), 0.f, +10.f, 0, 16383);
259 case MODEPN5V: return rescale(clamp(voltage, -5.f, 5.f), -5.f, +5.f, 0, 16383);
260 case MODE8V: return rescale(clamp(voltage, 0.f, 8.f), 0.f, +8.f, 0, 16383);
261 case MODE5V: return rescale(clamp(voltage, 0.f, 5.f), 0.f, +5.f, 0, 16383);
262 default: return 0;
263 }
264 }
265
266 // one way sync (VCV -> hardware) for now
267 void doSync() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected