Browse Source

Fix onReset for MIDI to CV Interface

tags/v0.6.0
Andrew Belt 6 years ago
parent
commit
07ad57ab9e
1 changed files with 9 additions and 8 deletions
  1. +9
    -8
      src/Core/MIDIToCVInterface.cpp

+ 9
- 8
src/Core/MIDIToCVInterface.cpp View File

@@ -6,8 +6,8 @@




struct MidiNoteData { 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; ExponentialFilter modFilter;
uint16_t pitch = 0; uint16_t pitch = 0;
ExponentialFilter pitchFilter; ExponentialFilter pitchFilter;
bool pedal = false;


MidiNoteData noteData[128]; MidiNoteData noteData[128];
std::list<uint8_t> heldNotes; std::list<uint8_t> 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 { void onReset() override {
heldNotes.clear(); heldNotes.clear();
pedal = false; pedal = false;
lastNote = 60;
} }


void pressNote(uint8_t note) { void pressNote(uint8_t note) {
@@ -118,8 +121,6 @@ struct MIDIToCVInterface : Module {
} }


void processMessage(MidiMessage msg) { void processMessage(MidiMessage msg) {
debug("MIDI: %01x %01x %02x %02x", msg.status(), msg.channel(), msg.data1, msg.data2);

switch (msg.status()) { switch (msg.status()) {
// note off // note off
case 0x8: { case 0x8: {


Loading…
Cancel
Save