From d123409c6df6065412c719383d5a4a54ff8014b2 Mon Sep 17 00:00:00 2001 From: Rafael Vega Date: Wed, 16 Feb 2022 08:45:38 -0500 Subject: [PATCH 1/2] Disabling midi clock when stop message is received. --- isobar/io/midi/input.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/isobar/io/midi/input.py b/isobar/io/midi/input.py index 4f20ef1..58ef939 100644 --- a/isobar/io/midi/input.py +++ b/isobar/io/midi/input.py @@ -36,6 +36,7 @@ def __init__(self, device_name=None, clock_target=None, virtual=False): self.callback = None self.estimated_tempo = None self.last_clock_time = None + self.midi_clock_is_running = False log.info("Opened MIDI input: %s" % self.midi.name) @property @@ -63,21 +64,24 @@ def _callback(self, message): else: self.last_clock_time = time.time() - if self.clock_target is not None: + if self.clock_target is not None and self.midi_clock_is_running: self.clock_target.tick() elif message.type == 'start': log.info(" - MIDI: Received start message") + self.midi_clock_is_running = True if self.clock_target is not None: self.clock_target.start() elif message.type == 'stop': log.info(" - MIDI: Received stop message") + self.midi_clock_is_running = False if self.clock_target is not None: self.clock_target.stop() elif message.type == 'songpos': log.info(" - MIDI: Received songpos message") + self.midi_clock_is_running = True if message.pos == 0: if self.clock_target is not None: self.clock_target.reset() From 646f0c05110fdb995db277e524534b711adfbb29 Mon Sep 17 00:00:00 2001 From: Rafael Vega Date: Wed, 16 Feb 2022 11:24:14 -0500 Subject: [PATCH 2/2] gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7dc77dd..70d1b93 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ dist/ dev audio midi +build TODO.md