From 4b14b3c72fa76859c69377ec12c166d8b45a2198 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sun, 11 Mar 2018 00:40:59 -0500 Subject: [PATCH] Fix MIDI-TRIG/CC learn mode --- src/Core/MIDICCToCVInterface.cpp | 5 ++++- src/Core/MIDITriggerToCVInterface.cpp | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Core/MIDICCToCVInterface.cpp b/src/Core/MIDICCToCVInterface.cpp index 3425e689..c92d2392 100644 --- a/src/Core/MIDICCToCVInterface.cpp +++ b/src/Core/MIDICCToCVInterface.cpp @@ -59,6 +59,7 @@ struct MIDICCToCVInterface : Module { // Learn if (learningId >= 0) { learnedCcs[learningId] = cc; + learningId = -1; } // Set CV for (int i = 0; i < 16; i++) { @@ -103,8 +104,10 @@ struct MidiCcChoice : GridChoice { color.a = 0.5; } else { - text = stringf("%d", id); + text = stringf("%d", module->learnedCcs[id]); color.a = 1.0; + if (gFocusedWidget == this) + gFocusedWidget = NULL; } } diff --git a/src/Core/MIDITriggerToCVInterface.cpp b/src/Core/MIDITriggerToCVInterface.cpp index 63aa3a80..98dde0de 100644 --- a/src/Core/MIDITriggerToCVInterface.cpp +++ b/src/Core/MIDITriggerToCVInterface.cpp @@ -41,6 +41,7 @@ struct MIDITriggerToCVInterface : Module { // Learn if (learningId >= 0) { learnedNotes[learningId] = note; + learningId = -1; } // Find id for (int i = 0; i < 16; i++) { @@ -142,6 +143,9 @@ struct MidiTrigChoice : GridChoice { int semi = note % 12; text = stringf("%s%d", noteNames[semi], oct); color.a = 1.0; + + if (gFocusedWidget == this) + gFocusedWidget = NULL; } }