From 5eac4e238497d120f46b25c038a1d071d5ce8fbf Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 24 Oct 2017 14:46:15 +0200 Subject: [PATCH] Fix midi clock bug --- src/core/MidiClockToCV.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/MidiClockToCV.cpp b/src/core/MidiClockToCV.cpp index d37ef9ff..2e0a0f7d 100644 --- a/src/core/MidiClockToCV.cpp +++ b/src/core/MidiClockToCV.cpp @@ -32,6 +32,8 @@ struct MIDIClockToCVInterface : MidiIO, Module { bool tick = false; bool running = false; bool reset = false; + int c_bar = 0; + MIDIClockToCVInterface() : MidiIO(), Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS) { @@ -72,9 +74,8 @@ struct MIDIClockToCVInterface : MidiIO, Module { }; void MIDIClockToCVInterface::step() { - static int c_bar = 0; static float trigger_length = 0.05; - static float sampleRate = engineGetSampleRate(); + float sampleRate = engineGetSampleRate(); /* Note this is in relation to the Midi clock's Tick (6x per 16th note). * Therefore, e.g. the 2:3 is calculated: @@ -87,7 +88,7 @@ void MIDIClockToCVInterface::step() { static int numratios = sizeof(ratios) / sizeof(*ratios); if (isPortOpen()) { - std::vector message; + static std::vector message; // midiIn->getMessage returns empty vector if there are no messages in the queue getMessage(&message);