From 1d40677870548bf1382a5385d723d2c18a728f28 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 9 Oct 2017 14:16:54 -0400 Subject: [PATCH 1/3] Disallow input port from Ctrl+dragging to create a new cable --- CHANGELOG.md | 2 ++ src/app/Port.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b0a43e..347752d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,11 @@ Tip: Use `git checkout v0.3.2` for example to check out any previous version men ### dev - Cables can now stack on output ports - Added sub-menus for each plugin, includes optional plugin metadata like URLs +- Added MIDI CC-to-CV Interface, updated MIDI-to-CV Interface - Added new scrolling methods: middle-click-and-drag, shift-scroll, and arrow keys - Added engine pausing in sample rate menu - Added resizable blank to Core +- Added LEDs on plugs - Support for AMD Phenom II processors - Use self-contained Mac app bundle, no need for a Rack folder diff --git a/src/app/Port.cpp b/src/app/Port.cpp index df5a32b7..881583d9 100644 --- a/src/app/Port.cpp +++ b/src/app/Port.cpp @@ -36,8 +36,14 @@ void Port::onDragEnd() { void Port::onDragStart() { // Try to grab wire on top of stack WireWidget *wire = gRackWidget->wireContainer->getTopWire(this); + if (guiIsModPressed()) { + if (type == INPUT) + return; + else + wire = NULL; + } - if (wire && !guiIsModPressed()) { + if (wire) { // Disconnect existing wire if (type == INPUT) wire->inputPort = NULL; From 83ad9e7559a4f29296083e9f91c81162095552d5 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 9 Oct 2017 22:35:56 +0200 Subject: [PATCH 2/3] remove additional lights from midi module --- src/core/MidiInterface.cpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/core/MidiInterface.cpp b/src/core/MidiInterface.cpp index edd1e08c..e30d9429 100644 --- a/src/core/MidiInterface.cpp +++ b/src/core/MidiInterface.cpp @@ -227,7 +227,6 @@ struct MIDIToCVInterface : MidiIO, Module { int pitchWheel = 64; bool retrigger = false; bool retriggered = false; - float lights[NUM_OUTPUTS]; SchmittTrigger resetTrigger; float resetLight = 0.0; @@ -264,8 +263,6 @@ struct MIDIToCVInterface : MidiIO, Module { virtual void resetMidi(); - void updateLights(); - }; void MIDIToCVInterface::resetMidi() { @@ -276,15 +273,6 @@ void MIDIToCVInterface::resetMidi() { resetLight = 1.0; outputs[GATE_OUTPUT].value = 0.0; notes.clear(); - updateLights(); -} - -void MIDIToCVInterface::updateLights() { - lights[GATE_OUTPUT] = outputs[GATE_OUTPUT].value / 10; - lights[MOD_OUTPUT] = mod / 127.0; - lights[PITCHWHEEL_OUTPUT] = (pitchWheel - 64) / 127.0; - lights[CHANNEL_AFTERTOUCH_OUTPUT] = afterTouch / 127.0; - lights[VELOCITY_OUTPUT] = vel / 127.0; } void MIDIToCVInterface::step() { @@ -322,7 +310,6 @@ void MIDIToCVInterface::step() { outputs[PITCHWHEEL_OUTPUT].value = (pitchWheel - 64) / 64.0 * 10.0; outputs[CHANNEL_AFTERTOUCH_OUTPUT].value = afterTouch / 127.0 * 10.0; outputs[VELOCITY_OUTPUT].value = vel / 127.0 * 10.0; - updateLights(); } @@ -463,7 +450,8 @@ MidiToCVWidget::MidiToCVWidget() { yPos += channelChoice->box.size.y + margin + 15; } - std::string labels[MIDIToCVInterface::NUM_OUTPUTS] = {"1V/oct", "Gate", "Velocity", "Mod Wheel", "Pitch Wheel", "Aftertouch"}; + std::string labels[MIDIToCVInterface::NUM_OUTPUTS] = {"1V/oct", "Gate", "Velocity", "Mod Wheel", "Pitch Wheel", + "Aftertouch"}; for (int i = 0; i < MIDIToCVInterface::NUM_OUTPUTS; i++) { Label *label = new Label(); @@ -472,10 +460,7 @@ MidiToCVWidget::MidiToCVWidget() { addChild(label); addOutput(createOutput(Vec(15 * 6, yPos - 5), module, i)); - if (i != MIDIToCVInterface::PITCH_OUTPUT) { - addChild(createValueLight>(Vec(15 * 7.5, yPos - 5), &module->lights[i])); - } yPos += yGap + margin; } } @@ -508,8 +493,6 @@ struct MIDICCToCVInterface : MidiIO, Module { int cc[NUM_OUTPUTS]; int ccNum[NUM_OUTPUTS]; bool ccNumInited[NUM_OUTPUTS]; - float lights[NUM_OUTPUTS]; - MIDICCToCVInterface() : MidiIO(), Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS) { for (int i = 0; i < NUM_OUTPUTS; i++) { @@ -571,7 +554,6 @@ void MIDICCToCVInterface::step() { for (int i = 0; i < NUM_OUTPUTS; i++) { outputs[i].value = cc[i] / 127.0 * 10.0; - lights[i] = 2.0 * outputs[i].value / 10.0 - 1.0; } } @@ -709,7 +691,6 @@ MIDICCToCVWidget::MIDICCToCVWidget() { yPos += labelHeight + margin; addOutput(createOutput(Vec((i % 4) * (63) + 10, yPos + 5), module, i)); - addChild(createValueLight>(Vec((i % 4) * (63) + 32, yPos + 5), &module->lights[i])); if ((i + 1) % 4 == 0) { yPos += 47 + margin; From 650d0e4aed3b7789f479aaf768528e15f8e1a49c Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 9 Oct 2017 22:36:13 +0200 Subject: [PATCH 3/3] add reset Midi on channel switch --- src/core/MidiInterface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/MidiInterface.cpp b/src/core/MidiInterface.cpp index e30d9429..eef0c43f 100644 --- a/src/core/MidiInterface.cpp +++ b/src/core/MidiInterface.cpp @@ -99,7 +99,6 @@ std::string MidiIO::getPortName(int portId) { } void MidiIO::setPortId(int portId) { - resetMidi(); // reset Midi values // Close port if it was previously opened if (rtMidi->isPortOpen()) { @@ -119,6 +118,7 @@ struct MidiItem : MenuItem { int portId; void onAction() { + midiModule->resetMidi(); // reset Midi values midiModule->setPortId(portId); } }; @@ -163,6 +163,7 @@ struct ChannelItem : MenuItem { int channel; void onAction() { + midiModule->resetMidi(); // reset Midi values midiModule->setChannel(channel); } };