From c6f2a7c5d4aae44fb90c0266e2468b4c4e325ecc Mon Sep 17 00:00:00 2001 From: Nils Date: Sat, 3 Dec 2022 18:20:22 +0100 Subject: [PATCH] Fix out of bounds apc mini conversion --- engine/input_apcmini.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/input_apcmini.py b/engine/input_apcmini.py index ee55275..58e5ae8 100644 --- a/engine/input_apcmini.py +++ b/engine/input_apcmini.py @@ -307,7 +307,11 @@ class ApcMiniInput(MidiInput): else: color = APCmini_COLOR["yellow"] #for notes longer than one step / factor > 1 self.stepsNotAvailableBecauseOverlayedByFactor.add(apcPitch) - pblobNotes += cbox.Pattern.serialize_event(1, 0x90, apcPitch, color ) #tick in pattern, midi, pitch, velocity + try: + pblobNotes += cbox.Pattern.serialize_event(1, 0x90, apcPitch, color ) #tick in pattern, midi, pitch, velocity + except: + logging.warning(f"Note out of range for APC Mini: {stepDict}. This is safe to ignore, especially if you don't use the device") + pass # Create a new pattern object using events from the blob patNotes = cbox.Document.get_song().pattern_from_blob(pblobNotes, 0) #0 ticks. self.outputScene.play_pattern(patNotes, 150.0) #150 tempo