From c9a02976edf0a5c4e9fa6fa05c8da5bcc0d5e4b7 Mon Sep 17 00:00:00 2001 From: bordun Date: Sun, 8 Nov 2020 16:58:25 +0100 Subject: [PATCH] midi: accept sending sysex strings without spaces between the bytes --- CHANGELOG.md | 5 +++++ src/python/midi.py | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25857207..106d6616 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.6.3 + +- midi + - accept sending sysex strings without spaces between the bytes + ## 1.6.2 - bug fixes diff --git a/src/python/midi.py b/src/python/midi.py index 1f6501c3..8a0220ca 100644 --- a/src/python/midi.py +++ b/src/python/midi.py @@ -194,8 +194,9 @@ def send_midi(name, event, *args): m = [] for arg in args: if type(arg) is str: - arg = arg.split(' ') - arg = [int(x, 16) for x in arg] + arg = arg.replace(' ', '') # remove spaces + arg = [arg[i:i+2] for i in range(0, len(arg), 2)] # split in 2 chars bytes + arg = [int(x, 16) for x in arg] # parse hex bytes for x in arg: m.append(x) else: