From 07ad57ab9e1ad96306290052842a6bcf6844992d Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 10 Mar 2018 02:35:56 -0500 Subject: [PATCH] Fix onReset for MIDI to CV Interface --- src/Core/MIDIToCVInterface.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Core/MIDIToCVInterface.cpp b/src/Core/MIDIToCVInterface.cpp index 822b0637..a908af9a 100644 --- a/src/Core/MIDIToCVInterface.cpp +++ b/src/Core/MIDIToCVInterface.cpp @@ -6,8 +6,8 @@ struct MidiNoteData { - uint8_t velocity; - uint8_t aftertouch; + uint8_t velocity = 0; + uint8_t aftertouch = 0; }; @@ -43,18 +43,21 @@ struct MIDIToCVInterface : Module { ExponentialFilter modFilter; uint16_t pitch = 0; ExponentialFilter pitchFilter; - bool pedal = false; MidiNoteData noteData[128]; std::list heldNotes; - uint8_t lastNote = 60; - bool gate = false; + uint8_t lastNote; + bool pedal; + bool gate; - MIDIToCVInterface() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {} + MIDIToCVInterface() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + onReset(); + } void onReset() override { heldNotes.clear(); pedal = false; + lastNote = 60; } void pressNote(uint8_t note) { @@ -118,8 +121,6 @@ struct MIDIToCVInterface : Module { } void processMessage(MidiMessage msg) { - debug("MIDI: %01x %01x %02x %02x", msg.status(), msg.channel(), msg.data1, msg.data2); - switch (msg.status()) { // note off case 0x8: {