From bd8bf13d96f2c5dc4dce6e7934fa548f16524be7 Mon Sep 17 00:00:00 2001 From: watzo Date: Tue, 14 Jun 2022 09:08:16 +0200 Subject: [PATCH 01/66] Ran 2to3 without hand edits, trivial changes, some todos added * relative import changes * print statements adjusted * exception handling changes * urllib api changes * thread -> _thread module rename * (c)StringIO module rename to io * filter to list comprehension rewrite * next() rewrite * keys() wrapped to list() * long replaced by int * set api changes * assertEquals -> assertEqual --- scripts/runtests.py | 46 +++++++++---------- src/aksui/UI/base.py | 4 +- src/aksui/UI/editors.py | 4 +- src/aksui/UI/envelopewidget.py | 2 +- src/aksui/UI/filechooser.py | 18 ++++---- src/aksui/UI/filterpanel.py | 2 +- src/aksui/UI/keygroupdetails.py | 2 +- src/aksui/UI/keygroupeditor.py | 4 +- src/aksui/UI/keygroupenvelope.py | 28 +++++------ src/aksui/UI/keygroupfilter.py | 2 +- src/aksui/UI/keygrouppanel.py | 26 +++++------ src/aksui/UI/lcdscreen.py | 14 +++--- src/aksui/UI/lfopanel.py | 2 +- src/aksui/UI/modmatrix.py | 2 +- src/aksui/UI/multifxeditor.py | 2 +- src/aksui/UI/rangewidget.py | 10 ++-- src/aksui/UI/recorddialog.py | 18 ++++---- src/aksui/UI/zonepanel.py | 2 +- src/aksui/ak/envelope.py | 2 +- src/aksui/ak/keygroup.py | 6 +-- src/aksui/ak/lfo.py | 2 +- src/aksui/ak/multi.py | 4 +- src/aksui/ak/multifx.py | 6 +-- src/aksui/ak/part.py | 2 +- src/aksui/ak/program.py | 6 +-- src/aksui/ak/programs.py | 2 +- src/aksui/ak/recording.py | 2 +- src/aksui/ak/samplerobject.py | 2 +- src/aksui/ak/zone.py | 2 +- src/aksui/browser.py | 2 +- src/aksui/gtkexcepthook.py | 3 +- src/aksui/main.py | 24 +++++----- src/aksui/treemain.py | 16 +++---- src/aksui/utils/midiutils.py | 2 +- src/aksui/utils/modelutils.py | 2 +- src/aksui/utils/sox.py | 2 +- src/aksy/config.py | 6 +-- src/aksy/console/get.py | 11 +++-- src/aksy/console/put.py | 8 ++-- src/aksy/device.py | 2 +- src/aksy/devices/akai/fileparser.py | 2 +- src/aksy/devices/akai/model.py | 4 +- src/aksy/devices/akai/s56k/sampler.py | 2 +- src/aksy/devices/akai/sampler.py | 2 +- src/aksy/devices/akai/z48/akptools.py | 8 ++-- src/aksy/devices/akai/z48/sampler.py | 18 ++++---- src/aksy/gui/aksyfsview.py | 40 ++++++++-------- src/aksy/gui/aksyshell.py | 2 +- src/aksyfs/aksyfuse.py | 2 +- src/aksyfs/common.py | 4 +- src/aksyfs/ftpd.py | 2 +- src/aksyosc/client.py | 10 ++-- src/aksyosc/handler.py | 4 +- src/aksyosc/server.py | 4 +- .../devices/akai/ftests/test_transfers.py | 2 +- .../aksy/devices/akai/replayingconnector.py | 4 +- .../devices/akai/tests/test_filebuilder.py | 8 ++-- .../devices/akai/tests/test_fileparser.py | 6 +-- .../akai/tests/test_replayingconnector.py | 8 ++-- .../aksy/devices/akai/tests/test_sysex.py | 46 +++++++++---------- .../devices/akai/z48/ftests/test_disktools.py | 8 ++-- .../devices/akai/z48/ftests/test_sysex.py | 10 ++-- src/tests/aksy/tests/test_config.py | 16 +++---- src/tests/aksyfs/tests/test_aksyfuse.py | 22 ++++----- src/tests/aksyfs/tests/test_ftpd.py | 14 +++--- src/tests/aksyosc/tests/test_connector.py | 4 +- src/tests/aksyosc/tests/test_handler.py | 12 ++--- src/tests/aksyosc/tests/test_osc.py | 24 +++++----- 68 files changed, 296 insertions(+), 294 deletions(-) diff --git a/scripts/runtests.py b/scripts/runtests.py index 3c6a1e6..442ce9d 100755 --- a/scripts/runtests.py +++ b/scripts/runtests.py @@ -67,11 +67,9 @@ import os import sys import time -import types import getopt import unittest import traceback -from sets import Set __metaclass__ = type @@ -169,7 +167,7 @@ def visit(ignored, dir, files): results.append(path) return if '__init__.py' not in files: - print >> sys.stderr, "%s is not a package" % dir + print("%s is not a package" % dir, file=sys.stderr) return for file in files: if file.startswith('test') and file.endswith('.py'): @@ -226,7 +224,7 @@ def get_all_test_cases(module): if not name.startswith('Test'): continue item = getattr(module, name) - if (isinstance(item, (type, types.ClassType)) and + if (isinstance(item, type) and issubclass(item, unittest.TestCase)): results.append(item) return results @@ -236,7 +234,7 @@ def get_test_classes_from_testsuite(suite): """Returns a set of test case classes used in a test suite.""" if not isinstance(suite, unittest.TestSuite): raise TypeError('not a TestSuite', suite) - results = Set() + results = set() for test in suite._tests: if isinstance(test, unittest.TestCase): results.add(test.__class__) @@ -259,16 +257,16 @@ def get_test_cases(test_files, cfg, tracer=None): if test_suite is None: continue if cfg.warn_omitted: - all_classes = Set(get_all_test_cases(module)) + all_classes = set(get_all_test_cases(module)) classes_in_suite = get_test_classes_from_testsuite(test_suite) difference = all_classes - classes_in_suite for test_class in difference: # surround the warning with blank lines, otherwise it tends # to get lost in the noise - print >> sys.stderr - print >> sys.stderr, ("%s: WARNING: %s not in test suite" - % (file, test_class.__name__)) - print >> sys.stderr + print(file=sys.stderr) + print(("%s: WARNING: %s not in test suite" + % (file, test_class.__name__)), file=sys.stderr) + print(file=sys.stderr) if (cfg.level is not None and getattr(test_suite, 'level', 0) > cfg.level): continue @@ -280,7 +278,7 @@ def get_test_cases(test_files, cfg, tracer=None): def get_test_hooks(test_files, cfg, tracer=None): """Returns a list of test hooks from a given list of test modules.""" results = [] - dirs = Set(map(os.path.dirname, test_files)) + dirs = set(list(map(os.path.dirname, test_files))) for dir in list(dirs): if os.path.basename(dir) == 'ftests': dirs.add(os.path.join(os.path.dirname(dir), 'tests')) @@ -425,7 +423,7 @@ def run(self, test): self.stream.writeln() if not result.wasSuccessful(): self.stream.write("FAILED (") - failed, errored = map(len, (result.failures, result.errors)) + failed, errored = list(map(len, (result.failures, result.errors))) if failed: self.stream.write("failures=%d" % failed) if errored: @@ -447,8 +445,8 @@ def main(argv): # Environment if sys.version_info < (2, 3): - print >> sys.stderr, '%s: need Python 2.3 or later' % argv[0] - print >> sys.stderr, 'your python is %s' % sys.version + print('%s: need Python 2.3 or later' % argv[0], file=sys.stderr) + print('your python is %s' % sys.version, file=sys.stderr) return 1 # Defaults @@ -476,7 +474,7 @@ def main(argv): 'level=', 'all-levels', 'coverage']) for k, v in opts: if k == '-h': - print __doc__ + print(__doc__) return 0 elif k == '-v': cfg.verbosity += 1 @@ -509,22 +507,22 @@ def main(argv): try: cfg.level = int(v) except ValueError: - print >> sys.stderr, '%s: invalid level: %s' % (argv[0], v) - print >> sys.stderr, 'run %s -h for help' + print('%s: invalid level: %s' % (argv[0], v), file=sys.stderr) + print('run %s -h for help', file=sys.stderr) return 1 elif k == '--all-levels': cfg.level = None else: - print >> sys.stderr, '%s: invalid option: %s' % (argv[0], k) - print >> sys.stderr, 'run %s -h for help' + print('%s: invalid option: %s' % (argv[0], k), file=sys.stderr) + print('run %s -h for help', file=sys.stderr) return 1 if args: cfg.pathname_regex = args[0] if len(args) > 1: cfg.test_regex = args[1] if len(args) > 2: - print >> sys.stderr, '%s: too many arguments: %s' % (argv[0], args[2]) - print >> sys.stderr, 'run %s -h for help' + print('%s: too many arguments: %s' % (argv[0], args[2]), file=sys.stderr) + print('run %s -h for help', file=sys.stderr) return 1 if not cfg.unit_tests and not cfg.functional_tests: cfg.unit_tests = True @@ -564,11 +562,11 @@ def main(argv): success = True if cfg.list_files: baselen = len(cfg.basedir) + 1 - print "\n".join([fn[baselen:] for fn in test_files]) + print("\n".join([fn[baselen:] for fn in test_files])) if cfg.list_tests: - print "\n".join([test.id() for test in test_cases]) + print("\n".join([test.id() for test in test_cases])) if cfg.list_hooks: - print "\n".join([str(hook) for hook in test_hooks]) + print("\n".join([str(hook) for hook in test_hooks])) if cfg.run_tests: runner = CustomTestRunner(cfg, test_hooks) suite = unittest.TestSuite() diff --git a/src/aksui/UI/base.py b/src/aksui/UI/base.py index 2bda411..58c6187 100644 --- a/src/aksui/UI/base.py +++ b/src/aksui/UI/base.py @@ -56,8 +56,8 @@ def update(self): spin.set_value(val) elif hscale != None: hscale.set_value(val) - except Exception, ex: - print 'attr',attr,val,ex + except Exception as ex: + print('attr',attr,val,ex) self.updating = False diff --git a/src/aksui/UI/editors.py b/src/aksui/UI/editors.py index cb95f44..2b92660 100644 --- a/src/aksui/UI/editors.py +++ b/src/aksui/UI/editors.py @@ -7,7 +7,7 @@ from aksui.utils import midiutils, modelutils from aksui.ak import envelope, keygroup, part -import rangewidget +from . import rangewidget __author__ = 'Joseph Misra' __version__ = '0.71' @@ -115,7 +115,7 @@ def setup(self, p): tb = gtk.RadioButton(rbg) tb.connect("toggled", self.on_button_press_event, kg.index + 1) - if i in midiutils.gm1drumsmap.keys(): + if i in list(midiutils.gm1drumsmap.keys()): subdesc = midiutils.gm1drumsmap[i] # general midi markup label subdesclabel = gtk.Label("%s %s" % (desc, subdesc)) diff --git a/src/aksui/UI/envelopewidget.py b/src/aksui/UI/envelopewidget.py index 4e19dfb..ec467bb 100644 --- a/src/aksui/UI/envelopewidget.py +++ b/src/aksui/UI/envelopewidget.py @@ -1,5 +1,5 @@ from aksui.ak import envelope -import hitbox +from . import hitbox import gtk diff --git a/src/aksui/UI/filechooser.py b/src/aksui/UI/filechooser.py index 8080699..9eb9364 100644 --- a/src/aksui/UI/filechooser.py +++ b/src/aksui/UI/filechooser.py @@ -1,6 +1,6 @@ -import os, os.path, urlparse +import os, os.path, urllib.parse import gtk -import urllib, thread +import urllib.request, urllib.parse, urllib.error, _thread from aksy.devices.akai import fileparser, sampler from aksy import fileutils @@ -12,7 +12,7 @@ try: from aksui.postmod import itx except ImportError: - print "postmod not available, no .it support" + print("postmod not available, no .it support") postmod_available = False def get_file_path_from_dnd_dropped_uri(uri): @@ -26,7 +26,7 @@ def get_file_path_from_dnd_dropped_uri(uri): elif path.startswith('file:'): # xffm path = path[5:] # 5 is len('file:') - path = urllib.url2pathname(path) # escape special chars + path = urllib.request.url2pathname(path) # escape special chars return path def collect_files(args): @@ -56,7 +56,7 @@ def find_file(basedir, candidates, samplename): raise IOError("Referenced sample '%s' not found in directory '%s'" % (samplename, basedir)) def unwrap(func): - return lambda(data): func(data[2]) + return lambda data: func(data[2]) class FileChooser: def __init__(self, s): @@ -129,7 +129,7 @@ def import_from_it(self, fn): from aksui.utils import sox it = itx.ITX(fn) - print fn, "loaded! exporting..." + print(fn, "loaded! exporting...") exported_files = it.exportSamples("c:\\tmp") # TODO: change to configurable temp dir @@ -196,12 +196,12 @@ def on_drag_data_received(self, widget, context, x, y, selection, target_type, t for uri in uris: path = get_file_path_from_dnd_dropped_uri(uri) if len(path): - print 'path to open', path + print('path to open', path) if os.path.isfile(path): # is it file? files.append(path) if len(files) > 0: self.files = files - thread.start_new_thread(self.upload_files) + _thread.start_new_thread(self.upload_files) def expand_it_files(self, files): if files: @@ -211,7 +211,7 @@ def expand_it_files(self, files): additional_wavs.extend(self.import_from_it(file)) files.remove(file) files.extend(additional_wavs) - print files + print(files) return files else: return None diff --git a/src/aksui/UI/filterpanel.py b/src/aksui/UI/filterpanel.py index fda7d31..d69986e 100644 --- a/src/aksui/UI/filterpanel.py +++ b/src/aksui/UI/filterpanel.py @@ -1,6 +1,6 @@ import gtk -import panelbase, rangewidget +from . import panelbase, rangewidget from aksui.utils import midiutils class FilterPanel(panelbase.PanelBase): diff --git a/src/aksui/UI/keygroupdetails.py b/src/aksui/UI/keygroupdetails.py index fa8b2ae..ea63c01 100644 --- a/src/aksui/UI/keygroupdetails.py +++ b/src/aksui/UI/keygroupdetails.py @@ -1,4 +1,4 @@ -import base +from . import base class KeygroupDetails(base.Base): def __init__(self, keygroup): diff --git a/src/aksui/UI/keygroupeditor.py b/src/aksui/UI/keygroupeditor.py index 54d64bc..498ec7f 100644 --- a/src/aksui/UI/keygroupeditor.py +++ b/src/aksui/UI/keygroupeditor.py @@ -1,7 +1,7 @@ import gtk -import base, editors, keygrouppanel, zonepanel, modmatrix, filterpanel, lfopanel -import keygroupenvelope +from . import base, editors, keygrouppanel, zonepanel, modmatrix, filterpanel, lfopanel +from . import keygroupenvelope from aksui.ak import keygroup diff --git a/src/aksui/UI/keygroupenvelope.py b/src/aksui/UI/keygroupenvelope.py index 39ef971..5c46ef4 100644 --- a/src/aksui/UI/keygroupenvelope.py +++ b/src/aksui/UI/keygroupenvelope.py @@ -1,12 +1,12 @@ -import gtk - -import panelbase, editors - class KeygroupEnvelopes(panelbase.PanelBase): +import gtk + +from . import panelbase, editors +class KeygroupEnvelopes(panelbase.PanelBase): def __init__(self, keygroup, cb): - self.env_labels = ["Amp Anvelope", "Filter Envelope", "Aux Envelope"] - panelbase.PanelBase.__init__(self, keygroup, "Envelopes", cb) + self.env_labels = ["Amp Anvelope", "Filter Envelope", "Aux Envelope"] + panelbase.PanelBase.__init__(self, keygroup, "Envelopes", cb) - def setup(self, keygroup): + def setup(self, keygroup): self.clear_children(True) self.vbox = gtk.VBox(False, 0) self.s = keygroup.s @@ -17,14 +17,14 @@ def setup(self, keygroup): self.pack_start(self.vbox) self.show_all() - def update_env(self, envname, env, index): - setattr(self, envname, editors.EnvelopeHBox(self.keygroup, index)) - label_hbox = gtk.HBox(False,0) - lb = gtk.Label("%s" % self.env_labels[index]) - lb.set_justify(gtk.JUSTIFY_LEFT) - label_hbox.pack_start(lb,False,False,5) + def update_env(self, envname, env, index): + setattr(self, envname, editors.EnvelopeHBox(self.keygroup, index)) + label_hbox = gtk.HBox(False,0) + lb = gtk.Label("%s" % self.env_labels[index]) + lb.set_justify(gtk.JUSTIFY_LEFT) + label_hbox.pack_start(lb,False,False,5) self.vbox.pack_start(label_hbox,False,False,5); self.vbox.pack_start(getattr(self, envname),False,False,1); e = getattr(self, envname) - e.show_all() + e.show_all() diff --git a/src/aksui/UI/keygroupfilter.py b/src/aksui/UI/keygroupfilter.py index 28d6fa8..05114d8 100644 --- a/src/aksui/UI/keygroupfilter.py +++ b/src/aksui/UI/keygroupfilter.py @@ -1,4 +1,4 @@ -import base +from . import base class KeygroupFilter(base.Base): def __init__(self, keygroup): diff --git a/src/aksui/UI/keygrouppanel.py b/src/aksui/UI/keygrouppanel.py index 21801a3..0d87a8e 100644 --- a/src/aksui/UI/keygrouppanel.py +++ b/src/aksui/UI/keygrouppanel.py @@ -1,14 +1,14 @@ -import gtk - -import panelbase, rangewidget +import gtk + +from . import panelbase, rangewidget class KeygroupPanel(panelbase.PanelBase): - def __init__(self, kg, cb): + def __init__(self, kg, cb): panelbase.PanelBase.__init__(self,kg,"Keygroup Details",cb) def setup(self, kg): - self.clear_children(True) - print kg.index + self.clear_children(True) + print(kg.index) self.kg = kg self.s = kg.s @@ -16,13 +16,13 @@ def setup(self, kg): vbox = gtk.VBox() hbox = gtk.HBox() - controls = [ - rangewidget.AkKnobWidget(kg, "level", -600, 60, 10, "db"), - rangewidget.AkKnobWidget(kg, "tune", -3600, 3600, 100, ""), - rangewidget.AkKnobWidget(kg, "polyphony", 1, 64, 1, "voices"), - # mute group - # fx send - # send volume + controls = [ + rangewidget.AkKnobWidget(kg, "level", -600, 60, 10, "db"), + rangewidget.AkKnobWidget(kg, "tune", -3600, 3600, 100, ""), + rangewidget.AkKnobWidget(kg, "polyphony", 1, 64, 1, "voices"), + # mute group + # fx send + # send volume ] for control in controls: diff --git a/src/aksui/UI/lcdscreen.py b/src/aksui/UI/lcdscreen.py index 9f17f4d..7b51d5d 100644 --- a/src/aksui/UI/lcdscreen.py +++ b/src/aksui/UI/lcdscreen.py @@ -89,7 +89,7 @@ def handle_keys(self, widget, event, onoff): m = 0 - for mod in modifiers.keys(): + for mod in list(modifiers.keys()): if event.keyval & mod: m += modifiers[mod] @@ -102,14 +102,14 @@ def handle_keys(self, widget, event, onoff): hfunc = None - if event.state & gtk.gdk.CONTROL_MASK and keyname in ctrlmap.keys(): + if event.state & gtk.gdk.CONTROL_MASK and keyname in list(ctrlmap.keys()): funcmap = {1:fp.keypress_hold, 0:fp.keypress_release} hfunc = funcmap[onoff] arg0 = ctrlmap[keyname] - elif keyname in wheelmap.keys() and onoff: + elif keyname in list(wheelmap.keys()) and onoff: hfunc = fp.move_datawheel arg0 = wheelmap[keyname] - elif keyname in non_ascii_keymap.keys(): + elif keyname in list(non_ascii_keymap.keys()): funcmap = {1:fp.keypress_hold, 0:fp.keypress_release} hfunc = funcmap[onoff] arg0 = non_ascii_keymap[keyname] @@ -121,7 +121,7 @@ def handle_keys(self, widget, event, onoff): arg1 = m else: arg1 = 0 - elif keyname in ascii_keymap.keys(): + elif keyname in list(ascii_keymap.keys()): funcmap = {1:fp.ascii_keypress_hold, 0:fp.ascii_keypress_release} hfunc = funcmap[onoff] arg0 = ascii_keymap[keyname] @@ -131,9 +131,9 @@ def handle_keys(self, widget, event, onoff): arg1 = 0 if hfunc: - if hfunc.func_code.co_argcount == 3: + if hfunc.__code__.co_argcount == 3: hfunc(arg0, arg1) - elif hfunc.func_code.co_argcount == 2: + elif hfunc.__code__.co_argcount == 2: hfunc(arg0) self.updateLCD() diff --git a/src/aksui/UI/lfopanel.py b/src/aksui/UI/lfopanel.py index 2ce7257..6d6db04 100644 --- a/src/aksui/UI/lfopanel.py +++ b/src/aksui/UI/lfopanel.py @@ -1,6 +1,6 @@ import gtk -import panelbase, rangewidget +from . import panelbase, rangewidget from aksui.utils import midiutils from aksui.ak import lfo diff --git a/src/aksui/UI/modmatrix.py b/src/aksui/UI/modmatrix.py index 6649d54..b8ce48e 100644 --- a/src/aksui/UI/modmatrix.py +++ b/src/aksui/UI/modmatrix.py @@ -1,6 +1,6 @@ import gtk -import panelbase, rangewidget +from . import panelbase, rangewidget from aksui.ak import modulationmatrix """ diff --git a/src/aksui/UI/multifxeditor.py b/src/aksui/UI/multifxeditor.py index fe5101d..9416817 100644 --- a/src/aksui/UI/multifxeditor.py +++ b/src/aksui/UI/multifxeditor.py @@ -133,5 +133,5 @@ def __init__(self,s): self.channelWidgets[i] = MultiFXChannelEditor(self.mfx.channels[i]) self.pack_start(self.channelWidgets[i], expand=False, fill=False) else: - print "nop" + print("nop") diff --git a/src/aksui/UI/rangewidget.py b/src/aksui/UI/rangewidget.py index 103bf5c..4ccd58f 100644 --- a/src/aksui/UI/rangewidget.py +++ b/src/aksui/UI/rangewidget.py @@ -1,11 +1,11 @@ # Custom widgets via Cairo: Knob, Level, Range, Keygroup etc. -import math, urllib -from urlparse import urlparse +import math, urllib.request, urllib.parse, urllib.error +from urllib.parse import urlparse import gobject, gtk -import hitbox, widget +from . import hitbox, widget from aksui.utils import modelutils, midiutils from aksui.ak import * @@ -571,7 +571,7 @@ def on_drag_data_received(self, widget, context, x, y, selection, target_type, t if target_type == 0: # try uploading that shit parsed = urlparse(selection.data.rstrip('\r\n')) - path = urllib.unquote(parsed[2]) + path = urllib.parse.unquote(parsed[2]) self.s.filechooser.upload(path) samplename = selection.data zone.set_sample(samplename) @@ -696,7 +696,7 @@ def init(self, so = None, soattr = None): if iter: self.set_active_iter(iter) elif len(self.value) > 0: - print "missing iter for", self.value, "model probably not initialized?" + print("missing iter for", self.value, "model probably not initialized?") elif self.use_index: self.set_active(int(self.value)) else: diff --git a/src/aksui/UI/recorddialog.py b/src/aksui/UI/recorddialog.py index 8b1b362..2fa3aea 100644 --- a/src/aksui/UI/recorddialog.py +++ b/src/aksui/UI/recorddialog.py @@ -1,6 +1,6 @@ import gobject -import base +from . import base """ Recording interface(s)! @@ -26,8 +26,8 @@ def check_progress(self, *args): if status == 6: self.continue_check_progress = False self.record.gettools().keep() - print "Kept sample!" - print self.record.gettools().get_name() + print("Kept sample!") + print(self.record.gettools().get_name()) status = self.record.gettools().get_status() @@ -39,13 +39,13 @@ def check_progress(self, *args): def on_button_clicked(self, widget): if widget.name == "button_arm": - print "before armed", self.record.gettools().get_status() + print("before armed", self.record.gettools().get_status()) self.record.gettools().arm() - print "after armed", self.record.gettools().get_status() + print("after armed", self.record.gettools().get_status()) if self.record.gettools().get_status() == 2: self.record.gettools().record() else: - print self.record.gettools().get_status() + print(self.record.gettools().get_status()) # 1 == ready # 2 == armed self.continue_check_progress = True @@ -62,8 +62,8 @@ def on_button_clicked(self, widget): self.progressbar.set_fraction(0.0) elif widget.name == "button_play_preview": self.record.gettools().start_playing() - print self.record.gettools().get_status() + print(self.record.gettools().get_status()) elif widget.name == "button_stop_preview": - print "stopping" + print("stopping") self.record.gettools().stop_playing() - print self.record.gettools().get_status() + print(self.record.gettools().get_status()) diff --git a/src/aksui/UI/zonepanel.py b/src/aksui/UI/zonepanel.py index efeb8b8..33a18bd 100644 --- a/src/aksui/UI/zonepanel.py +++ b/src/aksui/UI/zonepanel.py @@ -1,7 +1,7 @@ import gtk import os.path -import panelbase, rangewidget +from . import panelbase, rangewidget from aksui.utils import midiutils class ZonePanel(panelbase.PanelBase): diff --git a/src/aksui/ak/envelope.py b/src/aksui/ak/envelope.py index d99ce63..78b823b 100644 --- a/src/aksui/ak/envelope.py +++ b/src/aksui/ak/envelope.py @@ -1,4 +1,4 @@ -import samplerobject +from . import samplerobject class Envelope(samplerobject.SamplerObject): def __init__(self, keygroup, index, xoffset=10, yoffset=10): diff --git a/src/aksui/ak/keygroup.py b/src/aksui/ak/keygroup.py index a07ac71..c286483 100644 --- a/src/aksui/ak/keygroup.py +++ b/src/aksui/ak/keygroup.py @@ -1,11 +1,11 @@ -import samplerobject, zone, envelope +from . import samplerobject, zone, envelope keygroup_cache = {} def get_keygroup_cached(p, index): key = (p.handle, index) - if not key in keygroup_cache.keys(): + if not key in list(keygroup_cache.keys()): keygroup_cache[key] = Keygroup(p, index) keygroup = keygroup_cache[key] @@ -77,7 +77,7 @@ def set(self, attrname, attrval): attrval = int(attrval) func(attrval) else: - print "no method set_" + attrname + print("no method set_" + attrname) if self.set_callback: self.set_callback(attrname, attrval) diff --git a/src/aksui/ak/lfo.py b/src/aksui/ak/lfo.py index 916790e..bf4b2b4 100644 --- a/src/aksui/ak/lfo.py +++ b/src/aksui/ak/lfo.py @@ -1,4 +1,4 @@ -import samplerobject +from . import samplerobject class LFO(samplerobject.SamplerObject): def __init__(self, s, kg, index): diff --git a/src/aksui/ak/multi.py b/src/aksui/ak/multi.py index 94b13f9..4bd0ac4 100644 --- a/src/aksui/ak/multi.py +++ b/src/aksui/ak/multi.py @@ -1,4 +1,4 @@ -import samplerobject +from . import samplerobject class Multi(samplerobject.SamplerObject): def __init__(self,s,name,handle=None): @@ -18,7 +18,7 @@ def __init__(self,s,name,handle=None): self.s.multitools.set_curr_by_name(self.name) self.update() else: - print "No name..." + print("No name...") self.precache() diff --git a/src/aksui/ak/multifx.py b/src/aksui/ak/multifx.py index 706744d..074129d 100644 --- a/src/aksui/ak/multifx.py +++ b/src/aksui/ak/multifx.py @@ -58,7 +58,7 @@ def __init__(self,mfx,index): def dump(self): attrs = ['index','muted','input','output'] for attr in attrs: - print 'Param ',self.index,' :',attr,' = ',getattr(self,attr) + print('Param ',self.index,' :',attr,' = ',getattr(self,attr)) for mi in self.modules: module = self.modules[mi] @@ -123,7 +123,7 @@ def update(self): def dump(self): attrs = ['effect_name','enabled','number_of_parameters'] for attr in attrs: - print '\tParam ',self.index,' :',attr,' = ',getattr(self,attr) + print('\tParam ',self.index,' :',attr,' = ',getattr(self,attr)) for pi in self.parameters: param = self.parameters[pi] param.dump() @@ -187,7 +187,7 @@ def on_value_changed(self, adj, lblFormat = None): def dump(self): attrs = ['maximum','minimum','name','type','position_id'] for attr in attrs: - print '\t\tParam ',self.index,' :',attr,' = ',getattr(self,attr) + print('\t\tParam ',self.index,' :',attr,' = ',getattr(self,attr)) inputmapmodel = modelutils.get_model_from_list(MultiFXChannel.inputmap) outputmapmodel = modelutils.get_model_from_list(MultiFXChannel.outputmap) diff --git a/src/aksui/ak/part.py b/src/aksui/ak/part.py index b16fbc0..3c36df1 100644 --- a/src/aksui/ak/part.py +++ b/src/aksui/ak/part.py @@ -1,4 +1,4 @@ -import samplerobject +from . import samplerobject class Part(samplerobject.SamplerObject): def __init__(self, s, m, index): diff --git a/src/aksui/ak/program.py b/src/aksui/ak/program.py index e819d5a..2e912d9 100644 --- a/src/aksui/ak/program.py +++ b/src/aksui/ak/program.py @@ -1,4 +1,4 @@ -import samplerobject, program, keygroup, modulationmatrix, modulationpin +from . import samplerobject, program, keygroup, modulationmatrix, modulationpin class Program(samplerobject.SamplerObject): def __init__(self, s, name, handle = None): @@ -18,7 +18,7 @@ def __init__(self, s, name, handle = None): if self.name: self.s.programtools.set_curr_by_name(self.name) else: - print "No name..." + print("No name...") self.precache() @@ -65,7 +65,7 @@ def dump_matrix(self): for c in conns[0]: if c.source > 0: - print c.source, c.dest, c.level + print(c.source, c.dest, c.level) result.append("%d. %s => %s = %d" % (c.pin_index, modulationmatrix.ModulationMatrix.sources[c.source], modulationmatrix.ModulationMatrix.destinations[c.dest], c.level)) return '\n'.join(result) diff --git a/src/aksui/ak/programs.py b/src/aksui/ak/programs.py index aef62fc..0862aae 100644 --- a/src/aksui/ak/programs.py +++ b/src/aksui/ak/programs.py @@ -1,5 +1,5 @@ from aksui.utils import modelutils -import program +from . import program class Programs: programtypes = {0:"Keygroup", 1:"Drum"} diff --git a/src/aksui/ak/recording.py b/src/aksui/ak/recording.py index 0463581..9d859d3 100644 --- a/src/aksui/ak/recording.py +++ b/src/aksui/ak/recording.py @@ -1,4 +1,4 @@ -import samplerobject +from . import samplerobject from aksy import fileutils diff --git a/src/aksui/ak/samplerobject.py b/src/aksui/ak/samplerobject.py index 625ab9c..504b1f1 100644 --- a/src/aksui/ak/samplerobject.py +++ b/src/aksui/ak/samplerobject.py @@ -38,7 +38,7 @@ def get_knob(self, attr): return str(pin.level) else: return "" - elif attr in self.abbr.keys(): + elif attr in list(self.abbr.keys()): return self.abbr[attr] else: return attr diff --git a/src/aksui/ak/zone.py b/src/aksui/ak/zone.py index 825562b..d6926fc 100644 --- a/src/aksui/ak/zone.py +++ b/src/aksui/ak/zone.py @@ -1,4 +1,4 @@ -import samplerobject +from . import samplerobject class Zone(samplerobject.SamplerObject): def __init__(self, kg, index): diff --git a/src/aksui/browser.py b/src/aksui/browser.py index c9ba422..fe468e8 100644 --- a/src/aksui/browser.py +++ b/src/aksui/browser.py @@ -42,7 +42,7 @@ def fullpath(self): return self.path def walk(self): - print self.fullpath() + print(self.fullpath()) for node in self.nodes: node.walk() diff --git a/src/aksui/gtkexcepthook.py b/src/aksui/gtkexcepthook.py index f0a663d..117bc0a 100644 --- a/src/aksui/gtkexcepthook.py +++ b/src/aksui/gtkexcepthook.py @@ -1,7 +1,8 @@ import sys import gtk, pango from gettext import gettext as _ -from cStringIO import * +# TODO verify cStringIO replacement +from io import * import traceback def _info(type, value, tb): diff --git a/src/aksui/main.py b/src/aksui/main.py index 1722650..24822da 100644 --- a/src/aksui/main.py +++ b/src/aksui/main.py @@ -25,9 +25,9 @@ try: import hotshot, hotshot.stats except ImportError: - print "Profiler not available" + print("Profiler not available") -import traceback, thread, os.path +import traceback, _thread, os.path import pygtk pygtk.require('2.0') @@ -69,13 +69,13 @@ def get_selected_from_treeview(treeview): # exception handler ripped from austin's code def exceptionHandler(type, value, tback): try: - print "" - print "-- Initialization Exception --" + print("") + print("-- Initialization Exception --") tbmessage = "Type: " + str(type) + "\nValue: " + str(value) + "\nData:\n" tblist = traceback.extract_tb(tback) for x in tblist: tbmessage = tbmessage + str(x) + "\n" - print "Error Code:", tbmessage + print("Error Code:", tbmessage) except: traceback.print_exc() @@ -146,7 +146,7 @@ def activate_download(self, selected, ext): return self.main.log("Downloading file(s) %s to directory '%s'" % (selected, destdir)) - thread.start_new_thread(self._download_and_notify, (destdir, selected, ext)) + _thread.start_new_thread(self._download_and_notify, (destdir, selected, ext)) @transaction() def _download_and_notify(self, destdir, selected, ext): @@ -274,17 +274,17 @@ def on_new_program_activate(self, widget): #self.main.log(str("adding", i, notes[i][0], notes[i][1], selected_samples[i])) if type == 0: self.s.keygrouptools.set_curr_keygroup(i) - print "set note range" + print("set note range") self.s.keygrouptools.set_low_note(notes[i][0]) self.s.keygrouptools.set_high_note(notes[i][1]) else: self.s.keygrouptools.set_curr_keygroup(notes[i][0]) - print "set zone stuff" + print("set zone stuff") self.s.zonetools.set_keyboard_track(1, keytrack) self.s.zonetools.set_playback(1, playback) - print "set sample" + print("set sample") self.s.zonetools.set_sample(1, selected_samples[i]) #self.s.programtools.add_keygroup_sample(notes[i][0],notes[i][1],1,keytrack,selected_samples[i]) @@ -375,7 +375,7 @@ def on_new_program_activate(self, widget): self.main.on_new_program_activate(widget) def on_set_current_program_activate(self, widget): - print "set current program" + print("set current program") class Main(base.Base): @@ -481,7 +481,7 @@ def move_properties_window(self): self.on_update_models(None) self.log("Multis, Programs, and Samples Loaded...") - except Exception, ex: + except Exception as ex: self.log("Exception: %s" % (ex)) def open_multi_editor(self, multiname): @@ -567,7 +567,7 @@ def on_save_activate(self, button): if path: org = {'multitools':'.akm', 'programtools':'.akp', 'sampletools' : '.wav'} results = [] - for toolname in org.keys(): + for toolname in list(org.keys()): ext = org[toolname] tool = getattr(self.s, toolname) items = tool.get_names() diff --git a/src/aksui/treemain.py b/src/aksui/treemain.py index c097eec..18a00c5 100644 --- a/src/aksui/treemain.py +++ b/src/aksui/treemain.py @@ -9,11 +9,11 @@ # our stuff -from ak import * -from ak.samplerobject import * -from UI import * +from .ak import * +from .ak.samplerobject import * +from .UI import * -from utils import midiutils, modelutils +from .utils import midiutils, modelutils from postmod.itx import * @@ -222,7 +222,7 @@ def on_sampleedit_changed(self, cell, path, new_text, user_data): if type(so) is ak.zone: so.set("sample", new_text) else: - print "cant find", path, "in dict" + print("cant find", path, "in dict") return def on_textedit_changed(self, cell, path, new_text, user_data): @@ -254,13 +254,13 @@ def do_lists(s): setattr(s,'multis',multis) if len(s.samples) == 0: - print "No samples..." + print("No samples...") if len(s.programs) == 0: - print "No programs..." + print("No programs...") if len(s.multis) == 0: - print "No multis..." + print("No multis...") setattr(s,'samplesmodel', modelutils.get_model_from_list(s.samples)) setattr(s,'programsmodel', modelutils.get_model_from_list(s.programs)) diff --git a/src/aksui/utils/midiutils.py b/src/aksui/utils/midiutils.py index 6bad2f7..7350e27 100644 --- a/src/aksui/utils/midiutils.py +++ b/src/aksui/utils/midiutils.py @@ -1,4 +1,4 @@ -import modelutils +from . import modelutils # list of mpc pad -> notes, left -> right = 1 -> 16 mpcpads = [ diff --git a/src/aksui/utils/modelutils.py b/src/aksui/utils/modelutils.py index 04dbba5..afa5d33 100644 --- a/src/aksui/utils/modelutils.py +++ b/src/aksui/utils/modelutils.py @@ -19,7 +19,7 @@ def get_model_from_list(items): model = gtk.ListStore(str, str) if type(items) is dict: - for i in items.keys(): + for i in list(items.keys()): s = items[i] model.append([i,s]) return model diff --git a/src/aksui/utils/sox.py b/src/aksui/utils/sox.py index 8413fdb..958ff01 100644 --- a/src/aksui/utils/sox.py +++ b/src/aksui/utils/sox.py @@ -7,7 +7,7 @@ def convert(filename): src = filename dest = path + "\\" + name + "_rs" + ext cmd = "sox \"" + src + "\" -r 44100 \"" + dest + "\" resample -ql" - print cmd + print(cmd) os.system(cmd) return dest else: diff --git a/src/aksy/config.py b/src/aksy/config.py index 596690e..3df7c72 100644 --- a/src/aksy/config.py +++ b/src/aksy/config.py @@ -1,4 +1,4 @@ -import ConfigParser +import configparser import os.path, sys from optparse import OptionParser @@ -16,11 +16,11 @@ def get_value(config, default, prop_name): section_override = os.path.basename(sys.argv[0]) try: return config.get(section_override, prop_name) - except (ConfigParser.NoSectionError, ConfigParser.NoOptionError): + except (configparser.NoSectionError, configparser.NoOptionError): return config.get(default, prop_name) def get_config(ini_file=os.path.expanduser('~/.aksy/aksy.ini')): - cfg = ConfigParser.ConfigParser(defaults={ 'port': '6575', 'host': 'localhost', 'basedir': os.path.expanduser('~') }) + cfg = configparser.ConfigParser(defaults={ 'port': '6575', 'host': 'localhost', 'basedir': os.path.expanduser('~') }) cfg.add_section('sampler') cfg.set('sampler', 'type', 'z48') cfg.set('sampler', 'connector', 'usb') diff --git a/src/aksy/console/get.py b/src/aksy/console/get.py index 8d3d280..b8ce014 100755 --- a/src/aksy/console/get.py +++ b/src/aksy/console/get.py @@ -48,13 +48,13 @@ def download_from_disk(sampler, destdir, patterns, overwrite): def download(sampler, destdir, name, location, overwrite): destfile = os.path.join(destdir, name) if os.path.exists(destfile) and not overwrite: - print "Skipping existing file ", destfile + print("Skipping existing file ", destfile) else: - print "Downloading %s to %s" % (name, destfile) + print("Downloading %s to %s" % (name, destfile)) sampler.transfertools.get(name, destfile) def download_children(sampler, parent, destdir, patternYielder, overwrite): - pat = patternYielder.next() + pat = next(patternYielder) filtered = [child for child in parent.get_children() if fnmatch.fnmatch(child.get_name(), pat)] fullpath = os.path.join(destdir, parent.get_name()) @@ -100,10 +100,11 @@ class PatternYielder: def __init__(self, patterns): self.patterns = patterns self.index = -1 - def next(self): + # TODO check correctness of rewrite + def __next__(self): try: self.index += 1 - print self.patterns[self.index] + print(self.patterns[self.index]) return self.patterns[self.index] except IndexError: return "*" diff --git a/src/aksy/console/put.py b/src/aksy/console/put.py index c4a6c94..9087de9 100755 --- a/src/aksy/console/put.py +++ b/src/aksy/console/put.py @@ -52,11 +52,11 @@ def main(): z48 = Devices.get_instance(options.sampler_type, options.connector) if options.programName is not None: - print 'Uploading files.' + print('Uploading files.') upload_files(z48, to_upload, filterProgram=options.programName) elif options.drumProgramName: - print 'Uploading files.' - print 'Building drum program.', options.drumProgramName + print('Uploading files.') + print('Building drum program.', options.drumProgramName) build_drum_program(z48, to_upload, options.drumProgramName) upload_files(z48, to_upload, filterProgram=options.drumProgramName) else: @@ -84,7 +84,7 @@ def build_drum_program(z48, filelist, program_name): for name, midinote in keymap: kg = keygroup(p, midinote) - print midinote, name + print(midinote, name) kg.zones[0].set("sample", program_name + " " + name) kg.zones[0].set("playback", 1) kg.set("polyphony", 1) diff --git a/src/aksy/device.py b/src/aksy/device.py index 9ceee41..8062c42 100644 --- a/src/aksy/device.py +++ b/src/aksy/device.py @@ -24,6 +24,6 @@ def get_instance(device_id, connector_type='usb', *args, **kwargs): else: raise Exception("Unknown connector type ", connector_type) return _devices[device_id](connector, *args, **kwargs) - except KeyError, e: + except KeyError as e: raise Exception("Device %s not found" % e[0]) diff --git a/src/aksy/devices/akai/fileparser.py b/src/aksy/devices/akai/fileparser.py index 791d18a..719723b 100644 --- a/src/aksy/devices/akai/fileparser.py +++ b/src/aksy/devices/akai/fileparser.py @@ -1,5 +1,5 @@ import os, struct -from StringIO import StringIO +from io import StringIO from aksy.devices.akai.filemodel import Zone, Program, Chunk, Keygroup def parse_byte(chunk, offset): diff --git a/src/aksy/devices/akai/model.py b/src/aksy/devices/akai/model.py index 6e21ab2..79eb77e 100644 --- a/src/aksy/devices/akai/model.py +++ b/src/aksy/devices/akai/model.py @@ -38,7 +38,9 @@ def get_child(self, name): return None class Disk(Container): - def __init__(self, (handle, disk_type, format, scsi_id, writable, name)): + # TODO use tuple unpacking at call site + def __init__(self, xxx_todo_changeme): + (handle, disk_type, format, scsi_id, writable, name) = xxx_todo_changeme self._handle = handle # type: 0=floppy; 1=hard disk; 2=CD ROM; 3=removable disk. self._disk_type = disk_type diff --git a/src/aksy/devices/akai/s56k/sampler.py b/src/aksy/devices/akai/s56k/sampler.py index 8cdb3e3..32fa101 100644 --- a/src/aksy/devices/akai/s56k/sampler.py +++ b/src/aksy/devices/akai/s56k/sampler.py @@ -1,6 +1,6 @@ import logging -import sysextools, disktools, programtools, sampletools, multitools, songtools +from . import sysextools, disktools, programtools, sampletools, multitools, songtools from aksy.devices.akai.sampler import Sampler #from aksy.devices.akai import sysex from aksy.devices.akai import model diff --git a/src/aksy/devices/akai/sampler.py b/src/aksy/devices/akai/sampler.py index d443ca1..974497b 100644 --- a/src/aksy/devices/akai/sampler.py +++ b/src/aksy/devices/akai/sampler.py @@ -28,7 +28,7 @@ def get_cmd_by_name(self, section_name, command_name): def execute_by_cmd_name(self, section_name, command_name, args): tools_obj = getattr(self, section_name) func = getattr(tools_obj, command_name) - return apply(func, args) + return func(*args) def execute_alt_request(self, handle, commands, args, index = None): """Execute a list of commands on the item with the specified handle using Akai System Exclusive "Alternative Operations" diff --git a/src/aksy/devices/akai/z48/akptools.py b/src/aksy/devices/akai/z48/akptools.py index dccb035..dd2dd3b 100644 --- a/src/aksy/devices/akai/z48/akptools.py +++ b/src/aksy/devices/akai/z48/akptools.py @@ -1,4 +1,4 @@ -from StringIO import StringIO +from io import StringIO import struct, os.path, os """ @@ -108,7 +108,7 @@ def __init__(self, chunks={}, **kwargs): #self.setdefaults() else: self.setdefaults() - for kw, value in kwargs.iteritems(): + for kw, value in kwargs.items(): if not hasattr(self, kw): raise Exception("Unknown property: %s" % kw) setattr(self, kw, value) @@ -303,7 +303,7 @@ def add_chunk(self, offset): def setvalues(self): label = self.read_string(index=0x0, length=4) - print repr(self._chunk) + print(repr(self._chunk)) assert label == "APRG" assert self.read_string(0x5, 4) == "prg " self.midi_prog_no = self.read_byte(0x15) @@ -435,7 +435,7 @@ def __repr__(self): string_repr = StringIO() string_repr.write('') return string_repr.getvalue() diff --git a/src/aksy/devices/akai/z48/sampler.py b/src/aksy/devices/akai/z48/sampler.py index a83c20d..0060014 100644 --- a/src/aksy/devices/akai/z48/sampler.py +++ b/src/aksy/devices/akai/z48/sampler.py @@ -1,7 +1,7 @@ import logging -import sysextools, disktools, programtools, multitools, songtools, multifxtools -import sampletools, systemtools, recordingtools, keygrouptools, zonetools, frontpaneltools +from . import sysextools, disktools, programtools, multitools, songtools, multifxtools +from . import sampletools, systemtools, recordingtools, keygrouptools, zonetools, frontpaneltools from aksy.devices.akai.sampler import Sampler from aksy.devices.akai import model @@ -16,7 +16,7 @@ def __init__(self, connector): self.sysextools.enable_msg_notification(False) self.sysextools.enable_item_sync(False) - + self.setup_model() def setup_tools(self): @@ -35,11 +35,11 @@ def setup_tools(self): def setup_model(self): model.register_handlers({model.Disk: self.disktools, - model.FileRef: self.disktools, - model.Program: self.programtools, - model.Sample: self.sampletools, - model.Multi: self.multitools, - model.Song: self.songtools}) + model.FileRef: self.disktools, + model.Program: self.programtools, + model.Sample: self.sampletools, + model.Multi: self.multitools, + model.Song: self.songtools}) self.disks = model.RootDisk('disks', self.disktools.get_disklist()) - self.memory = model.Memory('memory') + self.memory = model.Memory('memory') \ No newline at end of file diff --git a/src/aksy/gui/aksyfsview.py b/src/aksy/gui/aksyfsview.py index 5c4144c..ba8bd47 100644 --- a/src/aksy/gui/aksyfsview.py +++ b/src/aksy/gui/aksyfsview.py @@ -49,7 +49,7 @@ def __init__(self,parent,title): try: self.sampler = Devices.get_instance('z48', 'osc') - except USBException, e: + except USBException as e: # if e[0] == "No sampler found": self.sampler = Devices.get_instance('mock_z48', 'mock') # self.reportException(e) @@ -107,7 +107,7 @@ def get_menu_action(self, callable): return self.action_map[callable] def register_menu_action(self, action): - print "Register ", action, action.action + print("Register ", action, action.action) self.Bind(wx.EVT_MENU, action.execute, id=action.id) self.action_map[action.action] = action @@ -158,7 +158,7 @@ def __init__(self, action, id, prolog=None, epilog=None): self.epilog = epilog def execute_refresh(self, item, *args): - print "REFRESH" + print("REFRESH") item.get_parent().refresh() def execute(self, evt): @@ -171,13 +171,13 @@ def execute(self, evt): def execute_action(self, item): if not hasattr(item, self.action): return - print "Action %s, item: %s name: %s" % (self.action, repr(item), item.get_name()) - print self.prolog + print("Action %s, item: %s name: %s" % (self.action, repr(item), item.get_name())) + print(self.prolog) if self.prolog is None: args = () else: args = self.prolog(self, item) - print "Executing with args %s " % repr(args) + print("Executing with args %s " % repr(args)) if args is None: return elif len(args) == 0: @@ -279,21 +279,21 @@ def OnItemBeginDrag(self, evt): item = self.GetPyData(id) if isinstance(item, model.FileRef): self.draggedItem = item - print "BeginDrag ", self.draggedItem.get_name() + print("BeginDrag ", self.draggedItem.get_name()) evt.Allow() def OnItemEndDrag(self, evt): dest = evt.GetItem() item = self.GetPyData(dest) - print "EndDrag %s, Mod: %s" % (repr(item), repr(evt.GetKeyCode())) + print("EndDrag %s, Mod: %s" % (repr(item), repr(evt.GetKeyCode()))) if isinstance(item, model.Folder): - print "Copy" + print("Copy") self.AppendAksyItem(dest, self.draggedItem) elif isinstance(item, model.Memory): - print "Load" + print("Load") self.draggedItem.load() else: - print "Unsupported drop target" + print("Unsupported drop target") evt.Veto() return @@ -304,7 +304,7 @@ def AppendAksyItem(self, parent, item): if parent is None: parent = self.root - print "AppendAksyItem: name: %s, children: %s" % (item.get_name(), hasattr(item, 'get_children') and repr(item.get_children()) or 'None') + print("AppendAksyItem: name: %s, children: %s" % (item.get_name(), hasattr(item, 'get_children') and repr(item.get_children()) or 'None')) child = self.AppendItem(parent, item.get_short_name()) if item.has_children(): self.SetItemHasChildren(child) @@ -333,7 +333,7 @@ def OnSelChanged(self, evt): ids = self.GetSelections() if len(ids) > 0: item = self.GetPyData(ids[-1]) - print "TREE SEL CHANGED", ids + print("TREE SEL CHANGED", ids) evt.Skip() def OnKeyDown(self, evt): @@ -364,12 +364,12 @@ def OnItemDelete(self, evt): #tree_parent = self.GetItemParent(evt.GetItem()) #parent = self.GetPyData(tree_parent) #self.SetItemHasChildren(tree_parent, parent.has_children()) - print repr(evt) + print(repr(evt)) def OnItemExpanding(self, evt): id = evt.GetItem() item = self.GetPyData(id) - print "OnItemExpanding %s %s, %s" % (id, item.get_name(), repr(item.get_children())) + print("OnItemExpanding %s %s, %s" % (id, item.get_name(), repr(item.get_children()))) for child in item.get_children(): if not hasattr(child, 'id'): self.AppendAksyItem(id, child) @@ -466,7 +466,7 @@ def blacontextMenu(self, e): else: actions.intersection(item.get_actions()) menu = ActionMenu(self, wx.SIMPLE_BORDER) - print "ACTIONS ", actions + print("ACTIONS ", actions) mactions = [self.get_frame().get_menu_action(action.callable) for action in actions] menu.set_actions(mactions) self.PopupMenu(menu) @@ -553,10 +553,10 @@ def OnPaste(self, evt): # assume a path is pasted data = wx.TextDataObject() if wx.TheClipboard.GetData(data): - print "Clipboard data ", repr(data.GetText()) + print("Clipboard data ", repr(data.GetText())) data = wx.FileDataObject() elif wx.TheClipboard.GetData(data): - print "Clipboard data ", repr(data.GetFilenames()) + print("Clipboard data ", repr(data.GetFilenames())) wx.TheClipboard.Close() class ActionMenu(wx.Menu): @@ -590,7 +590,7 @@ def get_drop_dest(self, id): def OnDropFiles(self, x, y, filenames): id, flag1 = self.ctrl.HitTest((x,y)) - print repr(id) + print(repr(id)) item = self.get_drop_dest(id) if item is None or not hasattr(item, "append_child"): @@ -607,7 +607,7 @@ def get_drop_dest(self, item): return self.ctrl.get_current() def OnDropFiles(self, x, y, filenames): - print "FN: ", repr(filenames) + print("FN: ", repr(filenames)) CtrlFileDropTarget.OnDropFiles(self, x, y, filenames) self.ctrl.refresh() diff --git a/src/aksy/gui/aksyshell.py b/src/aksy/gui/aksyshell.py index a63fad3..0db653d 100644 --- a/src/aksy/gui/aksyshell.py +++ b/src/aksy/gui/aksyshell.py @@ -76,7 +76,7 @@ def getAutoCompleteKeys(self): def getAutoCompleteList(self, command='', *args, **kw): clist = py.interpreter.Interpreter.getAutoCompleteList(self, command, args, kw) - print repr(clist) + print(repr(clist)) return clist class AksyShell(wx.SplitterWindow): diff --git a/src/aksyfs/aksyfuse.py b/src/aksyfs/aksyfuse.py index 4e451ee..71e74a8 100644 --- a/src/aksyfs/aksyfuse.py +++ b/src/aksyfs/aksyfuse.py @@ -56,7 +56,7 @@ def release(self, flags): if self.is_upload(): try: AksyFile.sampler.transfertools.put(self.get_path(), None, self.get_location()) - except IOError, exc: + except IOError as exc: # TODO: move to a method where we can raise exceptions LOG.exception( "Exception occurred: ", exc) os.close(self.handle) diff --git a/src/aksyfs/common.py b/src/aksyfs/common.py index a286b31..0e92c76 100644 --- a/src/aksyfs/common.py +++ b/src/aksyfs/common.py @@ -45,7 +45,7 @@ def __init__(self, mode, size, writable=False): class DirStatInfo(StatInfo): def __init__(self, writable=False, child_count=1): - StatInfo.__init__(self, stat.S_IFDIR|stat.S_IEXEC, 4096L) + StatInfo.__init__(self, stat.S_IFDIR|stat.S_IEXEC, 4096) self.st_nlink = child_count class FileStatInfo(StatInfo): @@ -117,7 +117,7 @@ def release(self, flags): if self.is_upload(): try: AksyFile.sampler.transfertools.put(self.get_path(), None, self.get_location()) - except IOError, exc: + except IOError as exc: # TODO: move to a method where we can raise exceptions LOG.exception( "Exception occurred: %s", repr(exc)) os.close(self.handle) diff --git a/src/aksyfs/ftpd.py b/src/aksyfs/ftpd.py index 96b4cc7..9cbf505 100644 --- a/src/aksyfs/ftpd.py +++ b/src/aksyfs/ftpd.py @@ -96,7 +96,7 @@ def glob1(self, dirname, pattern): """ names = self.listdir(dirname) if pattern[0] != '.': - names = filter(lambda x: x[0] != '.', names) + names = [x for x in names if x[0] != '.'] return fnmatch.filter(names, pattern) # --- utility methods diff --git a/src/aksyosc/client.py b/src/aksyosc/client.py index dead244..11e5c80 100755 --- a/src/aksyosc/client.py +++ b/src/aksyosc/client.py @@ -2,17 +2,17 @@ import socket from aksyosc.osc import OSCMessage, decodeOSC -from oscoptions import create_option_parser +from .oscoptions import create_option_parser def snd_recv(cmd): m = OSCMessage() m.setAddress(cmd) s.sendall(m.getBinary()) - print decodeOSC(s.recv(8192)) + print(decodeOSC(s.recv(8192))) def show_banner(): - print "Aksyosc\n * Enter an osc address at the prompt,\ - e.g. '/systemtools/get_sampler_name'\n * Use 'quit' to exit" + print("Aksyosc\n * Enter an osc address at the prompt,\ + e.g. '/systemtools/get_sampler_name'\n * Use 'quit' to exit") if __name__ == "__main__": parser = create_option_parser() @@ -22,7 +22,7 @@ def show_banner(): show_banner() try: while 1: - cmd = raw_input("aksyosc> ") + cmd = input("aksyosc> ") if not cmd: continue if cmd == 'quit': diff --git a/src/aksyosc/handler.py b/src/aksyosc/handler.py index 3c124c3..d53dd4b 100644 --- a/src/aksyosc/handler.py +++ b/src/aksyosc/handler.py @@ -36,10 +36,10 @@ def dispatch(self, message): return self.dispatch_alt_request(message[2:]) else: return self.dispatch_command(address, message) - except AttributeError, e: + except AttributeError as e: LOG.exception("OSC message %s could not be dispatched", repr(message)) return create_error_msg("Failed to execute command %s" % address, e) - except Exception, e: + except Exception as e: LOG.exception("Dispatch of %s failed", repr(message)) return create_error_msg('Execution failed', e) diff --git a/src/aksyosc/server.py b/src/aksyosc/server.py index d20996a..70ed7e0 100755 --- a/src/aksyosc/server.py +++ b/src/aksyosc/server.py @@ -23,8 +23,8 @@ def __init__(self, address, port, callbackManager): self.set_reuse_addr() self.bind((address, port)) self.response = None - print '%s started at addr: %s:%i\n' % ( - self.__class__.__name__, address, port) + print('%s started at addr: %s:%i\n' % ( + self.__class__.__name__, address, port)) def handle_connect(self): pass diff --git a/src/tests/aksy/devices/akai/ftests/test_transfers.py b/src/tests/aksy/devices/akai/ftests/test_transfers.py index b960140..ef4c30e 100644 --- a/src/tests/aksy/devices/akai/ftests/test_transfers.py +++ b/src/tests/aksy/devices/akai/ftests/test_transfers.py @@ -19,7 +19,7 @@ def _testTransfer(self, filename): sampler.get(filename, actualfilename) expected = open(fullpath, 'rb') actual = open(actualfilename, 'rb') - self.assertEquals(md5sum(expected), md5sum(actual)) + self.assertEqual(md5sum(expected), md5sum(actual)) expected.close() actual.close() os.remove(actualfilename) diff --git a/src/tests/aksy/devices/akai/replayingconnector.py b/src/tests/aksy/devices/akai/replayingconnector.py index 20bdf4a..19f113f 100644 --- a/src/tests/aksy/devices/akai/replayingconnector.py +++ b/src/tests/aksy/devices/akai/replayingconnector.py @@ -1,6 +1,6 @@ from aksy.devices.akai import sysex -import logging, struct, StringIO +import logging, struct, io REQ_START = 'Request: ' LEN_REQ_START = len(REQ_START) @@ -11,7 +11,7 @@ LOG = logging.getLogger("aksy.devices.akai.replaying_connector") def encode(byte_str): - s = StringIO.StringIO(len(byte_str)) + s = io.StringIO(len(byte_str)) for b in byte_str: s.write(struct.pack("1B", int(b, 16))) return s.getvalue() diff --git a/src/tests/aksy/devices/akai/tests/test_filebuilder.py b/src/tests/aksy/devices/akai/tests/test_filebuilder.py index eb34f67..46ddc89 100644 --- a/src/tests/aksy/devices/akai/tests/test_filebuilder.py +++ b/src/tests/aksy/devices/akai/tests/test_filebuilder.py @@ -3,7 +3,7 @@ from aksy.devices.akai.filemodel import Zone from aksy.devices.akai.filemodel import Keygroup import unittest -from StringIO import StringIO +from io import StringIO class TestZoneBuilder(unittest.TestCase): def testBuild(self): @@ -11,9 +11,9 @@ def testBuild(self): zone = Zone.create_default() zone.samplename = 'test' chunk = builder.build(zone) - self.assertNotEquals(None, chunk) - self.assertEquals("zone", chunk.name) - self.assertEquals(56, chunk.get_length()) + self.assertNotEqual(None, chunk) + self.assertEqual("zone", chunk.name) + self.assertEqual(56, chunk.get_length()) class TestProgramWriter(unittest.TestCase): def testWrite(self): diff --git a/src/tests/aksy/devices/akai/tests/test_fileparser.py b/src/tests/aksy/devices/akai/tests/test_fileparser.py index 0e1ba10..9c6c6f7 100644 --- a/src/tests/aksy/devices/akai/tests/test_fileparser.py +++ b/src/tests/aksy/devices/akai/tests/test_fileparser.py @@ -8,9 +8,9 @@ def testRead(self): parser = fileparser.ProgramParser() program = parser.parse(pfile) - self.assertEquals(9, len(program.keygroups)) - self.assertEquals('angel 01', program.keygroups[0].zones[0].samplename) - self.assertEquals('', program.keygroups[0].zones[2].samplename) + self.assertEqual(9, len(program.keygroups)) + self.assertEqual('angel 01', program.keygroups[0].zones[0].samplename) + self.assertEqual('', program.keygroups[0].zones[2].samplename) def test_suite(): testloader = unittest.TestLoader() diff --git a/src/tests/aksy/devices/akai/tests/test_replayingconnector.py b/src/tests/aksy/devices/akai/tests/test_replayingconnector.py index ac1cd82..3452ebb 100644 --- a/src/tests/aksy/devices/akai/tests/test_replayingconnector.py +++ b/src/tests/aksy/devices/akai/tests/test_replayingconnector.py @@ -16,17 +16,17 @@ def get_bytes(self): class TestReplayingConnector(unittest.TestCase): def testEncode(self): - self.assertEquals('\xf0G_\x00E`\x00\x00\x00\xf7', replayingconnector.encode(eval(RESP))) + self.assertEqual('\xf0G_\x00E`\x00\x00\x00\xf7', replayingconnector.encode(eval(RESP))) def testParse(self): f = testutil.get_test_resource('aksy_20070624.log') conn = replayingconnector.ReplayingConnector('z48', f) - self.assertEquals(create_bytes("['f0', '47', '5f', '00', '44', '00', '01', 'f7']"), + self.assertEqual(create_bytes("['f0', '47', '5f', '00', '44', '00', '01', 'f7']"), conn.requests[create_bytes(" ['f0', '47', '5f', '00', '00', '01', '00', 'f7']")]) - self.assertEquals(create_bytes(RESP), + self.assertEqual(create_bytes(RESP), conn.requests[create_bytes(REQ)]) - self.assertEquals(34, len(conn.requests)) + self.assertEqual(34, len(conn.requests)) def testExecuteRequest(self): f = testutil.get_test_resource('aksy_20070624.log') diff --git a/src/tests/aksy/devices/akai/tests/test_sysex.py b/src/tests/aksy/devices/akai/tests/test_sysex.py index 93c1c3e..4fb84f7 100644 --- a/src/tests/aksy/devices/akai/tests/test_sysex.py +++ b/src/tests/aksy/devices/akai/tests/test_sysex.py @@ -11,34 +11,34 @@ def testCreateRequest(self): # Select disk command = sysex.Command('\x5f', '\x20\x02', 'disktools', 'select_disk', (sysex_types.WORD,), None) bytes = sysex.Request(command, (256,)).get_bytes() - self.assertEquals( + self.assertEqual( '\xf0\x47\x5f\x00\x20\x02\x00\x02\xf7', bytes) # Select root folder: folder = '' command = sysex.Command('\x5f', '\x20\x13', 'disktools', 'open_folder', (sysex_types.STRING,), None) bytes = sysex.Request(command, (folder,)).get_bytes() - self.assertEquals( + self.assertEqual( '\xf0\x47\x5f\x00\x20\x13\x00\xf7', bytes) # Select autoload folder: folder = 'autoload' command = sysex.Command('\x5f', '\x20\x13', 'disktools', 'open_folder', (sysex_types.STRING,), None) bytes = sysex.Request(command, (folder,)).get_bytes() - self.assertEquals( + self.assertEqual( '\xf0\x47\x5f\x00\x20\x13\x61\x75\x74\x6f\x6c\x6f\x61\x64\x00\xf7', bytes) def testRequestWithNondefaultUserref(self): # slightly theoretical, because the z48 doesn't process these requests as expected command = sysex.Command('\x5f', '\x07\x01', 'disktools', 'get_sampler_name', (),(sysex_types.STRING,), sysex_types.USERREF) bytes = sysex.Request(command, (), request_id=129).get_bytes() - self.assertEquals( + self.assertEqual( '\xf0\x47\x5f\x20\x01\x01\x07\x01\xf7', bytes) def testCreateS56KRequest(self): command = sysex.Command('\x5e', '\x07\x01', 'disktools', 'get_sampler_name', (),(sysex_types.STRING,), sysex_types.S56K_USERREF) bytes = sysex.Request(command, ()).get_bytes() - self.assertEquals( + self.assertEqual( '\xf0\x47\x5e\x20\x00\x00\x07\x01\xf7', bytes) class TestReply(unittest.TestCase): @@ -51,14 +51,14 @@ def testCreateReply(self): sysex.REPLY_ID_REPLY, '\x20\x05', '\x01', sysex.END_SYSEX) dcmd = sysex.Command(sysex.Z48_ID, '\x20\x05', 'dummy', 'dummy', (), (sysex_types.BYTE,)) reply = sysex.Reply(''.join(bytes), dcmd) - self.assertEquals(1, reply.get_return_value()) + self.assertEqual(1, reply.get_return_value()) bytes = ( sysex.START_SYSEX, sysex.AKAI_ID, '\x5e\x20', '\x00', sysex.REPLY_ID_REPLY, '\x20\x05', '\x01', sysex.END_SYSEX) custom_cmd = sysex.Command('\x5e\x20', '\x20\x05', 'disktools', 'dummy', (),(sysex_types.BYTE,)) reply = sysex.Reply(''.join(bytes), custom_cmd) - self.assertEquals(1, reply.get_return_value()) + self.assertEqual(1, reply.get_return_value()) dcmd.reply_spec = (sysex_types.WORD, sysex_types.BYTE, sysex_types.BYTE, sysex_types.BYTE, sysex_types.BYTE, sysex_types.STRING) bytes = ( @@ -66,7 +66,7 @@ def testCreateReply(self): sysex.REPLY_ID_REPLY, '\x20\x05', '\x00','\x02\x01\x02', '\x00', '\x01\x5a\x34\x38\x20\x26\x20\x4d\x50\x43\x34\x4b', '\x00', sysex.END_SYSEX) reply = sysex.Reply(''.join(bytes), dcmd) - self.assertEquals((256, 1, 2, 0, 1, 'Z48 & MPC4K'), reply.get_return_value()) + self.assertEqual((256, 1, 2, 0, 1, 'Z48 & MPC4K'), reply.get_return_value()) # Future: should raise unknown disk error dcmd.id = '\x20\x05' @@ -81,7 +81,7 @@ def testCreateReply(self): '\x00', sysex.REPLY_ID_REPLY, '\x20\x10', '\x02', '\x15', '\x00', '\xf7') reply = sysex.Reply(''.join(bytes), dcmd) - self.assertEquals(21, reply.get_return_value()) + self.assertEqual(21, reply.get_return_value()) # not possible yet how to deal with the dump request replies dcmd.reply_spec = () @@ -94,25 +94,25 @@ def testCreateReply(self): sysex_types.BYTE, sysex_types.STRING) bytes = '\xf0\x47\x5f\x00\x52\x10\x05\x00\x02\x01\x02\x00\x01\x5a\x34\x38\x20\x26\x20\x4d\x50\x43\x34\x4b\x00\xf7' reply = sysex.Reply(bytes, dcmd) - self.assertEquals((256, 1, 2, 0, 1, 'Z48 & MPC4K'), reply.get_return_value()) + self.assertEqual((256, 1, 2, 0, 1, 'Z48 & MPC4K'), reply.get_return_value()) dcmd.id = '\x10\x22' bytes = '\xf0\x47\x5f\x00\x52\x10\x22\x4d\x65\x6c\x6c\x20\x53\x74\x72\x69\x6e\x67\x20\x41\x32\x2e\x77\x61\x76\x00\xf7' dcmd.reply_spec = (sysex_types.STRING,) reply = sysex.Reply(bytes, dcmd) - self.assertEquals('Mell String A2.wav', reply.get_return_value()) + self.assertEqual('Mell String A2.wav', reply.get_return_value()) dcmd.id = '\x10\x22' bytes = '\xf0\x47\x5f\x00\x52\x10\x22\x4d\x65\x6c\x6c\x6f\x74\x72\x6f\x6e\x20\x53\x74\x72\x69\x6e\x67\x73\x2e\x61\x6b\x70\x00\xf7' dcmd.reply_spec = (sysex_types.STRING,) reply = sysex.Reply(bytes, dcmd) - self.assertEquals('Mellotron Strings.akp', reply.get_return_value()) + self.assertEqual('Mellotron Strings.akp', reply.get_return_value()) dcmd.id = '\x07\x01' bytes = '\xf0\x47\x5f\x00\x52\x07\x01\x08\x5a\x38\x20\x53\x61\x6d\x70\x6c\x65\x72\x00\xf7' dcmd.reply_spec = (sysex_types.STRING,) reply = sysex.Reply(bytes, dcmd) - self.assertEquals('Z8 Sampler', reply.get_return_value()) + self.assertEqual('Z8 Sampler', reply.get_return_value()) bytes = '\xf0G_\x00E\x1eJ\x00\x00\xf7' self.assertRaises(NotImplementedError, sysex.Reply, bytes, self.createCommand()) @@ -125,7 +125,7 @@ def testParseUserRef(self): cmd = sysex.Command(sysex.S56K_ID, '\x07\x01', 'dummy', 'dummy', (), (sysex_types.BYTE,), sysex_types.S56K_USERREF) bytes = '\xf0\x47\x5e\x20\x7e\x00\x52\x07\x01\x08\x5a\x38\x20\x53\x61\x6d\x70\x6c\x65\x72\x00\xf7' reply = sysex.Reply(bytes, cmd) - self.assertEquals(126, reply.get_request_id()) + self.assertEqual(126, reply.get_request_id()) def testParseExtendedDisklist(self): bytes = sysex.repr_bytes( @@ -138,7 +138,7 @@ def testParseExtendedDisklist(self): cmd = sysex.Command(sysex.S56K_ID, '\x10\x05', 'dummy', 'dummy', (),( sysex_types.DISKLIST,), sysex_types.USERREF) reply = sysex.Reply(bytes, cmd) - self.assertEquals( + self.assertEqual( ((1, 0, 8, 0, 1, 'No disk'), (129, 3, 8, 1, 0, 'No disk'), (257, 3, 8, 2, 0, 'No disk'), (386, 3, 1, 4, 1, 'No Disk Name')) , reply.get_return_value()) @@ -148,7 +148,7 @@ def testParseEchoReply(self): ['f0', '47', '5f', '00', '52', '00', '06', '0b', '01', '01', '01', '01', 'f7']) cmd = sysex.Command(sysex.Z48_ID, '\x00\x06', 'sysextools', 'query', (), None) reply = sysex.Reply(bytes, cmd) - self.assertEquals((1,1,1,1), reply.get_return_value()) + self.assertEqual((1,1,1,1), reply.get_return_value()) def testParseHandleNameArray(self): bytes = sysex.repr_bytes(['F0','47','5F','00','52','14','02','20','08','44', @@ -156,37 +156,37 @@ def testParseHandleNameArray(self): '08','53','79','6E','74','68','54','65','73','74','00','F7']) cmd = sysex.Command(sysex.Z48_ID, '\x14\x02\02', 'programtools', 'get_handles_names', (), None) reply = sysex.Reply(bytes, cmd) - self.assertEquals(('Dry Kit 02', 'Program 1', 'SynthTest'), reply.get_return_value()) + self.assertEqual(('Dry Kit 02', 'Program 1', 'SynthTest'), reply.get_return_value()) class TestAlternativeRequest(unittest.TestCase): def test_no_args(self): cmd = sysex.Command(sysex.Z48_ID, '\x1F\x50', 'sampletools', 'get_sample_length', (), None) req = sysex.AlternativeRequest(65536, [cmd], []) - self.assertEquals('\xf0G_\x00`\x03\x00\x00\x04\x00\x01P\xf7', req.get_bytes()) + self.assertEqual('\xf0G_\x00`\x03\x00\x00\x04\x00\x01P\xf7', req.get_bytes()) def test_with_args(self): cmd = sysex.Command('_', '\x1E\x26', 'programtools', 'set_playback_mode', (sysex_types.BYTE,), None) req = sysex.AlternativeRequest(65536, [cmd, cmd], [[1],[2]]) - self.assertEquals('\xf0G_\x00`\x02\x00\x00\x04\x00\x02&\x01\x02&\x02\xf7', req.get_bytes()) + self.assertEqual('\xf0G_\x00`\x02\x00\x00\x04\x00\x02&\x01\x02&\x02\xf7', req.get_bytes()) def test_with_multiple_args(self): cmd = sysex.Command('_', '\x0E\x09', 'programtools', 'set_mod_start', (sysex_types.BYTE, sysex_types.SWORD), None) req = sysex.AlternativeRequest(65536, [cmd, cmd], [[1,1],[1,2]]) - self.assertEquals('\xf0G_\x00a\x02\x00\x00\x04\x00\x05\t\x01\x00\x01\x00\x05\t\x01\x00\x02\x00\xf7', req.get_bytes()) + self.assertEqual('\xf0G_\x00a\x02\x00\x00\x04\x00\x05\t\x01\x00\x01\x00\x05\t\x01\x00\x02\x00\xf7', req.get_bytes()) def test_keygroup_index(self): cmd = sysex.Command('_', '\x13\x30', 'programtools', 'get_envelope_rate1', (sysex_types.BYTE,), None) req = sysex.AlternativeRequest(65536, [cmd, cmd], [[1],[2]], index=3) - self.assertEquals('\xf0G_\x00a\x07\x00\x00\x04\x00\x03\x020\x01\x020\x02\xf7', req.get_bytes()) + self.assertEqual('\xf0G_\x00a\x07\x00\x00\x04\x00\x03\x020\x01\x020\x02\xf7', req.get_bytes()) class TestModuleMethods(unittest.TestCase): def test_byte_repr(self): bytes = '\xf0G_\x00E \x00\x00\x03\xf7' - self.assertEquals( + self.assertEqual( "['f0', '47', '5f', '00', '45', '20', '00', '00', '03', 'f7']", sysex.byte_repr(bytes)) def test_repr_bytes(self): - self.assertEquals( + self.assertEqual( '\xf0G_\x00E \x00\x00\x03\xf7', sysex.repr_bytes(['f0', '47', '5f', '00', '45', '20', '00', '00', '03', 'f7'])) diff --git a/src/tests/aksy/devices/akai/z48/ftests/test_disktools.py b/src/tests/aksy/devices/akai/z48/ftests/test_disktools.py index 5179f08..6f9605d 100644 --- a/src/tests/aksy/devices/akai/z48/ftests/test_disktools.py +++ b/src/tests/aksy/devices/akai/z48/ftests/test_disktools.py @@ -54,11 +54,11 @@ def test_test_disk(self): def test_get_disklist(self): disks = z48.disktools.get_disklist() LOG.info('test_get_disklist: ' + repr(disks)) - self.assertEquals(z48.disktools.get_no_disks(), len(disks)) + self.assertEqual(z48.disktools.get_no_disks(), len(disks)) def test_get_curr_path(self): self.selectFirstDisk() - self.assertEquals('\\', z48.disktools.get_curr_path()) + self.assertEqual('\\', z48.disktools.get_curr_path()) def test_eject_disk(self): for disk in z48.disktools.get_disklist(): @@ -67,7 +67,7 @@ def test_eject_disk(self): def test_folder_listings(self): foldernames = z48.disktools.get_folder_names() LOG.debug('test_get_folder_names: ' + repr(foldernames)) - self.assertEquals(z48.disktools.get_no_folders(), len(foldernames)) + self.assertEqual(z48.disktools.get_no_folders(), len(foldernames)) def test_load_folder(self): self.selectTestFolder() @@ -88,7 +88,7 @@ def test_get_filenames(self): self.selectFirstFolder() files = z48.disktools.get_filenames() LOG.info("test_get_filenames: %s" % repr(files)) - self.assertEquals(z48.disktools.get_no_files(), len(files)) + self.assertEqual(z48.disktools.get_no_files(), len(files)) def test_rename_delete_file(self): self.selectTestFolder() diff --git a/src/tests/aksy/devices/akai/z48/ftests/test_sysex.py b/src/tests/aksy/devices/akai/z48/ftests/test_sysex.py index e6f9ac9..58caf36 100644 --- a/src/tests/aksy/devices/akai/z48/ftests/test_sysex.py +++ b/src/tests/aksy/devices/akai/z48/ftests/test_sysex.py @@ -15,7 +15,7 @@ def testEncodeDecode(self): bytes = z48._execute(request.get_bytes()) length, request_id = sysex_types.USERREF.decode(bytes[3:]) - self.assertEquals(0, request_id) + self.assertEqual(0, request_id) cmd = sysex.Command(sysex.S56K_ID, '\x10\x04', 'get_no_disks', (), (sysex_types.BYTE,), userref_type=sysex_types.S56K_USERREF) @@ -24,8 +24,8 @@ def testEncodeDecode(self): bytes = z48._execute(request.get_bytes()) length, request_id = sysex_types.USERREF.decode(bytes[3:]) - self.assertEquals(3, length) - self.assertEquals(16000, request_id) + self.assertEqual(3, length) + self.assertEqual(16000, request_id) cmd = sysex.Command(sysex.Z48_ID, '\x20\x04', 'get_no_disks', (), (sysex_types.TYPEBYTE, sysex_types.BYTE,), userref_type=sysex_types.Z48USERREF) @@ -34,13 +34,13 @@ def testEncodeDecode(self): bytes = z48._execute(request.get_bytes()) result = sysex.Reply(bytes, cmd) request_id = result.get_request_id() - self.assertEquals(126, request_id) + self.assertEqual(126, request_id) request = sysex.Request(cmd, (), 16000) bytes = z48._execute(request.get_bytes()) result = sysex.Reply(bytes, cmd) request_id = result.get_request_id() - self.assertEquals(16000, request_id) + self.assertEqual(16000, request_id) def test_suite(): testloader = unittest.TestLoader() diff --git a/src/tests/aksy/tests/test_config.py b/src/tests/aksy/tests/test_config.py index d49eeed..6ae9a6f 100644 --- a/src/tests/aksy/tests/test_config.py +++ b/src/tests/aksy/tests/test_config.py @@ -7,17 +7,17 @@ class TestConfig(unittest.TestCase): def test_get_config(self): cfg = config.get_config(INI_FILE) - self.assertEquals('z48', cfg.get('sampler', 'type')) - self.assertEquals('localhost', cfg.get('osc', 'host')) - self.assertEquals(6576, cfg.getint('osc', 'port')) + self.assertEqual('z48', cfg.get('sampler', 'type')) + self.assertEqual('localhost', cfg.get('osc', 'host')) + self.assertEqual(6576, cfg.getint('osc', 'port')) def test_get_config_defaults(self): cfg = config.get_config(ini_file='non-existent') - self.assertEquals('z48', cfg.get('sampler', 'type')) - self.assertEquals('localhost', cfg.get('osc', 'host')) - self.assertEquals(6575, cfg.getint('osc', 'port')) - self.assertEquals(6575, cfg.getint('osc_client', 'port')) - self.assertEquals('INFO', cfg.get('logging', 'level')) + self.assertEqual('z48', cfg.get('sampler', 'type')) + self.assertEqual('localhost', cfg.get('osc', 'host')) + self.assertEqual(6575, cfg.getint('osc', 'port')) + self.assertEqual(6575, cfg.getint('osc_client', 'port')) + self.assertEqual('INFO', cfg.get('logging', 'level')) def test_suite(): testloader = unittest.TestLoader() diff --git a/src/tests/aksyfs/tests/test_aksyfuse.py b/src/tests/aksyfs/tests/test_aksyfuse.py index 0342b71..afc5d4f 100644 --- a/src/tests/aksyfs/tests/test_aksyfuse.py +++ b/src/tests/aksyfs/tests/test_aksyfuse.py @@ -14,11 +14,11 @@ class TestStatInfo(TestCase): def test_set_owner(self): common.StatInfo.set_owner(1, 1) - self.assertEquals(1, common.StatInfo.uid) - self.assertEquals(1, common.StatInfo.gid) + self.assertEqual(1, common.StatInfo.uid) + self.assertEqual(1, common.StatInfo.gid) info = common.StatInfo(0, 1) - self.assertEquals(1, info.st_uid) - self.assertEquals(1, info.st_gid) + self.assertEqual(1, info.st_uid) + self.assertEqual(1, info.st_gid) class TestDirStatInfo(TestCase): def test_stat_directory(self): @@ -29,7 +29,7 @@ class TestFileStatInfo(TestCase): def test_stat_file(self): info = common.FileStatInfo('test.akp', None) self.assertFalse(S_ISDIR(info.st_mode)) - self.assertEquals(16*1024, info.st_size) + self.assertEqual(16*1024, info.st_size) self.assertTrue(S_ISREG(info.st_mode)) class AksyFSTest(TestCase): #IGNORE:R0904 @@ -65,8 +65,8 @@ def test_readdir(self): def test_readdir_memory(self): memory = list(self.fs.readdir('/memory', 0)) - self.assertEquals(102, len(memory)) - self.assertEquals('Boo.wav', memory[0].name) + self.assertEqual(102, len(memory)) + self.assertEqual('Boo.wav', memory[0].name) def test_getattr_memory_non_existing(self): self.assertRaises(OSError, self.fs.getattr, '/memory/subdir') @@ -97,7 +97,7 @@ def test_readdir_disk_nested(self): def assert_dirlist(self, expected, actual): actual = [entry.name for entry in actual] - self.assertEquals(tuple(expected), tuple(actual)) + self.assertEqual(tuple(expected), tuple(actual)) def test_mkdir_unsupported(self): self.assertRaises(OSError, self.fs.mkdir, '/memory/subdir', 'mode_ignored') @@ -114,7 +114,7 @@ def test_mkdir(self): self.fs.mkdir(newdir, 'mode_ignored') self.assert_dirlist(('test',), self.fs.readdir('/disks/Samples disk/Songs', 0)) - self.assertNotEquals(None, self.fs.getattr(newdir)) + self.assertNotEqual(None, self.fs.getattr(newdir)) def test_open_disk(self): self.fs.getattr('/disks/Cdrom') @@ -127,7 +127,7 @@ def test_read(self): afile = aksyfuse.AksyFile('/memory/Sample99.wav', os.O_RDONLY|S_IRUSR) try: read = afile.read(4, 0) - self.assertEquals('RIFF', read) + self.assertEqual('RIFF', read) finally: afile.release('ignored') @@ -139,7 +139,7 @@ def test_mknod_write(self): afile.release('ignored') written = os.open(common._create_cache_path(path), os.O_RDONLY) try: - self.assertEquals('abc', os.read(written, 3)) + self.assertEqual('abc', os.read(written, 3)) finally: os.close(written) diff --git a/src/tests/aksyfs/tests/test_ftpd.py b/src/tests/aksyfs/tests/test_ftpd.py index 068e1a7..d6f05aa 100644 --- a/src/tests/aksyfs/tests/test_ftpd.py +++ b/src/tests/aksyfs/tests/test_ftpd.py @@ -23,7 +23,7 @@ def setUp(self): self.fs.getattr('/memory') def test_translate(self): - self.assertEquals('/disks/Z48/!@#$%.wav', + self.assertEqual('/disks/Z48/!@#$%.wav', self.fs.translate('/disks/Z48/!@#$%.wav')) def test_getattr(self): @@ -44,8 +44,8 @@ def test_listdir(self): def test_listdir_memory(self): memory = list(self.fs.listdir('/memory')) - self.assertEquals(102, len(memory)) - self.assertEquals('Boo.wav', memory[0]) + self.assertEqual(102, len(memory)) + self.assertEqual('Boo.wav', memory[0]) def test_getattr_memory_non_existing(self): self.assertRaises(OSError, self.fs.getattr, '/memory/subdir') @@ -75,7 +75,7 @@ def test_listdir_disk_nested(self): self.assert_dirlist(('Choir','A Sample.AKP','Sample.wav'), children) def assert_dirlist(self, expected, actual): - self.assertEquals(tuple(expected), tuple(actual)) + self.assertEqual(tuple(expected), tuple(actual)) def test_mkdir_unsupported(self): self.assertRaises(OSError, self.fs.mkdir, '/memory/subdir') @@ -92,7 +92,7 @@ def test_mkdir(self): self.fs.mkdir(newdir) self.assert_dirlist(('test',), self.fs.listdir('/disks/Samples disk/Songs')) - self.assertNotEquals(None, self.fs.getattr(newdir)) + self.assertNotEqual(None, self.fs.getattr(newdir)) def test_open_disk(self): self.fs.getattr('/disks/Cdrom') @@ -105,7 +105,7 @@ def test_read(self): f = self.fs.open('/memory/Sample100.wav', 'rb') try: read = f.read(4) - self.assertEquals('RIFF', read) + self.assertEqual('RIFF', read) finally: f.close() @@ -116,7 +116,7 @@ def test_mknod_write(self): f.close() written = os.open(common._create_cache_path(path), os.O_RDONLY) try: - self.assertEquals('abc', os.read(written, 3)) + self.assertEqual('abc', os.read(written, 3)) finally: os.close(written) diff --git a/src/tests/aksyosc/tests/test_connector.py b/src/tests/aksyosc/tests/test_connector.py index 51b460a..493b311 100644 --- a/src/tests/aksyosc/tests/test_connector.py +++ b/src/tests/aksyosc/tests/test_connector.py @@ -10,11 +10,11 @@ class OSCConnectorTest(TestCase): def test_creat_alt_req_msg(self): msg = connector.OSCConnector.create_alt_req_msg(1, CMDS, (), None) expected = '#bundle\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18/altoperations\x00\x00,iN\x00\x00\x00\x00\x01\x00\x00\x00 /sampletools/get_bit_depth\x00\x00,\x00\x00\x00' - self.assertEquals(str(expected), str(msg)) + self.assertEqual(str(expected), str(msg)) def test_parse_alt_req_msg(self): msg = connector.OSCConnector.create_alt_req_msg(1, CMDS, (), None) - self.assertEquals(['#bundle', 0L, ['/altoperations', ',iN', 1, None], + self.assertEqual(['#bundle', 0, ['/altoperations', ',iN', 1, None], ['/sampletools/get_bit_depth', ',']], decodeOSC(msg)) def test_suite(): diff --git a/src/tests/aksyosc/tests/test_handler.py b/src/tests/aksyosc/tests/test_handler.py index 4571d66..813fd2f 100644 --- a/src/tests/aksyosc/tests/test_handler.py +++ b/src/tests/aksyosc/tests/test_handler.py @@ -23,13 +23,13 @@ def testDispatch(self): message.setAddress("/transfertools/get") message.append("test.wav") response = self.handler.handle(message.getBinary()) - self.assertEquals([["transfertools", "get", ["test.wav"]]], self.sampler.recorded) + self.assertEqual([["transfertools", "get", ["test.wav"]]], self.sampler.recorded) expected = OSCMessage() expected.setAddress("/transfertools/get") expected.append(1) expected.append(2) expected.append('a string') - self.assertEquals(str(expected), response) + self.assertEqual(str(expected), response) def testDispatchInvalidAddress(self): message = OSCMessage() @@ -37,10 +37,10 @@ def testDispatchInvalidAddress(self): # should not throw resp = self.handler.handle(message.getBinary()) - self.assertEquals(str(resp), + self.assertEqual(str(resp), "/sampler/error\x00\x00,ss\x00Execution failed\x00\x00\x00\x00" "Invalid address: '/sample/play/invalid', should have two components\x00") - self.assertEquals([], self.sampler.recorded); + self.assertEqual([], self.sampler.recorded); def testDispatchUnknownCommand(self): message = OSCMessage() @@ -49,8 +49,8 @@ def testDispatchUnknownCommand(self): handler = SamplerCallbackManager(sampler) # should not throw resp = handler.handle(message.getBinary()) - self.assertEquals(resp, "/sampler/error\x00\x00,ss\x00Failed to execute command /sample/play\x00\x00a\x00\x00\x00") - self.assertEquals([], self.sampler.recorded); + self.assertEqual(resp, "/sampler/error\x00\x00,ss\x00Failed to execute command /sample/play\x00\x00a\x00\x00\x00") + self.assertEqual([], self.sampler.recorded); def test_suite(): testloader = TestLoader() diff --git a/src/tests/aksyosc/tests/test_osc.py b/src/tests/aksyosc/tests/test_osc.py index a44e409..76394e4 100644 --- a/src/tests/aksyosc/tests/test_osc.py +++ b/src/tests/aksyosc/tests/test_osc.py @@ -5,52 +5,52 @@ class OSCMessageTest(TestCase): def testEncodeDecodeInt(self): m = OSCMessage() m.append(1) - self.assertEquals(['', ',i', 1], decodeOSC(m.getBinary())) + self.assertEqual(['', ',i', 1], decodeOSC(m.getBinary())) def testEncodeDecodeString(self): m = OSCMessage() m.append("abc") - self.assertEquals(['', ',s', "abc"], decodeOSC(m.getBinary())) + self.assertEqual(['', ',s', "abc"], decodeOSC(m.getBinary())) def testEncodeDecodeBinaryString(self): m = OSCMessage() m.append("\x00\x01\x02") - self.assertEquals(['', ',b', "\x00\x01\02"], decodeOSC(m.getBinary())) + self.assertEqual(['', ',b', "\x00\x01\02"], decodeOSC(m.getBinary())) def testEncodeDecodeFloat(self): m = OSCMessage() m.append(1.0) - self.assertEquals(['', ',f', 1.0], decodeOSC(m.getBinary())) + self.assertEqual(['', ',f', 1.0], decodeOSC(m.getBinary())) def testEncodeDecodeLong(self): m = OSCMessage() - m.append(1L) - self.assertEquals(['', ',h', 1L], decodeOSC(m.getBinary())) + m.append(1) + self.assertEqual(['', ',h', 1], decodeOSC(m.getBinary())) def testEncodeDecodeTrue(self): m = OSCMessage() m.append(True) - self.assertEquals(['', ',T', True], decodeOSC(m.getBinary())) + self.assertEqual(['', ',T', True], decodeOSC(m.getBinary())) def testEncodeDecodeFalse(self): m = OSCMessage() m.append(False) - self.assertEquals(['', ',F', False], decodeOSC(m.getBinary())) + self.assertEqual(['', ',F', False], decodeOSC(m.getBinary())) def testEncodeDecodeNone(self): m = OSCMessage() m.append(None) - self.assertEquals(['', ',N', None], decodeOSC(m.getBinary())) + self.assertEqual(['', ',N', None], decodeOSC(m.getBinary())) def testEncodeDecodeIterable(self): m = OSCMessage() - m.append((False, (1L,))) - self.assertEquals(['', ',[F[h]]', [False, [1,],]], decodeOSC(m.getBinary())) + m.append((False, (1,))) + self.assertEqual(['', ',[F[h]]', [False, [1,],]], decodeOSC(m.getBinary())) def testAppendDecodeIterableEmpty(self): m = OSCMessage() m.append([]) - self.assertEquals(['',',[]',[]], decodeOSC(m.getBinary())) + self.assertEqual(['',',[]',[]], decodeOSC(m.getBinary())) def testDecodeOSCArrayUnbalanced(self): self.assertRaises(OSCException, decodeOSC, '\x00\x00\x00\x00,[[]') From 79e3989046101e463d8ffbf8ff85dfd12002e810 Mon Sep 17 00:00:00 2001 From: watzo Date: Tue, 14 Jun 2022 09:09:43 +0200 Subject: [PATCH 02/66] Update pyftpdlib to a version that supports Python 3 (#6) * fix indentation --- setup.py | 10 +++++----- src/aksyfs/ftpd.py | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 1c682b6..75ef14f 100755 --- a/setup.py +++ b/setup.py @@ -13,9 +13,9 @@ macros= [("AKSY_DEBUG", 0)] def install_requires(): - deps = ["pyftpdlib == 0.3"] + deps = ["pyftpdlib == 1.5.6"] if not platform.system() == "Windows": - deps.append("fuse-python >= 0.2pre3") + deps.append("fuse-python >= 0.2pre3") return deps def customize_for_platform(ext, compiler_type): @@ -39,7 +39,7 @@ def customize_for_platform(ext, compiler_type): libusb_base_dir = "/usr/local/libusb-1.0" if platform.system() == "Darwin": - libusb_base_dir = "/usr/local/Cellar/libusb-compat/0.1.5_1/" + libusb_base_dir = "/usr/local/Cellar/libusb-compat/0.1.5_1/" # ext.extra_link_args = ["-framework CoreFoundation IOKit"] ext.library_dirs = [os.path.join(libusb_base_dir, "lib")] @@ -90,7 +90,7 @@ def build_extension(self, ext): author_email = "walco+aksy@pitchdark.org", description = "Control S5000/S6000, Z4/Z8 and MPC4000 Akai sampler models with System Exclusive over USB", license = "GPL", - classifiers = filter(None, classifiers.split("\n")), + classifiers = [_f for _f in classifiers.split("\n") if _f], package_dir = {"": "src"}, packages = all_packages, package_data = {"aksui": ["ak.py.glade"]}, @@ -122,7 +122,7 @@ def build_extension(self, ext): }, extras_require = { 'FUSE-PYTHON': ["fuse-python >= 0.2pre3"], - 'PYFTPDLIB' : ["pyftpdlib == 0.3"], + 'PYFTPDLIB' : ["pyftpdlib == 1.5.6"], 'PYGTK' : ["pygtk"] }, test_suite = "tests" diff --git a/src/aksyfs/ftpd.py b/src/aksyfs/ftpd.py index 9cbf505..5ffb67c 100644 --- a/src/aksyfs/ftpd.py +++ b/src/aksyfs/ftpd.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from pyftpdlib import ftpserver +from pyftpdlib import filesystems from aksyfs import common from aksy.config import create_option_parser from aksy.device import Devices @@ -11,7 +11,7 @@ import logging LOG = logging.getLogger("aksy.aksyfs.ftpd") -class AksyFtpFS(common.AksyFS, ftpserver.AbstractedFS): +class AksyFtpFS(common.AksyFS, filesystems.AbstractedFS): def __call__(self): return AksyFtpFS(self.sampler) @@ -95,6 +95,7 @@ def glob1(self, dirname, pattern): Unlike glob.glob1 raises an exception if os.listdir() fails. """ names = self.listdir(dirname) + # TODO: check whether correct if pattern[0] != '.': names = [x for x in names if x[0] != '.'] return fnmatch.filter(names, pattern) From c2f16bddc94b60b5eda75a02bb0749aa88081f36 Mon Sep 17 00:00:00 2001 From: watzo Date: Tue, 14 Jun 2022 22:59:48 +0200 Subject: [PATCH 03/66] #6 API updates and updated byte conversion in C extension --- src/aksyx/aksyx.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/aksyx/aksyx.c b/src/aksyx/aksyx.c index 2fbde4f..6e570ce 100644 --- a/src/aksyx/aksyx.c +++ b/src/aksyx/aksyx.c @@ -199,7 +199,7 @@ static PyObject* AkaiSampler_execute(AkaiSampler* self, PyObject* args) { const int BUFF_SIZE = 8192; int bytes_read = 0, rc; - if (!PyArg_ParseTuple(args, "s#", &sysex.bytes, &sysex.length)) { + if (!PyArg_ParseTuple(args, "y#", &sysex.bytes, &sysex.length)) { return NULL; } @@ -220,7 +220,7 @@ static PyObject* AkaiSampler_execute(AkaiSampler* self, PyObject* args) { if (rc == AKSY_TRANSMISSION_ERROR) { ret = PyErr_Format(USBException, "Timeout waiting for sysex reply."); } else { - ret = Py_BuildValue("s#", buffer.bytes, bytes_read); + ret = Py_BuildValue("y#", buffer.bytes, bytes_read); } free(buffer.bytes); @@ -250,8 +250,7 @@ static PyMethodDef }; static PyTypeObject aksyx_AkaiSamplerType = { -PyObject_HEAD_INIT(NULL) -0, /*ob_size*/ +PyVarObject_HEAD_INIT(NULL, 0) "aksyx.AkaiSampler", /*tp_name*/ sizeof(AkaiSampler), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -294,10 +293,19 @@ NULL, /* tp_new is set on module init to prevent static PyMethodDef aksyx_methods[] = { { NULL } }; +static struct PyModuleDef aksyx = +{ + PyModuleDef_HEAD_INIT, + "aksyx", + "Aksy USB Extension.", + -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ + aksyx_methods +}; + #ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ #define PyMODINIT_FUNC void #endif -PyMODINIT_FUNC initaksyx(void) { +PyMODINIT_FUNC PyInit_aksyx(void) { PyObject* m; PyObject* loc_disk_id; PyObject* loc_mem_id; @@ -307,10 +315,13 @@ PyMODINIT_FUNC initaksyx(void) { aksyx_AkaiSamplerType.tp_new = PyType_GenericNew; - if (PyType_Ready(&aksyx_AkaiSamplerType) < 0) - return; + if (PyType_Ready(&aksyx_AkaiSamplerType) < 0) { + return NULL; + } + Py_INCREF(&aksyx_AkaiSamplerType); - m = Py_InitModule3("aksyx", aksyx_methods, "Aksy USB Extension."); + + m = PyModule_Create(&aksyx); loc_disk_id = Py_BuildValue("i", LOC_DISK); loc_mem_id = Py_BuildValue("i", LOC_MEMORY); @@ -346,4 +357,6 @@ PyMODINIT_FUNC initaksyx(void) { PyModule_AddObject(m, "USBException", USBException); PyModule_AddObject(m, "AkaiSampler", (PyObject *)&aksyx_AkaiSamplerType); + + return m; } From bb080480084446a06305b0324ea40b0c89e1c291 Mon Sep 17 00:00:00 2001 From: watzo Date: Tue, 14 Jun 2022 23:00:05 +0200 Subject: [PATCH 04/66] #6 More stuff in ignore list --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 08b6c70..de20035 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ dist/* build/* buildenv/* *.pyc -venv/ +venv*/ .idea/ +.DS_Store From db8b461b7b062ab03ca29670b94b8a7d853c6007 Mon Sep 17 00:00:00 2001 From: watzo Date: Tue, 14 Jun 2022 23:00:38 +0200 Subject: [PATCH 05/66] #6 Format changes --- src/aksy/devices/akai/mock_z48/sampler.py | 64 +++++++++++------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/aksy/devices/akai/mock_z48/sampler.py b/src/aksy/devices/akai/mock_z48/sampler.py index 8b667e1..670d1ce 100644 --- a/src/aksy/devices/akai/mock_z48/sampler.py +++ b/src/aksy/devices/akai/mock_z48/sampler.py @@ -12,7 +12,7 @@ class MockConnector(object): def __init__(self): self.sample_file = '' self.program_file = '' - + def get(self, filename, destpath=None, source=AkaiSampler.MEMORY): log.debug("Transferring file %s to host from source %i" % (filename, source)) try: @@ -24,19 +24,19 @@ def get(self, filename, destpath=None, source=AkaiSampler.MEMORY): raise model.SamplerException("Failed to get ", filename) def put(self, path, remote_name=None, destination=AkaiSampler.MEMORY): - log.debug("Transferring file %s to sampler at remote_name %s (%i)" + log.debug("Transferring file %s to sampler at remote_name %s (%i)" % (path, remote_name, destination)) - + def execute(self, command, args, request_id=0): log.debug("execute(%s, %s)" % (repr(command), repr(args),)) return None - + def close(self): log.debug("close()") - - + + class MockZ48(Z48): - def __init__(self, connector, debug=1): + def __init__(self, connector, debug=1): # TODO: enable call to super class c'tor Sampler.__init__(self, connector) self.connector = connector @@ -44,15 +44,15 @@ def __init__(self, connector, debug=1): self.setup_tools() self._patch_disktools_get_disklist() - + self._patch_systemtools() - - self.programtools.get_handles_names = lambda : (1, 'program', 2, 'program 2') - self.songtools.get_handles_names = lambda : (1, 'song',) - self.multitools.get_handles_names = lambda : (1, 'multi', 2, 'multi 2') - self.sampletools.get_handles_names = lambda : (1, 'sample', 2, 'sample 2') - self.recordingtools.get_name = lambda : 'sample' - + + self.programtools.get_handles_names = lambda: (1, 'program', 2, 'program 2') + self.songtools.get_handles_names = lambda: (1, 'song',) + self.multitools.get_handles_names = lambda: (1, 'multi', 2, 'multi 2') + self.sampletools.get_handles_names = lambda: (1, 'sample', 2, 'sample 2') + self.recordingtools.get_name = lambda: 'sample' + self.setup_model() self._populate_fs() @@ -60,46 +60,46 @@ def __init__(self, connector, debug=1): self._patch_rootdisk_getdir() def set_sample(self, sample): - self.connector.sample_file = sample + self.connector.sample_file = sample def set_program(self, program): - self.connector.program_file = program + self.connector.program_file = program def _populate_fs(self): mellotron_folder = model.Folder('Mellotron Samples') choir_folder = model.Folder('Choir') choir_folder.children.extend( (model.FileRef('Mellotron/Choir/Choir.AKM', 7102), - model.FileRef('Mellotron/Choir/Choir.AKP', 7707), - model.FileRef('Mellotron/Choir/Vox1.wav'),)) + model.FileRef('Mellotron/Choir/Choir.AKP', 7707), + model.FileRef('Mellotron/Choir/Vox1.wav'),)) mellotron_folder.children.extend( (choir_folder, - model.FileRef('Mellotron Samples/A Sample.AKP'), - model.FileRef('Mellotron Samples/Sample.wav'),)) - first_disk = self.disks.get_children()[0] + model.FileRef('Mellotron Samples/A Sample.AKP'), + model.FileRef('Mellotron Samples/Sample.wav'),)) + first_disk = self.disks.get_children()[0] first_disk.root.children = [model.Folder('Autoload'), - model.Folder('Songs')] + model.Folder('Songs')] self.disks.get_children()[1].root.children = [mellotron_folder] memory_items = [model.Sample("Boo", 1), - model.Multi("Default", 2),] + model.Multi("Default", 2), ] for i in range(0, 100): - memory_items.append(model.Sample("Sample%i" %i, i)) + memory_items.append(model.Sample("Sample%i" % i, i)) self.memory.set_children(memory_items) - self.memory.get_children()[0].get_modified = lambda : True + self.memory.get_children()[0].get_modified = lambda: True def _patch_disktools_get_disklist(self): - def get_disklist(): + def get_disklist(): return [(256, 1, 0, 3, True, "Samples disk"), (512, 1, 0, 3, False, "Cdrom")] - + self.disktools.get_disklist = get_disklist def _patch_systemtools(self): - self.systemtools.get_free_wave_mem_size = lambda : 4 - self.systemtools.get_wave_mem_size = lambda : 16 - + self.systemtools.get_free_wave_mem_size = lambda: 4 + self.systemtools.get_wave_mem_size = lambda: 16 + def _patch_rootdisk_getdir(self): def get_subdir(obj, path): for child in obj.get_children(): @@ -114,6 +114,6 @@ def get_dir(path): return folder self.disks.get_dir = get_dir - + def close(self): pass From bbdcf27a0e3c242fbd546f05b92cd096fce71d14 Mon Sep 17 00:00:00 2001 From: watzo Date: Thu, 16 Jun 2022 23:29:12 +0200 Subject: [PATCH 06/66] #6 Fix more byte string conversions --- src/aksyx/aksyx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aksyx/aksyx.c b/src/aksyx/aksyx.c index 6e570ce..838e621 100644 --- a/src/aksyx/aksyx.c +++ b/src/aksyx/aksyx.c @@ -184,7 +184,7 @@ static PyObject* AkaiSampler_get_panel_state(AkaiSampler* self) { if (rc == AKSY_TRANSMISSION_ERROR) { ret = PyErr_Format(USBException, "Timeout waiting for sysex reply."); } else { - ret = Py_BuildValue("(s#,s#)", pixel_data, PANEL_PIXEL_DATA_LENGTH, + ret = Py_BuildValue("(y#,y#)", pixel_data, PANEL_PIXEL_DATA_LENGTH, control_data, PANEL_CONTROL_DATA_LENGTH); } From b0ea6322dffc9a529f6360fb62170532670ea237 Mon Sep 17 00:00:00 2001 From: watzo Date: Thu, 16 Jun 2022 23:29:50 +0200 Subject: [PATCH 07/66] #6 I/O api update --- src/aksy/devices/akai/fileparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aksy/devices/akai/fileparser.py b/src/aksy/devices/akai/fileparser.py index 719723b..b6d18da 100644 --- a/src/aksy/devices/akai/fileparser.py +++ b/src/aksy/devices/akai/fileparser.py @@ -55,7 +55,7 @@ def parse_keygroups(self): return keygroups def parse(self, filename): - self.fh = file(filename, 'rb') + self.fh = open(filename, 'rb') self.chunks = self.parse_chunks(get_file_length(filename)) prg = Program(self.parse_keygroups()) return prg From 87f101f17047bd79bdb08bc4ea286694903b3f4b Mon Sep 17 00:00:00 2001 From: watzo Date: Thu, 16 Jun 2022 23:31:16 +0200 Subject: [PATCH 08/66] #6 2to3 changes (print statement and type updates) * not working yet; tests disabled; some todos added --- src/aksyosc/osc.py | 51 +++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/aksyosc/osc.py b/src/aksyosc/osc.py index 698ba6c..bd52e3a 100755 --- a/src/aksyosc/osc.py +++ b/src/aksyosc/osc.py @@ -46,10 +46,10 @@ def hexDump(bytes): for i in range(len(bytes)): sys.stdout.write("%2x " % (ord(bytes[i]))) if (i+1) % 8 == 0: - print repr(bytes[i-7:i+1]) + print(repr(bytes[i-7:i+1])) if(len(bytes) % 8 != 0): - print "".rjust(11), repr(bytes[i-7:i+1]) + print("".rjust(11), repr(bytes[i-7:i+1])) def string_encodeable(str): return str.find('\x00') == -1 @@ -109,7 +109,7 @@ def readBlob(data): def readInt(data): if(len(data)<4): - print "Error: too few bytes for int", data, len(data) + print("Error: too few bytes for int", data, len(data)) rest = data integer = 0 else: @@ -131,18 +131,18 @@ def readOSCTime(data): """Tries to interpret the next 8 bytes of the data as a 64-bit signed integer.""" high, low = struct.unpack(">ll", data[0:8]) - big = (long(high) << 32) + low + big = (int(high) << 32) + low rest = data[8:] return (big, rest) def readLong(data): assert len(data) >= 8 long = struct.unpack(">q", data[0:8])[0] - return (long, data[8:]) + return (int, data[8:]) def readFloat(data): if(len(data)<4): - print "Error: too few bytes for float", data, len(data) + print("Error: too few bytes for float", data, len(data)) rest = data f = 0 else: @@ -188,7 +188,8 @@ def OSCArgument(next): elif next is False: binary = "" tag = "F" - elif isinstance(next, types.StringType): + # TODO this should be simplified + elif isinstance(next, bytes): if not string_encodeable(next): tag, binary = OSCBlob(next) else: @@ -201,7 +202,7 @@ def OSCArgument(next): elif isinstance(next, int): binary = struct.pack(">i", next) tag = "i" - elif isinstance(next, long): + elif isinstance(next, int): binary = struct.pack(">q", next) tag = "h" else: @@ -290,11 +291,11 @@ def dispatch(self, message): try: address = message[0] self.callbacks[address](message) - except KeyError, e: + except KeyError as e: # address not found - print "Address ", address, " not found." - except None, e: - print "Exception in", address, "callback :", e + print("Address ", address, " not found.") + except None as e: + print("Exception in", address, "callback :", e) return @@ -316,7 +317,7 @@ def unbundler(self, messages): if __name__ == "__main__": hexDump("Welcome to the OSC testing program.") - print + print() message = OSCMessage() message.setAddress("/foo/play") message.append(44) @@ -325,7 +326,7 @@ def unbundler(self, messages): message.append("the white cliffs of dover") hexDump(message.getBinary()) - print "Making and unmaking a message.." + print("Making and unmaking a message..") strings = OSCMessage() strings.append("Mary had a little lamb") @@ -340,26 +341,26 @@ def unbundler(self, messages): hexDump(raw) - print "Retrieving arguments..." + print("Retrieving arguments...") data = raw for i in range(6): text, data = readString(data) - print text + print(text) number, data = readFloat(data) - print number + print(number) number, data = readFloat(data) - print number + print(number) number, data = readInt(data) - print number + print(number) hexDump(raw) - print decodeOSC(raw) - print decodeOSC(message.getBinary()) + print(decodeOSC(raw)) + print(decodeOSC(message.getBinary())) - print "Testing Blob types." + print("Testing Blob types.") blob = OSCMessage() blob.append("", "b") @@ -372,7 +373,7 @@ def unbundler(self, messages): hexDump(blob.getBinary()) - print decodeOSC(blob.getBinary()) + print(decodeOSC(blob.getBinary())) def printingCallback(stuff): sys.stdout.write("Got: ") @@ -380,7 +381,7 @@ def printingCallback(stuff): sys.stdout.write(str(i) + " ") sys.stdout.write("\n") - print "Testing the callback manager." + print("Testing the callback manager.") c = CallbackManager() c.add(printingCallback, "/print") @@ -407,5 +408,5 @@ def printingCallback(stuff): bundlebinary = bundle.message - print "sending a bundle to the callback manager" + print("sending a bundle to the callback manager") c.handle(bundlebinary) From 981435963535110696c96f9d8544235849f26d83 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 04:33:39 +0200 Subject: [PATCH 09/66] #6 fix byte encoding and fix string conversions --- src/aksy/devices/akai/filebuilder.py | 12 ++++++------ src/aksy/devices/akai/fileparser.py | 12 +++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/aksy/devices/akai/filebuilder.py b/src/aksy/devices/akai/filebuilder.py index 5337620..4253f81 100644 --- a/src/aksy/devices/akai/filebuilder.py +++ b/src/aksy/devices/akai/filebuilder.py @@ -20,10 +20,10 @@ def write(self, program, fh): class ProgramBuilder: def build(self, program): return struct.pack('<4sl8sl6b 4sl8b 4sl24b', - 'RIFF', + b'RIFF', 0, - 'APRG' - 'prg ', + b'APRG' + b'prg ', 6, 1, # set to zero program was not read... program.midi_prog_no, @@ -31,7 +31,7 @@ def build(self, program): 0, 0, 0, - 'out ', + b'out ', 8, 0, program.loudness, @@ -41,7 +41,7 @@ def build(self, program): program.pan_mod2, program.pan_mod3, program.velo_sens, - 'tune', + b'tune', 24, 0, program.semi, @@ -116,7 +116,7 @@ def build(self, zone): return create_chunk('zone', '<2b20s22bh2b', 0, len(zone.samplename), - zone.samplename, + zone.samplename.encode('ascii'), 0, 0, 0, diff --git a/src/aksy/devices/akai/fileparser.py b/src/aksy/devices/akai/fileparser.py index b6d18da..8328cc8 100644 --- a/src/aksy/devices/akai/fileparser.py +++ b/src/aksy/devices/akai/fileparser.py @@ -1,5 +1,5 @@ import os, struct -from io import StringIO +from io import BytesIO from aksy.devices.akai.filemodel import Zone, Program, Chunk, Keygroup def parse_byte(chunk, offset): @@ -9,9 +9,8 @@ def parse_string(chunk, offset, length=None): if length is None: length = struct.unpack('B', chunk[offset:offset+1])[0] offset += 1 - - return length, struct.unpack('%is' %length, chunk[offset: offset+length])[0] - + return length, chunk[offset: offset+length].decode('ascii') + class ChunkParser: def parse(self, fh, offset): bytes_read = fh.read(4) @@ -74,9 +73,8 @@ def parse_zones(self, chunks): return zones def parse(self, chunk): - chunks = self.chunkParser.parse_chunks(StringIO(chunk.bytes), 0, chunk.get_content_length()) - kg = Keygroup(self.parse_zones(chunks)) - return kg + chunks = self.chunkParser.parse_chunks(BytesIO(chunk.bytes), 0, chunk.get_content_length()) + return Keygroup(self.parse_zones(chunks)) class ZoneParser: def parse(self, chunk): From 6d21fc546b2b9c6c4d81209a148b3a2da00a697a Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 04:34:46 +0200 Subject: [PATCH 10/66] #6 fix byte encoding by an already fixed method in the sysex module --- src/tests/aksy/devices/akai/replayingconnector.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tests/aksy/devices/akai/replayingconnector.py b/src/tests/aksy/devices/akai/replayingconnector.py index 19f113f..5da43a4 100644 --- a/src/tests/aksy/devices/akai/replayingconnector.py +++ b/src/tests/aksy/devices/akai/replayingconnector.py @@ -10,11 +10,10 @@ LOG = logging.getLogger("aksy.devices.akai.replaying_connector") + def encode(byte_str): - s = io.StringIO(len(byte_str)) - for b in byte_str: - s.write(struct.pack("1B", int(b, 16))) - return s.getvalue() + return sysex.repr_bytes(byte_str) + class ReplayingConnector(object): """ A connector that replays aksy logs. From 41c8cbe9f02d7584727e8f3bb59317323b785fee Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 04:43:38 +0200 Subject: [PATCH 11/66] #6 introduce byte literals; fix byte wise comparisons two python3 gotchas fixed: * indexing bytes yields integers; compare as sliced sequence instead * bytes.extends pushes integers in the list; replaced by pushing a multi-byte sequence as a single item; later joined back together --- src/aksy/devices/akai/sysex.py | 92 +++++++------ .../aksy/devices/akai/tests/test_sysex.py | 130 +++++++++--------- 2 files changed, 114 insertions(+), 108 deletions(-) diff --git a/src/aksy/devices/akai/sysex.py b/src/aksy/devices/akai/sysex.py index 3acea0f..4e468ac 100644 --- a/src/aksy/devices/akai/sysex.py +++ b/src/aksy/devices/akai/sysex.py @@ -2,14 +2,14 @@ from aksy.devices.akai import sysex_types, model from aksy.devices.akai.sysex_types import START_SYSEX, END_SYSEX -AKAI_ID = '\x47' -Z48_ID = '\x5f' -S56K_ID = '\x5e' +AKAI_ID = b'\x47' +Z48_ID = b'\x5f' +S56K_ID = b'\x5e' -REPLY_ID_OK = '\x4f' -REPLY_ID_DONE = '\x44' -REPLY_ID_REPLY = '\x52' -REPLY_ID_ERROR = '\x45' +REPLY_ID_OK = b'\x4f' +REPLY_ID_DONE = b'\x44' +REPLY_ID_REPLY = b'\x52' +REPLY_ID_ERROR = b'\x45' log = logging.getLogger("aksy") @@ -34,13 +34,15 @@ def create_arg_bytes(self, args): """Returns the sysex byte sequence for the command arg data - """ bytes = [] - for sysex_type, arg in zip(self.arg_types, args): - bytes.append(sysex_type.encode(arg)) + + for i, sysex_type in enumerate(self.arg_types): + bytes.append(sysex_type.encode(args[i])) if len(bytes) == 0: return None else: - return bytes + return b''.join(bytes) + class Request: """ Encapsulates a sysex request @@ -56,37 +58,36 @@ def _create_bytes(self, command, args, request_id): bytes.append(command.id) data = command.create_arg_bytes(args) if data is not None: - bytes.extend(data) + bytes.append(data) bytes.append(END_SYSEX) - return ''.join(bytes) + return b''.join(bytes) def _create_start_bytes(self, command, request_id): - bytes = [START_SYSEX, AKAI_ID] - bytes.append(command.device_id) - bytes.append(command.userref_type.encode(request_id)) - return bytes - + return [START_SYSEX, AKAI_ID, command.device_id, command.userref_type.encode(request_id)] + def get_bytes(self): return self.bytes def __repr__(self): return repr([ "%02x" %byte for byte in struct.unpack(str(len(self.bytes)) + 'B', self.bytes)]) + + class AlternativeRequest(Request): - SECTION_SAMPLE = '\x60' - SECTION_KEYGROUP = '\x61' - SECTION_PROGRAM = '\x62' - SECTION_MULTI = '\x63' - SECTION_MULTIFX = '\x64' - SECTION_SONG = '\x65' - - BASE_SECTION_SAMPLE = '\x1c' - BASE_SECTION_KEYGROUP = '\x0c' - BASE_SECTION_PROGRAM = '\x14' - BASE_SECTION_MULTI = '\x18' - BASE_SECTION_MULTIFX = '\x25' - BASE_SECTION_SONG = '\x28' + SECTION_SAMPLE = b'\x60' + SECTION_KEYGROUP = b'\x61' + SECTION_PROGRAM = b'\x62' + SECTION_MULTI = b'\x63' + SECTION_MULTIFX = b'\x64' + SECTION_SONG = b'\x65' + + BASE_SECTION_SAMPLE = b'\x1c' + BASE_SECTION_KEYGROUP = b'\x0c' + BASE_SECTION_PROGRAM = b'\x14' + BASE_SECTION_MULTI = b'\x18' + BASE_SECTION_MULTIFX = b'\x25' + BASE_SECTION_SONG = b'\x28' BASE_ALT_SECTION_MAP = { BASE_SECTION_SAMPLE : SECTION_SAMPLE, @@ -110,18 +111,21 @@ def __init__(self, handle, commands, args, index=None, request_id=0): for i, command in enumerate(commands): if len(command.arg_types) > 0: - data = ''.join(command.create_arg_bytes(args[i])) + data = command.create_arg_bytes(args[i]) bytes.append(sysex_types.BYTE.encode(len(data) + 1)) else: - data = [] + data = b'' bytes.append(sysex_types.BYTE.encode(1)) - bytes.append(command.id[1]) - bytes.extend(data) - - + bytes.append(command.id[1:2]) + bytes.append(data) + bytes.append(END_SYSEX) - self.bytes = ''.join(bytes) + + try: + self.bytes = b''.join(bytes) + except TypeError as e: + raise Exception(f'byte conv issue {bytes}') from e def find_section_ids(self, command_id, no_sections): section_id = sysex_types.BYTE.decode(command_id[:1], False) @@ -132,7 +136,7 @@ def find_section_ids(self, command_id, no_sections): return alt_section, sysex_types.BYTE.encode(i) raise model.SamplerException("No alternative operations defined for %s" % - repr(command_id[:1])) + repr(command_id[:1])) class Reply: @@ -141,7 +145,7 @@ class Reply: def __init__(self, bytes, command, alt_request=False): self.bytes = bytes self.command = command - self.request_id = 0 + self.request_id = 0 self.alt_request = alt_request self.return_value = self._parse() @@ -155,8 +159,8 @@ def _parse(self): """ Parses the command sequence """ - if self.bytes[0] != START_SYSEX or self.bytes[-1] != END_SYSEX: - raise ParseException("Invalid system exclusive string received") + if self.bytes[0:1] != START_SYSEX or self.bytes[-1:] != END_SYSEX: + raise ParseException("Invalid system exclusive string received", self.bytes[-1:]) # keep alive message if len(self.bytes) == 2: return None @@ -165,7 +169,7 @@ def _parse(self): i += len(self.command.device_id) len_userref, self.request_id = self.command.userref_type.decode(self.bytes[i:]) i += len_userref - reply_id = self.bytes[i] + reply_id = self.bytes[i:i+1] i += 1 # skip past the reply code command = self.bytes[i:i+2] i += len(self.command.id) # skip past the command id (section, item, optional subcmd) @@ -201,8 +205,10 @@ class ParseException(Exception): def byte_repr(bytes): return repr([ "%02x" %byte for byte in struct.unpack(str(len(bytes)) + 'B', bytes)]) + def repr_bytes(bytes): - return ''.join([struct.pack('1B', int(byte, 16)) for byte in bytes]) + return b''.join([struct.pack('1B', int(byte, 16)) for byte in bytes]) + def _to_string(ordvalues): """Method to quickly convert to a string diff --git a/src/tests/aksy/devices/akai/tests/test_sysex.py b/src/tests/aksy/devices/akai/tests/test_sysex.py index 4fb84f7..ebea6b0 100644 --- a/src/tests/aksy/devices/akai/tests/test_sysex.py +++ b/src/tests/aksy/devices/akai/tests/test_sysex.py @@ -2,85 +2,88 @@ from aksy.devices.akai import sysex, sysex_types, model log = logging.getLogger("aksy") + + class TestCommand(unittest.TestCase): def test_create_arg_bytes(self): #IGNORE:W0212 - dcmd = sysex.Command(sysex.Z48_ID, '\x20\x05', 'dummy', 'dummy', (sysex_types.BYTE,), None) + dcmd = sysex.Command(sysex.Z48_ID, b'\x20\x05', 'dummy', 'dummy', (sysex_types.BYTE,), None) + class TestRequest(unittest.TestCase): def testCreateRequest(self): # Select disk - command = sysex.Command('\x5f', '\x20\x02', 'disktools', 'select_disk', (sysex_types.WORD,), None) + command = sysex.Command(b'\x5f', b'\x20\x02', 'disktools', 'select_disk', (sysex_types.WORD,), None) bytes = sysex.Request(command, (256,)).get_bytes() self.assertEqual( - '\xf0\x47\x5f\x00\x20\x02\x00\x02\xf7', bytes) + b'\xf0\x47\x5f\x00\x20\x02\x00\x02\xf7', bytes) # Select root folder: folder = '' - command = sysex.Command('\x5f', '\x20\x13', 'disktools', 'open_folder', (sysex_types.STRING,), None) + command = sysex.Command(b'\x5f', b'\x20\x13', 'disktools', 'open_folder', (sysex_types.STRING,), None) bytes = sysex.Request(command, (folder,)).get_bytes() self.assertEqual( - '\xf0\x47\x5f\x00\x20\x13\x00\xf7', bytes) + b'\xf0\x47\x5f\x00\x20\x13\x00\xf7', bytes) # Select autoload folder: folder = 'autoload' - command = sysex.Command('\x5f', '\x20\x13', 'disktools', 'open_folder', (sysex_types.STRING,), None) + command = sysex.Command(b'\x5f', b'\x20\x13', 'disktools', 'open_folder', (sysex_types.STRING,), None) bytes = sysex.Request(command, (folder,)).get_bytes() self.assertEqual( - '\xf0\x47\x5f\x00\x20\x13\x61\x75\x74\x6f\x6c\x6f\x61\x64\x00\xf7', bytes) + b'\xf0\x47\x5f\x00\x20\x13\x61\x75\x74\x6f\x6c\x6f\x61\x64\x00\xf7', bytes) def testRequestWithNondefaultUserref(self): # slightly theoretical, because the z48 doesn't process these requests as expected - command = sysex.Command('\x5f', '\x07\x01', 'disktools', 'get_sampler_name', (),(sysex_types.STRING,), sysex_types.USERREF) + command = sysex.Command(b'\x5f', b'\x07\x01', 'disktools', 'get_sampler_name', (),(sysex_types.STRING,), sysex_types.USERREF) bytes = sysex.Request(command, (), request_id=129).get_bytes() self.assertEqual( - '\xf0\x47\x5f\x20\x01\x01\x07\x01\xf7', bytes) + b'\xf0\x47\x5f\x20\x01\x01\x07\x01\xf7', bytes) def testCreateS56KRequest(self): - command = sysex.Command('\x5e', '\x07\x01', 'disktools', 'get_sampler_name', (),(sysex_types.STRING,), sysex_types.S56K_USERREF) + command = sysex.Command(b'\x5e', b'\x07\x01', 'disktools', 'get_sampler_name', (),(sysex_types.STRING,), sysex_types.S56K_USERREF) bytes = sysex.Request(command, ()).get_bytes() self.assertEqual( - '\xf0\x47\x5e\x20\x00\x00\x07\x01\xf7', bytes) + b'\xf0\x47\x5e\x20\x00\x00\x07\x01\xf7', bytes) class TestReply(unittest.TestCase): def createCommand(self): - return sysex.Command(sysex.Z48_ID, '\x20\x05', 'dummy', 'dummy', (), (sysex_types.BYTE,)) + return sysex.Command(sysex.Z48_ID, b'\x20\x05', 'dummy', 'dummy', (), (sysex_types.BYTE,)) def testCreateReply(self): - DEFAULT_USERREF = '\x00' + DEFAULT_USERREF = b'\x00' bytes = (sysex.START_SYSEX, sysex.AKAI_ID, sysex.Z48_ID, DEFAULT_USERREF, - sysex.REPLY_ID_REPLY, '\x20\x05', '\x01', sysex.END_SYSEX) - dcmd = sysex.Command(sysex.Z48_ID, '\x20\x05', 'dummy', 'dummy', (), (sysex_types.BYTE,)) - reply = sysex.Reply(''.join(bytes), dcmd) + sysex.REPLY_ID_REPLY, b'\x20\x05', b'\x01', sysex.END_SYSEX) + dcmd = sysex.Command(sysex.Z48_ID, b'\x20\x05', 'dummy', 'dummy', (), (sysex_types.BYTE,)) + reply = sysex.Reply(b''.join(bytes), dcmd) self.assertEqual(1, reply.get_return_value()) bytes = ( - sysex.START_SYSEX, sysex.AKAI_ID, '\x5e\x20', '\x00', - sysex.REPLY_ID_REPLY, '\x20\x05', '\x01', sysex.END_SYSEX) - custom_cmd = sysex.Command('\x5e\x20', '\x20\x05', 'disktools', 'dummy', (),(sysex_types.BYTE,)) - reply = sysex.Reply(''.join(bytes), custom_cmd) + sysex.START_SYSEX, sysex.AKAI_ID, b'\x5e\x20', b'\x00', + sysex.REPLY_ID_REPLY, b'\x20\x05', b'\x01', sysex.END_SYSEX) + custom_cmd = sysex.Command(b'\x5e\x20', b'\x20\x05', 'disktools', 'dummy', (),(sysex_types.BYTE,)) + reply = sysex.Reply(b''.join(bytes), custom_cmd) self.assertEqual(1, reply.get_return_value()) dcmd.reply_spec = (sysex_types.WORD, sysex_types.BYTE, sysex_types.BYTE, sysex_types.BYTE, sysex_types.BYTE, sysex_types.STRING) bytes = ( - sysex.START_SYSEX, sysex.AKAI_ID, sysex.Z48_ID, '\x00', - sysex.REPLY_ID_REPLY, '\x20\x05', '\x00','\x02\x01\x02', '\x00', - '\x01\x5a\x34\x38\x20\x26\x20\x4d\x50\x43\x34\x4b', '\x00', sysex.END_SYSEX) - reply = sysex.Reply(''.join(bytes), dcmd) + sysex.START_SYSEX, sysex.AKAI_ID, sysex.Z48_ID, b'\x00', + sysex.REPLY_ID_REPLY, b'\x20\x05', b'\x00', b'\x02\x01\x02', b'\x00', + b'\x01\x5a\x34\x38\x20\x26\x20\x4d\x50\x43\x34\x4b', b'\x00', sysex.END_SYSEX) + reply = sysex.Reply(b''.join(bytes), dcmd) self.assertEqual((256, 1, 2, 0, 1, 'Z48 & MPC4K'), reply.get_return_value()) # Future: should raise unknown disk error - dcmd.id = '\x20\x05' + dcmd.id = b'\x20\x05' dcmd.reply_spec = () - bytes = '\xf0G_\x00E \x00\x00\x03\xf7' + bytes = b'\xf0G_\x00E \x00\x00\x03\xf7' self.assertRaises(model.SamplerException, sysex.Reply, bytes, dcmd) # using pad type if we encounter bytes not according to specification - dcmd.id = '\x20\x10' + dcmd.id = b'\x20\x10' dcmd.reply_spec = None bytes = ( sysex.START_SYSEX, sysex.AKAI_ID, sysex.Z48_ID, - '\x00', sysex.REPLY_ID_REPLY, '\x20\x10', '\x02', - '\x15', '\x00', '\xf7') - reply = sysex.Reply(''.join(bytes), dcmd) + b'\x00', sysex.REPLY_ID_REPLY, b'\x20\x10', b'\x02', + b'\x15', b'\x00', b'\xf7') + reply = sysex.Reply(b''.join(bytes), dcmd) self.assertEqual(21, reply.get_return_value()) # not possible yet how to deal with the dump request replies @@ -89,105 +92,102 @@ def testCreateReply(self): + 'R\x10 i\x01\xf7', dcmd) # reply on 'bulk command 10 05' 10 0a 00 f0 47 5e 20 00 00 10 05 15 f7 - dcmd.id = '\x10\x05' + dcmd.id = b'\x10\x05' dcmd.reply_spec = (sysex_types.WORD, sysex_types.BYTE, sysex_types.BYTE, sysex_types.BYTE, sysex_types.BYTE, sysex_types.STRING) - bytes = '\xf0\x47\x5f\x00\x52\x10\x05\x00\x02\x01\x02\x00\x01\x5a\x34\x38\x20\x26\x20\x4d\x50\x43\x34\x4b\x00\xf7' + bytes = b'\xf0\x47\x5f\x00\x52\x10\x05\x00\x02\x01\x02\x00\x01\x5a\x34\x38\x20\x26\x20\x4d\x50\x43\x34\x4b\x00\xf7' reply = sysex.Reply(bytes, dcmd) self.assertEqual((256, 1, 2, 0, 1, 'Z48 & MPC4K'), reply.get_return_value()) - dcmd.id = '\x10\x22' - bytes = '\xf0\x47\x5f\x00\x52\x10\x22\x4d\x65\x6c\x6c\x20\x53\x74\x72\x69\x6e\x67\x20\x41\x32\x2e\x77\x61\x76\x00\xf7' + dcmd.id = b'\x10\x22' + bytes = b'\xf0\x47\x5f\x00\x52\x10\x22\x4d\x65\x6c\x6c\x20\x53\x74\x72\x69\x6e\x67\x20\x41\x32\x2e\x77\x61\x76\x00\xf7' dcmd.reply_spec = (sysex_types.STRING,) reply = sysex.Reply(bytes, dcmd) self.assertEqual('Mell String A2.wav', reply.get_return_value()) - dcmd.id = '\x10\x22' - bytes = '\xf0\x47\x5f\x00\x52\x10\x22\x4d\x65\x6c\x6c\x6f\x74\x72\x6f\x6e\x20\x53\x74\x72\x69\x6e\x67\x73\x2e\x61\x6b\x70\x00\xf7' + dcmd.id = b'\x10\x22' + bytes = b'\xf0\x47\x5f\x00\x52\x10\x22\x4d\x65\x6c\x6c\x6f\x74\x72\x6f\x6e\x20\x53\x74\x72\x69\x6e\x67\x73\x2e\x61\x6b\x70\x00\xf7' dcmd.reply_spec = (sysex_types.STRING,) reply = sysex.Reply(bytes, dcmd) self.assertEqual('Mellotron Strings.akp', reply.get_return_value()) - dcmd.id = '\x07\x01' - bytes = '\xf0\x47\x5f\x00\x52\x07\x01\x08\x5a\x38\x20\x53\x61\x6d\x70\x6c\x65\x72\x00\xf7' + dcmd.id = b'\x07\x01' dcmd.reply_spec = (sysex_types.STRING,) - reply = sysex.Reply(bytes, dcmd) + reply = sysex.Reply(b'\xf0\x47\x5f\x00\x52\x07\x01\x08\x5a\x38\x20\x53\x61\x6d\x70\x6c\x65\x72\x00\xf7', dcmd) self.assertEqual('Z8 Sampler', reply.get_return_value()) - bytes = '\xf0G_\x00E\x1eJ\x00\x00\xf7' - self.assertRaises(NotImplementedError, sysex.Reply, bytes, self.createCommand()) + self.assertRaises(NotImplementedError, sysex.Reply, b'\xf0G_\x00E\x1eJ\x00\x00\xf7', self.createCommand()) def testParseFileNotFound(self): - bytes = '\xf0G_\x00E\x1eJ\x01\x02\xf7' - self.assertRaises(IOError, sysex.Reply, bytes, self.createCommand()) + self.assertRaises(IOError, sysex.Reply, b'\xf0G_\x00E\x1eJ\x01\x02\xf7', self.createCommand()) def testParseUserRef(self): - cmd = sysex.Command(sysex.S56K_ID, '\x07\x01', 'dummy', 'dummy', (), (sysex_types.BYTE,), sysex_types.S56K_USERREF) - bytes = '\xf0\x47\x5e\x20\x7e\x00\x52\x07\x01\x08\x5a\x38\x20\x53\x61\x6d\x70\x6c\x65\x72\x00\xf7' + cmd = sysex.Command(sysex.S56K_ID, b'\x07\x01', 'dummy', 'dummy', (), (sysex_types.BYTE,), sysex_types.S56K_USERREF) + bytes = b'\xf0\x47\x5e\x20\x7e\x00\x52\x07\x01\x08\x5a\x38\x20\x53\x61\x6d\x70\x6c\x65\x72\x00\xf7' reply = sysex.Reply(bytes, cmd) self.assertEqual(126, reply.get_request_id()) def testParseExtendedDisklist(self): - bytes = sysex.repr_bytes( + reply_bytes = sysex.repr_bytes( ['f0', '47', '5e', '20', '00', '00', '52', '10', '05', '01', '00', '00', '08', '00', '01', '4e', '6f', '20', '64', '69', '73', '6b', '00', '01', '01', '03', '08', '01', '00', '4e', '6f', '20', '64', '69', '73', '6b', '00', '01', '02', '03', '08', '02', '00', '4e', '6f', '20', '64', '69', '73', '6b', '00', '02', '03', '03', '01', '04', '01', '4e', '6f', '20', '44', '69', '73', '6b', '20', '4e', '61', '6d', '65', '00', 'f7']) - cmd = sysex.Command(sysex.S56K_ID, '\x10\x05', 'dummy', 'dummy', (),( + cmd = sysex.Command(sysex.S56K_ID, b'\x10\x05', 'dummy', 'dummy', (),( sysex_types.DISKLIST,), sysex_types.USERREF) - reply = sysex.Reply(bytes, cmd) + reply = sysex.Reply(reply_bytes, cmd) self.assertEqual( ((1, 0, 8, 0, 1, 'No disk'), (129, 3, 8, 1, 0, 'No disk'), (257, 3, 8, 2, 0, 'No disk'), (386, 3, 1, 4, 1, 'No Disk Name')) , reply.get_return_value()) def testParseEchoReply(self): - bytes = sysex.repr_bytes( + reply_bytes = sysex.repr_bytes( ['f0', '47', '5f', '00', '52', '00', '06', '0b', '01', '01', '01', '01', 'f7']) - cmd = sysex.Command(sysex.Z48_ID, '\x00\x06', 'sysextools', 'query', (), None) - reply = sysex.Reply(bytes, cmd) + cmd = sysex.Command(sysex.Z48_ID, b'\x00\x06', 'sysextools', 'query', (), None) + reply = sysex.Reply(reply_bytes, cmd) self.assertEqual((1,1,1,1), reply.get_return_value()) def testParseHandleNameArray(self): - bytes = sysex.repr_bytes(['F0','47','5F','00','52','14','02','20','08','44', + cmd_bytes = sysex.repr_bytes(['F0','47','5F','00','52','14','02','20','08','44', '72','79','20','4B','69','74','20','30','32','00','08','50','72','6F','67','72','61','6D','20','31','00', '08','53','79','6E','74','68','54','65','73','74','00','F7']) - cmd = sysex.Command(sysex.Z48_ID, '\x14\x02\02', 'programtools', 'get_handles_names', (), None) - reply = sysex.Reply(bytes, cmd) + cmd = sysex.Command(sysex.Z48_ID, b'\x14\x02\02', 'programtools', 'get_handles_names', (), None) + reply = sysex.Reply(cmd_bytes, cmd) self.assertEqual(('Dry Kit 02', 'Program 1', 'SynthTest'), reply.get_return_value()) class TestAlternativeRequest(unittest.TestCase): def test_no_args(self): - cmd = sysex.Command(sysex.Z48_ID, '\x1F\x50', 'sampletools', 'get_sample_length', (), None) + cmd = sysex.Command(sysex.Z48_ID, b'\x1F\x50', 'sampletools', 'get_sample_length', (), None) req = sysex.AlternativeRequest(65536, [cmd], []) - self.assertEqual('\xf0G_\x00`\x03\x00\x00\x04\x00\x01P\xf7', req.get_bytes()) + self.assertEqual(b'\xf0G_\x00`\x03\x00\x00\x04\x00\x01P\xf7', req.get_bytes()) def test_with_args(self): - cmd = sysex.Command('_', '\x1E\x26', 'programtools', 'set_playback_mode', (sysex_types.BYTE,), None) + cmd = sysex.Command(b'_', b'\x1E\x26', 'programtools', 'set_playback_mode', (sysex_types.BYTE,), None) req = sysex.AlternativeRequest(65536, [cmd, cmd], [[1],[2]]) - self.assertEqual('\xf0G_\x00`\x02\x00\x00\x04\x00\x02&\x01\x02&\x02\xf7', req.get_bytes()) + self.assertEqual(b'\xf0G_\x00`\x02\x00\x00\x04\x00\x02&\x01\x02&\x02\xf7', req.get_bytes()) def test_with_multiple_args(self): - cmd = sysex.Command('_', '\x0E\x09', 'programtools', 'set_mod_start', (sysex_types.BYTE, sysex_types.SWORD), None) + cmd = sysex.Command(b'_', b'\x0E\x09', 'programtools', 'set_mod_start', (sysex_types.BYTE, sysex_types.SWORD), None) req = sysex.AlternativeRequest(65536, [cmd, cmd], [[1,1],[1,2]]) - self.assertEqual('\xf0G_\x00a\x02\x00\x00\x04\x00\x05\t\x01\x00\x01\x00\x05\t\x01\x00\x02\x00\xf7', req.get_bytes()) - + self.assertEqual(b'\xf0G_\x00a\x02\x00\x00\x04\x00\x05\t\x01\x00\x01\x00\x05\t\x01\x00\x02\x00\xf7', req.get_bytes()) + def test_keygroup_index(self): - cmd = sysex.Command('_', '\x13\x30', 'programtools', 'get_envelope_rate1', (sysex_types.BYTE,), None) + cmd = sysex.Command(b'_', b'\x13\x30', 'programtools', 'get_envelope_rate1', (sysex_types.BYTE,), None) req = sysex.AlternativeRequest(65536, [cmd, cmd], [[1],[2]], index=3) - self.assertEqual('\xf0G_\x00a\x07\x00\x00\x04\x00\x03\x020\x01\x020\x02\xf7', req.get_bytes()) + self.assertEqual(b'\xf0G_\x00a\x07\x00\x00\x04\x00\x03\x020\x01\x020\x02\xf7', req.get_bytes()) class TestModuleMethods(unittest.TestCase): def test_byte_repr(self): - bytes = '\xf0G_\x00E \x00\x00\x03\xf7' + bytes = b'\xf0G_\x00E \x00\x00\x03\xf7' self.assertEqual( "['f0', '47', '5f', '00', '45', '20', '00', '00', '03', 'f7']", sysex.byte_repr(bytes)) def test_repr_bytes(self): self.assertEqual( - '\xf0G_\x00E \x00\x00\x03\xf7', + b'\xf0G_\x00E \x00\x00\x03\xf7', sysex.repr_bytes(['f0', '47', '5f', '00', '45', '20', '00', '00', '03', 'f7'])) def test_suite(): From 88823af0a77dc2a4bfa9804450d57d77eb3c10db Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 04:47:49 +0200 Subject: [PATCH 12/66] #6 introduce byte literals; fix byte wise comparisons two python3 gotchas fixed: * indexing bytes yields integers; compare as sliced sequence instead -> reconsider to do integer comparisons instead; left TODO --- src/aksy/devices/akai/sysex_types.py | 94 ++++---- .../devices/akai/tests/test_sysex_types.py | 206 +++++++++--------- 2 files changed, 152 insertions(+), 148 deletions(-) diff --git a/src/aksy/devices/akai/sysex_types.py b/src/aksy/devices/akai/sysex_types.py index 7c2b590..a40dee0 100644 --- a/src/aksy/devices/akai/sysex_types.py +++ b/src/aksy/devices/akai/sysex_types.py @@ -1,11 +1,11 @@ import struct, logging, types -START_SYSEX = '\xf0' -STRING_TERMINATOR = '\x00' -END_SYSEX = '\xf7' +START_SYSEX = b'\xf0' +STRING_TERMINATOR = b'\x00' +END_SYSEX = b'\xf7' -POSTIVE = '\x00' -NEGATIVE = '\x01' +POSTIVE = b'\x00' +NEGATIVE = b'\x01' log = logging.getLogger("aksy.devices.akai.sysex_types") log.disabled = True @@ -22,8 +22,7 @@ def __init__(self, size, signed=False, id=None): self.min_val = signed and self.max_val*-1 or 0 def validate_encode(self, value): - if (value < self.min_val or - value > self.max_val): + if value < self.min_val or value > self.max_val: raise ValueError("Value %s out of range:[%s-%s]" % (repr(value), repr(self.min_val), repr(self.max_val))) @@ -53,10 +52,10 @@ def encode(self, value): def decode(self, value, typed=True): """Decodes a value from a sysex byte string """ - if value is None or not isinstance(value, types.StringType): + if value is None or not isinstance(value, bytes): raise DecodeException( - "Decoding error at %s.decode: %s is not a string" - % (self.__class__.__name__, repr(value))) + "Decoding error at %s.decode: %s is not a bytes but %s" + % (self.__class__.__name__, repr(value), type(value))) if self.size is not None: if len(value) == self.size + 1: @@ -73,7 +72,7 @@ def decode(self, value, typed=True): class ByteType(SysexType): def __init__(self): - SysexType.__init__(self, 1, False, '\x00') + SysexType.__init__(self, 1, False, b'\x00') def _encode(self, value): """ @@ -96,7 +95,7 @@ def _decode(self, string): class SignedByteType(SysexType): def __init__(self): - SysexType.__init__(self, 2, True, '\x01') + SysexType.__init__(self, 2, True, b'\x01') def _encode(self, value): """ @@ -113,15 +112,15 @@ def _decode(self, string): sb.decode('\x01\x05') -5 """ - result = struct.unpack('B', string[1])[0] + result = struct.unpack('B', string[1:2])[0] - if string[0] == NEGATIVE: + if string[0:1] == NEGATIVE: result *= -1 return result class WordType(SysexType): def __init__(self): - SysexType.__init__(self, 2, False, '\x02') + SysexType.__init__(self, 2, False, b'\x02') def _encode(self, value): return struct.pack('2B', value & 0x7f, value >> 7) @@ -134,7 +133,7 @@ class CompoundWordType(SysexType): """ the little endian brother of WordType """ def __init__(self): - SysexType.__init__(self, 2, False, '\x02') + SysexType.__init__(self, 2, False, b'\x02') def _encode(self, value): return struct.pack('2B', value >> 7, value & 0x7f) @@ -146,7 +145,7 @@ def _decode(self, string): class SignedWordType(SysexType): def __init__(self): - SysexType.__init__(self, 3, True, '\x03') + SysexType.__init__(self, 3, True, b'\x03') def _encode(self, value): sign = value < 0 and 1 or 0 @@ -160,7 +159,7 @@ def _decode(self, string): class DoubleWordType(SysexType): def __init__(self): - SysexType.__init__(self, 4, False, '\x04') + SysexType.__init__(self, 4, False, b'\x04') def _encode(self, value): return struct.pack('4B', value & 0x7f, (value >> 7) & 0x7f, (value >> 14) & 0x7f, (value >> 21) & 0x7f) @@ -171,7 +170,7 @@ def _decode(self, string): class SignedDoubleWordType(SysexType): def __init__(self): - SysexType.__init__(self, 5, True, '\x05') + SysexType.__init__(self, 5, True, b'\x05') def _encode(self, value): sign = value < 0 and 1 or 0 @@ -185,7 +184,7 @@ def _decode(self, string): class QWordType(SysexType): def __init__(self): - SysexType.__init__(self, 8, False, '\x06') + SysexType.__init__(self, 8, False, b'\x06') def _encode(self, value): return struct.pack('8B', value & 0x7f, (value >> 7) & 0x7f, @@ -199,7 +198,7 @@ def _decode(self, string): class SignedQWordType(SysexType): def __init__(self): - SysexType.__init__(self, 9, True, '\x07') + SysexType.__init__(self, 9, True, b'\x07') def _encode(self, value): sign = value < 0 and 1 or 0 @@ -228,7 +227,7 @@ def _decode(self, string): class StringType(object): def __init__(self): - self.id = '\x08' + self.id = b'\x08' self.size = None # variable size, parsed length is returned in result def validate_encode(self, value): @@ -237,17 +236,17 @@ def validate_encode(self, value): def encode(self, value): self.validate_encode(value) - return struct.pack(str(len(value)+1) + 's', value) + return struct.pack(str(len(value)+1) + 's', value.encode('ascii')) def decode(self, string): index = string.find(STRING_TERMINATOR) if index == -1: - raise ValueError - if string[0] == self.id: + raise ValueError(f'no terminator found in {string} ') + if string[0:1] == self.id: start = 1 else: start = 0 - return index + 1, struct.unpack( str(index-start) + 's', string[start:index])[0] + return index + 1, string[start:index].decode('ascii') class StringArrayType(object): def __init__(self): @@ -257,25 +256,26 @@ def encode(self, value): raise NotImplementedError() def decode(self, string): - if not string or not isinstance(string, types.StringType): + if not isinstance(string, bytes): raise DecodeException( - "%s.decode: %s is not a string" + "%s.decode: %s is not a byte sequence" % (self.__class__.__name__, repr(string))) result = [] index = 0 offset = 0 for char in string: - #sys.stderr.writelines( "c:%s i:%s\n" % (char, index) ) - if (char == END_SYSEX): - break; - if char == STRING_TERMINATOR: - result.append(struct.unpack( str(index) + 's', string[offset:offset+index])[0]) + # sys.stderr.writelines( "c:%s i:%s\n" % (char, index) ) + # TODO extract to constants + if char == int.from_bytes(END_SYSEX, byteorder='big'): + break + if char == int.from_bytes(STRING_TERMINATOR, byteorder='big'): + result.append(string[offset:offset+index].decode('ascii')) offset += index + 1 index = 0 else: index += 1 - return (offset + index, tuple(result)) + return offset + index, tuple(result) class UserRefType(object): """ Can be used to stamp a request with an identifier @@ -316,12 +316,12 @@ def decode_length(self, byte): return byte >> 4 def decode(self, string): - if not string or not isinstance(string, types.StringType): + if not isinstance(string, int) and not isinstance(string, bytes): raise ValueError( - "Decoding error at %s.decode: %s is not a string" + "Decoding error at %s.decode: %s is not a bytes %s" % (self.__class__.__name__, repr(string))) - length = self.decode_length(BYTE.decode(string[0])) + length = self.decode_length(BYTE.decode(string[0:1])) if length == 0: return (1, 0) if length == 1: @@ -410,12 +410,13 @@ def decode(self, string): return offset, result[0] return offset, tuple(result) + class TypedCompositeType(object): def decode(self, string): result = [] offset = 0 while offset < (len(string) - 1): - sysex_type = get_type(string[offset]) + sysex_type = get_type(string[offset:offset+1]) if log.isEnabledFor(logging.DEBUG): log.debug("Parsing type %s" % sysex_type) offset += 1 @@ -449,7 +450,7 @@ def __init__(self): def decode(self, string): result = [] index = 0 - while string[index] != END_SYSEX: + while string[index:index+1] != END_SYSEX: length, val = DISK.decode(string[index:]) result.append(val) index += length @@ -462,7 +463,7 @@ def __init__(self): def decode(self, string): result = [] index = 0 - while string[index] != END_SYSEX: + while string[index:index+1] != END_SYSEX: length, val = S56KDISK.decode(string[index:]) result.append(val) index += length @@ -506,15 +507,15 @@ def _decode(self, string): class TwoByteType(CompositeByteType): def __init__(self): - super(TwoByteType, self).__init__(2, '\x09') + super(TwoByteType, self).__init__(2, b'\x09') class ThreeByteType(CompositeByteType): def __init__(self): - super(ThreeByteType, self).__init__(3, '\x0a') + super(ThreeByteType, self).__init__(3, b'\x0a') class FourByteType(CompositeByteType): def __init__(self): - super(FourByteType, self).__init__(4, '\x0b') + super(FourByteType, self).__init__(4, b'\x0b') # TODO: make HandleNameDictType class HandleNameArrayType(object): @@ -550,7 +551,7 @@ def decode(self, string): results = [] len_to_parse = len(string) len_parsed = 0 - while len_parsed < len_to_parse and string[len_parsed] != END_SYSEX: + while len_parsed < len_to_parse and string[len_parsed:len_parsed+1] != END_SYSEX: len_result, name = STRING.decode(string[len_parsed:]) len_parsed += len_result size = DWORD.decode( @@ -615,14 +616,17 @@ def decode(self, string): FOUR_BYTES.id: FOUR_BYTES, } + class UnknownSysexTypeError(Exception): pass + class DecodeException(Exception): pass + def get_type(typeId): type = _types.get(typeId, None) if type is None: - raise UnknownSysexTypeError( "%02x" % struct.unpack('B', typeId)) + raise UnknownSysexTypeError( "%02s" % typeId) return type diff --git a/src/tests/aksy/devices/akai/tests/test_sysex_types.py b/src/tests/aksy/devices/akai/tests/test_sysex_types.py index 4187b73..51c2437 100644 --- a/src/tests/aksy/devices/akai/tests/test_sysex_types.py +++ b/src/tests/aksy/devices/akai/tests/test_sysex_types.py @@ -8,27 +8,27 @@ def testInvalidValues(self): def testDecode(self): b = sysex_types.ByteType() - self.assertEquals(5, b.decode('\x05')) + self.assertEqual(5, b.decode(b'\x05')) class TestSignedByteType(unittest.TestCase): def testEncode(self): sb = sysex_types.SignedByteType() - self.assertEquals('\x01\x05', sb.encode(-5)) + self.assertEqual(b'\x01\x05', sb.encode(-5)) def testDecode(self): sb = sysex_types.SignedByteType() - self.assertEquals(-5, sb.decode('\x01\x05')) + self.assertEqual(-5, sb.decode(b'\x01\x05')) class TestWordType(unittest.TestCase): def testEncode(self): w = sysex_types.WordType() - self.assertEquals('\x00\x02', w.encode(256)) - self.assertEquals('\x7f\x7f', w.encode(16383)) + self.assertEqual(b'\x00\x02', w.encode(256)) + self.assertEqual(b'\x7f\x7f', w.encode(16383)) def testDecode(self): w = sysex_types.WordType() - self.assertEquals(256, w.decode('\x00\x02')) - self.assertEquals(16383, w.decode('\x7f\x7f')) + self.assertEqual(256, w.decode(b'\x00\x02')) + self.assertEqual(16383, w.decode(b'\x7f\x7f')) def testInvalidValues(self): w = sysex_types.WordType() @@ -37,19 +37,19 @@ def testInvalidValues(self): class TestCompoundWordType(unittest.TestCase): def testEncode(self): cw = sysex_types.CompoundWordType() - self.assertEquals('\x00\x5d', cw.encode(93)) - self.assertEquals('\x00\x7f', cw.encode(127)) - self.assertEquals('\x05\x41', cw.encode(705)) - self.assertEquals('\x02\x00', cw.encode(256)) - self.assertEquals('\x7f\x7f', cw.encode(16383)) + self.assertEqual(b'\x00\x5d', cw.encode(93)) + self.assertEqual(b'\x00\x7f', cw.encode(127)) + self.assertEqual(b'\x05\x41', cw.encode(705)) + self.assertEqual(b'\x02\x00', cw.encode(256)) + self.assertEqual(b'\x7f\x7f', cw.encode(16383)) def testDecode(self): cw = sysex_types.CompoundWordType() - self.assertEquals(93, cw.decode('\x00\x5d')) - self.assertEquals(128, cw.decode('\x01\x00')) - self.assertEquals(705, cw.decode('\x05\x41')) - self.assertEquals(256, cw.decode('\x02\x00')) - self.assertEquals(16383, cw.decode('\x7f\x7f')) + self.assertEqual(93, cw.decode(b'\x00\x5d')) + self.assertEqual(128, cw.decode(b'\x01\x00')) + self.assertEqual(705, cw.decode(b'\x05\x41')) + self.assertEqual(256, cw.decode(b'\x02\x00')) + self.assertEqual(16383, cw.decode(b'\x7f\x7f')) def testInvalidValues(self): cw = sysex_types.CompoundWordType() @@ -58,83 +58,83 @@ def testInvalidValues(self): class TestSignedWordType(unittest.TestCase): def testEncode(self): sw = sysex_types.SignedWordType() - self.assertEquals('\x00\x00\x02', sw.encode(256)) + self.assertEqual(b'\x00\x00\x02', sw.encode(256)) - self.assertEquals('\x01\x7f\x7f', sw.encode(-16383)) - self.assertEquals('\x01\x00\x02', sw.encode(-256)) + self.assertEqual(b'\x01\x7f\x7f', sw.encode(-16383)) + self.assertEqual(b'\x01\x00\x02', sw.encode(-256)) def testDecode(self): sw = sysex_types.SignedWordType() - self.assertEquals(-256, sw.decode('\x01\x00\x02')) - self.assertEquals(-16383, sw.decode('\x01\x7f\x7f')) + self.assertEqual(-256, sw.decode(b'\x01\x00\x02')) + self.assertEqual(-16383, sw.decode(b'\x01\x7f\x7f')) class TestDoubleWordType(unittest.TestCase): def testEncode(self): dw = sysex_types.DoubleWordType() - self.assertEquals('\x7f\x7f\x7f\x7f', dw.encode(268435455)) - self.assertEquals('\x01\x00\x00\x00', dw.encode(1)) + self.assertEqual(b'\x7f\x7f\x7f\x7f', dw.encode(268435455)) + self.assertEqual(b'\x01\x00\x00\x00', dw.encode(1)) def testDecode(self): dw = sysex_types.DoubleWordType() - self.assertEquals(268435455, dw.decode('\x7f\x7f\x7f\x7f')) + self.assertEqual(268435455, dw.decode(b'\x7f\x7f\x7f\x7f')) class TestSignedDoubleWordType(unittest.TestCase): def testEncode(self): sdw = sysex_types.SignedDoubleWordType() - self.assertEquals('\x01\x7f\x7f\x7f\x7f', sdw.encode(-268435455)) + self.assertEqual(b'\x01\x7f\x7f\x7f\x7f', sdw.encode(-268435455)) def testDecode(self): sdw = sysex_types.SignedDoubleWordType() - self.assertEquals(-268435455, sdw.decode('\x01\x7f\x7f\x7f\x7f')) + self.assertEqual(-268435455, sdw.decode(b'\x01\x7f\x7f\x7f\x7f')) class TestQWordType(unittest.TestCase): def testEncode(self): qw = sysex_types.QWordType() - self.assertEquals('\x7f\x7f\x7f\x7f\x00\x00\x00\x00', qw.encode(268435455)) + self.assertEqual(b'\x7f\x7f\x7f\x7f\x00\x00\x00\x00', qw.encode(268435455)) def testDecode(self): qw = sysex_types.QWordType() - self.assertEquals( - 72057594037927935L, - qw.decode('\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f')) - self.assertEquals(145957L, qw.decode('\x25\x74\x08\x00\x00\x00\x00\x00')) + self.assertEqual( + 72057594037927935, + qw.decode(b'\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f')) + self.assertEqual(145957, qw.decode(b'\x25\x74\x08\x00\x00\x00\x00\x00')) class TestSignedQWordType(unittest.TestCase): def testEncode(self): sdw = sysex_types.SignedQWordType() - self.assertEquals( - '\x01\x7f\x7f\x7f\x7f\x00\x00\x00\x00', + self.assertEqual( + b'\x01\x7f\x7f\x7f\x7f\x00\x00\x00\x00', sdw.encode(-268435455)) def testDecode(self): qw = sysex_types.SignedQWordType() - self.assertEquals( - -72057594037927935L, - qw.decode('\x01\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f')) + self.assertEqual( + -72057594037927935, + qw.decode(b'\x01\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f')) - self.assertEquals( - -558551906910208L, - qw.decode('\x01\x00\x00\x00\x00\x00\x00\x7f\x00')) + self.assertEqual( + -558551906910208, + qw.decode(b'\x01\x00\x00\x00\x00\x00\x00\x7f\x00')) class TestBoolType(unittest.TestCase): def testEncode(self): b = sysex_types.BoolType() - self.assertEquals('\x00', b.encode(False)) - self.assertEquals('\x01', b.encode(True)) + self.assertEqual(b'\x00', b.encode(False)) + self.assertEqual(b'\x01', b.encode(True)) def testDecode(self): b = sysex_types.BoolType() - self.assertTrue(b.decode('\x01')) - self.assertFalse(b.decode('\x00')) + self.assertTrue(b.decode(b'\x01')) + self.assertFalse(b.decode(b'\x00')) class TestStringType(unittest.TestCase): def testEncode(self): s = sysex_types.StringType() - self.assertEquals('test sdf\x00', s.encode('test sdf')) + self.assertEqual(b'test sdf\x00', s.encode('test sdf')) def testDecode(self): s = sysex_types.StringType() - self.assertEquals((9, 'test sdf'), s.decode('test sdf\x00')) + self.assertEqual((9, 'test sdf'), s.decode(b'test sdf\x00')) class TestStringArrayType(unittest.TestCase): def testEncode(self): @@ -143,9 +143,9 @@ def testEncode(self): def testDecode(self): s = sysex_types.StringArrayType() - self.assertEquals( + self.assertEqual( (18, ('test sdf', 'test ghi')), - s.decode('test sdf\x00test ghi\x00')) + s.decode(b'test sdf\x00test ghi\x00')) def testInvalidValues(self): s = sysex_types.StringArrayType() @@ -154,30 +154,30 @@ def testInvalidValues(self): class TestUserRefType(unittest.TestCase): def testEncode(self): u = sysex_types.UserRefType() - self.assertEquals('\x00', u.encode(0)) - self.assertEquals('\x10\x7f', u.encode(127)) - self.assertEquals('\x20\x7f\x7f', u.encode(sysex_types.WORD.max_val)) + self.assertEqual(b'\x00', u.encode(0)) + self.assertEqual(b'\x10\x7f', u.encode(127)) + self.assertEqual(b'\x20\x7f\x7f', u.encode(sysex_types.WORD.max_val)) def testFixedSizeEncode(self): u = sysex_types.UserRefType(2) - self.assertEquals('\x20\x00\x00', u.encode(0)) - self.assertEquals('\x20\x7f\x00', u.encode(127)) + self.assertEqual(b'\x20\x00\x00', u.encode(0)) + self.assertEqual(b'\x20\x7f\x00', u.encode(127)) def testDecode(self): u = sysex_types.UserRefType() - self.assertEquals((1, 0), u.decode('\x00')) - self.assertEquals((3, 0), u.decode('\x20\x00\x00')) + self.assertEqual((1, 0), u.decode(b'\x00')) + self.assertEqual((3, 0), u.decode(b'\x20\x00\x00')) - self.assertEquals((2, 127), u.decode('\x10\x7f')) - self.assertEquals((3, 16383), u.decode('\x20\x7f\x7f')) + self.assertEqual((2, 127), u.decode(b'\x10\x7f')) + self.assertEqual((3, 16383), u.decode(b'\x20\x7f\x7f')) - self.assertEquals((3, 0), u.decode('\x20\x00\x00')) + self.assertEqual((3, 0), u.decode(b'\x20\x00\x00')) def testInvalidValues(self): u = sysex_types.UserRefType() self.assertRaises(ValueError, u.encode, -1) self.assertRaises(ValueError, u.encode, 16384) - self.assertRaises(sysex_types.DecodeException, u.decode, '\x20\x00') + self.assertRaises(sysex_types.DecodeException, u.decode, b'\x20\x00') class TestSoundLevelType(unittest.TestCase): def setUp(self): @@ -185,7 +185,7 @@ def setUp(self): def testEncodeDecode(self): sl = self.sl - self.assertEquals(-34, sl.decode(sl.encode(-34.0))) + self.assertEqual(-34, sl.decode(sl.encode(-34.0))) def testInvalidValues(self): self.assertRaises(ValueError, self.sl.encode, 61) @@ -194,8 +194,8 @@ def testInvalidValues(self): class TestTuneType(unittest.TestCase): def testEncodeDecode(self): tt = sysex_types.TuneType() - self.assertEquals(-3600, tt.decode(tt.encode(-3600))) - self.assertEquals(3600, tt.decode(tt.encode(3600))) + self.assertEqual(-3600, tt.decode(tt.encode(-3600))) + self.assertEqual(3600, tt.decode(tt.encode(3600))) def testInvalidValues(self): tt = sysex_types.TuneType() @@ -205,24 +205,24 @@ class TestHandleNameArrayType(unittest.TestCase): def setUp(self): self.handle_name_type = sysex_types.HandleNameArrayType() def testDecode(self): - result = self.handle_name_type.decode('\x04\x01\x00\x04\x00\x08\x53\x79\x6e\x74\x68\x54\x65\x73\x74\x00') - self.assertEquals((16, ((65537, 'SynthTest'),)), result) + result = self.handle_name_type.decode(b'\x04\x01\x00\x04\x00\x08\x53\x79\x6e\x74\x68\x54\x65\x73\x74\x00') + self.assertEqual((16, ((65537, 'SynthTest'),)), result) def testDecode2(self): - result = self.handle_name_type.decode('\x04\x00\x00\x04\x00\x08\x44\x72\x79\x20\x4b\x69\x74\x20\x30\x32\x00\x04\x01\x00\x04\x00\x08\x53\x79\x6e\x74\x68\x54\x65\x73\x74\x00') - self.assertEquals((33, ((65536, 'Dry Kit 02'), (65537, 'SynthTest'))), result) + result = self.handle_name_type.decode(b'\x04\x00\x00\x04\x00\x08\x44\x72\x79\x20\x4b\x69\x74\x20\x30\x32\x00\x04\x01\x00\x04\x00\x08\x53\x79\x6e\x74\x68\x54\x65\x73\x74\x00') + self.assertEqual((33, ((65536, 'Dry Kit 02'), (65537, 'SynthTest'))), result) class TestNameSizeArrayType(unittest.TestCase): def setUp(self): self.type = sysex_types.NAMESIZEARRAY def testDecode(self): - to_decode = '\x67\x74\x72\x2e\x57\x41\x56\x00\x54\x6b\x5d\x01\x65\x6d\x70\x74\x79\x2e\x77\x61\x76\x00\x22\x3d\x05\x00' + to_decode = b'\x67\x74\x72\x2e\x57\x41\x56\x00\x54\x6b\x5d\x01\x65\x6d\x70\x74\x79\x2e\x77\x61\x76\x00\x22\x3d\x05\x00' result = self.type.decode(to_decode) - self.assertEquals((len(to_decode), ('gtr.WAV', 3634644, 'empty.wav', 89762,)), result) + self.assertEqual((len(to_decode), ('gtr.WAV', 3634644, 'empty.wav', 89762,)), result) def testDecode2(self): - to_decode = "B-4 PR5SYNTH.WAV\x00r[\r\x00C-1 PR5SYNTH.WAV\x00Rp\x12\x00C-2 PR5SYNTH.WAV\x00R\x04\x10\x00C-3 PR5SYNTH.WAV\x00r\x17\x0e\x00C-4 PR5SYNTH.WAV\x00r,\r\x00CHURCH PAD.AKP\x00$8\x00\x00D#1 PR5SYNTH.WAV\x002F\x10\x00D#2 PR5SYNTH.WAV\x00R\x04\x10\x00D#3 PR5SYNTH.WAV\x00r\x14\x0f\x00D-5 PR5SYNTH.WAV\x00R\x7f\x0c\x00F#1 PR5SYNTH.WAV\x002v\x10\x00F#2 PR5SYNTH.WAV\x002\x14\x10\x00F#3 PR5SYNTH.WAV\x00rn\x0f\x00F-4 PR5SYNTH.WAV\x00R\x7f\r\x00F-5 PR5SYNTH.WAV\x002 \x0c\x00G#0 PR5SYNTH.WAV\x00\x12\n\x11\x00G#1 PR5SYNTH.WAV\x00r\x7f\x10\x00G#2 PR5SYNTH.WAV\x00R6\x0f\x00G#3 PR5SYNTH.WAV\x00rB\x0e\x00G-4 PR5SYNTH.WAV\x00\x12{\r\x00G-5 PR5SYNTH.WAV\x002D\x0c\x00RAIN DROPS.AKP\x00$8\x00\x00TENDER ORGAN.AKP\x00$8\x00\x00\xf7" + to_decode = b"B-4 PR5SYNTH.WAV\x00r[\r\x00C-1 PR5SYNTH.WAV\x00Rp\x12\x00C-2 PR5SYNTH.WAV\x00R\x04\x10\x00C-3 PR5SYNTH.WAV\x00r\x17\x0e\x00C-4 PR5SYNTH.WAV\x00r,\r\x00CHURCH PAD.AKP\x00$8\x00\x00D#1 PR5SYNTH.WAV\x002F\x10\x00D#2 PR5SYNTH.WAV\x00R\x04\x10\x00D#3 PR5SYNTH.WAV\x00r\x14\x0f\x00D-5 PR5SYNTH.WAV\x00R\x7f\x0c\x00F#1 PR5SYNTH.WAV\x002v\x10\x00F#2 PR5SYNTH.WAV\x002\x14\x10\x00F#3 PR5SYNTH.WAV\x00rn\x0f\x00F-4 PR5SYNTH.WAV\x00R\x7f\r\x00F-5 PR5SYNTH.WAV\x002 \x0c\x00G#0 PR5SYNTH.WAV\x00\x12\n\x11\x00G#1 PR5SYNTH.WAV\x00r\x7f\x10\x00G#2 PR5SYNTH.WAV\x00R6\x0f\x00G#3 PR5SYNTH.WAV\x00rB\x0e\x00G-4 PR5SYNTH.WAV\x00\x12{\r\x00G-5 PR5SYNTH.WAV\x002D\x0c\x00RAIN DROPS.AKP\x00$8\x00\x00TENDER ORGAN.AKP\x00$8\x00\x00\xf7" result = self.type.decode(to_decode) expected = (479, ('B-4 PR5SYNTH.WAV', 224754, 'C-1 PR5SYNTH.WAV', 309330, 'C-2 PR5SYNTH.WAV', 262738, 'C-3 PR5SYNTH.WAV', 232434, 'C-4 PR5SYNTH.WAV', 218738, 'CHURCH PAD.AKP', 7204, @@ -232,101 +232,101 @@ def testDecode2(self): 'G#0 PR5SYNTH.WAV', 279826, 'G#1 PR5SYNTH.WAV', 278514, 'G#2 PR5SYNTH.WAV', 252754, 'G#3 PR5SYNTH.WAV', 237938, 'G-4 PR5SYNTH.WAV', 228754, 'G-5 PR5SYNTH.WAV', 205362, 'RAIN DROPS.AKP', 7204, 'TENDER ORGAN.AKP', 7204)) - self.assertEquals(expected, result) + self.assertEqual(expected, result) def testDecodeEmpty(self): - self.assertEquals((0, ()), self.type.decode('')) + self.assertEqual((0, ()), self.type.decode(b'')) class TestFourByteType(unittest.TestCase): def testEncode(self): fourByteType = sysex_types.FourByteType() - self.assertEquals("\x01\x01\x01\x01", fourByteType.encode(1, 1, 1, 1)) + self.assertEqual(b"\x01\x01\x01\x01", fourByteType.encode(1, 1, 1, 1)) def testDecode(self): fourByteType = sysex_types.FourByteType() - self.assertEquals((1, 1, 1, 1), fourByteType.decode("\x01\x01\x01\x01")) + self.assertEqual((1, 1, 1, 1), fourByteType.decode(b"\x01\x01\x01\x01")) def testInvalidValues(self): fourByteType = sysex_types.FourByteType() self.assertRaises(ValueError, fourByteType.encode, 1, 1, 1) self.assertRaises(ValueError, fourByteType.encode, 128, 1, 1, 1) - self.assertRaises(sysex_types.DecodeException, fourByteType.decode, "\x01\x01\x01\x01\x05") + self.assertRaises(sysex_types.DecodeException, fourByteType.decode, b"\x01\x01\x01\x01\x05") class TestThreeByteType(unittest.TestCase): def testEncode(self): threeByteType = sysex_types.ThreeByteType() - self.assertEquals("\x01\x01\x01", threeByteType.encode(1, 1, 1)) + self.assertEqual(b"\x01\x01\x01", threeByteType.encode(1, 1, 1)) def testDecode(self): threeByteType = sysex_types.ThreeByteType() - self.assertEquals((127, 1, 1), threeByteType.decode("\x7f\x01\x01")) + self.assertEqual((127, 1, 1), threeByteType.decode(b"\x7f\x01\x01")) def testInvalidValues(self): threeByteType = sysex_types.ThreeByteType() self.assertRaises(ValueError, threeByteType.encode, 1, 1, 1, 1) - self.assertRaises(sysex_types.DecodeException, threeByteType.decode, "\x01\x01\x01\x01\x05") + self.assertRaises(sysex_types.DecodeException, threeByteType.decode, b"\x01\x01\x01\x01\x05") class TestTwoByteType(unittest.TestCase): def testEncode(self): twoByteType = sysex_types.TwoByteType() - self.assertEquals("\x01\x01", twoByteType.encode(1, 1)) + self.assertEqual(b"\x01\x01", twoByteType.encode(1, 1)) def testDecode(self): twoByteType = sysex_types.TwoByteType() - self.assertEquals((127, 1), twoByteType.decode("\x7f\x01")) + self.assertEqual((127, 1), twoByteType.decode(b"\x7f\x01")) def testInvalidValues(self): twoByteType = sysex_types.TwoByteType() self.assertRaises(ValueError, twoByteType.encode, 128, 1) self.assertRaises(ValueError, twoByteType.encode, 1, 1, 1) - self.assertRaises(sysex_types.DecodeException, twoByteType.decode, "\x01") - self.assertRaises(sysex_types.DecodeException, twoByteType.decode, "\x01\x01\x01\x01\x05") + self.assertRaises(sysex_types.DecodeException, twoByteType.decode, b"\x01") + self.assertRaises(sysex_types.DecodeException, twoByteType.decode, b"\x01\x01\x01\x01\x05") class TestModuleMethods(unittest.TestCase): def test_parse_byte_string(self): - self.assertEquals( + self.assertEqual( (5, 'TEST'), - sysex_types.parse_byte_string('\x54\x45\x53\x54' + sysex_types.STRING_TERMINATOR, sysex_types.STRING)) - self.assertEquals( + sysex_types.parse_byte_string(b'\x54\x45\x53\x54' + sysex_types.STRING_TERMINATOR, sysex_types.STRING)) + self.assertEqual( (4, 'EST'), - sysex_types.parse_byte_string('\x54\x45\x53\x54' + sysex_types.STRING_TERMINATOR, sysex_types.STRING, 1)) + sysex_types.parse_byte_string(b'\x54\x45\x53\x54' + sysex_types.STRING_TERMINATOR, sysex_types.STRING, 1)) - self.assertEquals( + self.assertEqual( (10, ('TEST', 'TEST')), - sysex_types.parse_byte_string('\x54\x45\x53\x54\x00\x54\x45\x53\x54\x00', sysex_types.STRINGARRAY)) + sysex_types.parse_byte_string(b'\x54\x45\x53\x54\x00\x54\x45\x53\x54\x00', sysex_types.STRINGARRAY)) - self.assertEquals( + self.assertEqual( (1, 15), - sysex_types.parse_byte_string('\x0f', sysex_types.BYTE)) + sysex_types.parse_byte_string(b'\x0f', sysex_types.BYTE)) - self.assertEquals( + self.assertEqual( (2, -15), - sysex_types.parse_byte_string('\x01\x0f', sysex_types.SBYTE)) + sysex_types.parse_byte_string(b'\x01\x0f', sysex_types.SBYTE)) - self.assertEquals( + self.assertEqual( (2, 384), - sysex_types.parse_byte_string('\x00\x03', sysex_types.WORD)) + sysex_types.parse_byte_string(b'\x00\x03', sysex_types.WORD)) - self.assertEquals( + self.assertEqual( (3, -1935), - sysex_types.parse_byte_string('\x01\x0f\x0f', sysex_types.SWORD)) + sysex_types.parse_byte_string(b'\x01\x0f\x0f', sysex_types.SWORD)) - self.assertEquals( + self.assertEqual( (4, 268435455), - sysex_types.parse_byte_string('\x7f\x7f\x7f\x7f', sysex_types.DWORD)) + sysex_types.parse_byte_string(b'\x7f\x7f\x7f\x7f', sysex_types.DWORD)) - self.assertEquals( + self.assertEqual( (5, -268435455), - sysex_types.parse_byte_string('\x01\x7f\x7f\x7f\x7f', sysex_types.SDWORD)) + sysex_types.parse_byte_string(b'\x01\x7f\x7f\x7f\x7f', sysex_types.SDWORD)) - self.assertEquals( + self.assertEqual( (1, False), - sysex_types.parse_byte_string('\x00', sysex_types.BOOL)) + sysex_types.parse_byte_string(b'\x00', sysex_types.BOOL)) - self.assertEquals( + self.assertEqual( (1, True), - sysex_types.parse_byte_string('\x01', sysex_types.BOOL)) + sysex_types.parse_byte_string(b'\x01', sysex_types.BOOL)) def test_suite(): testloader = unittest.TestLoader() From c2a1c6a705c36ad775098fca7c66477d104a4e85 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 04:48:17 +0200 Subject: [PATCH 13/66] #6 introduce byte literals --- src/tests/aksy/devices/akai/tests/test_replayingconnector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/aksy/devices/akai/tests/test_replayingconnector.py b/src/tests/aksy/devices/akai/tests/test_replayingconnector.py index 3452ebb..abdf8ac 100644 --- a/src/tests/aksy/devices/akai/tests/test_replayingconnector.py +++ b/src/tests/aksy/devices/akai/tests/test_replayingconnector.py @@ -16,7 +16,7 @@ def get_bytes(self): class TestReplayingConnector(unittest.TestCase): def testEncode(self): - self.assertEqual('\xf0G_\x00E`\x00\x00\x00\xf7', replayingconnector.encode(eval(RESP))) + self.assertEqual(b'\xf0G_\x00E`\x00\x00\x00\xf7', replayingconnector.encode(eval(RESP))) def testParse(self): f = testutil.get_test_resource('aksy_20070624.log') From cb2d509b8bccc82a64f02ff3fb1862f05cf2cd05 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 04:48:54 +0200 Subject: [PATCH 14/66] #6 replace StringIO with BytesIO --- src/tests/aksy/devices/akai/tests/test_filebuilder.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tests/aksy/devices/akai/tests/test_filebuilder.py b/src/tests/aksy/devices/akai/tests/test_filebuilder.py index 46ddc89..45f1be6 100644 --- a/src/tests/aksy/devices/akai/tests/test_filebuilder.py +++ b/src/tests/aksy/devices/akai/tests/test_filebuilder.py @@ -3,7 +3,8 @@ from aksy.devices.akai.filemodel import Zone from aksy.devices.akai.filemodel import Keygroup import unittest -from io import StringIO +from io import BytesIO + class TestZoneBuilder(unittest.TestCase): def testBuild(self): @@ -21,7 +22,7 @@ def testWrite(self): zones = [Zone()] * 4 keygroups = [Keygroup(zones)] * 4 program = Program.create_default(keygroups) - out = StringIO() + out = BytesIO() writer.write(program, out) def test_suite(): From 7013605a2afd8b8ad2d69927eb775830135ff1a4 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 08:23:29 +0200 Subject: [PATCH 15/66] #6 disable FTP and OSC tests - they need library upgrade fixes/replacement --- src/tests/aksyfs/tests/test_ftpd.py | 3 +++ src/tests/aksyosc/tests/test_connector.py | 3 +++ src/tests/aksyosc/tests/test_handler.py | 3 +++ src/tests/aksyosc/tests/test_osc.py | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/tests/aksyfs/tests/test_ftpd.py b/src/tests/aksyfs/tests/test_ftpd.py index d6f05aa..b8b2266 100644 --- a/src/tests/aksyfs/tests/test_ftpd.py +++ b/src/tests/aksyfs/tests/test_ftpd.py @@ -145,5 +145,8 @@ def test_remove(self): self.assertRaises(OSError, self.fs.getattr, path) def test_suite(): + # TODO re-implement / reconsider FUSE for Windows + return None + testloader = TestLoader() return testloader.loadTestsFromName('tests.aksyfs.tests.test_ftpd') diff --git a/src/tests/aksyosc/tests/test_connector.py b/src/tests/aksyosc/tests/test_connector.py index 493b311..e329d91 100644 --- a/src/tests/aksyosc/tests/test_connector.py +++ b/src/tests/aksyosc/tests/test_connector.py @@ -18,6 +18,9 @@ def test_parse_alt_req_msg(self): ['/sampletools/get_bit_depth', ',']], decodeOSC(msg)) def test_suite(): + # TODO replace OSC implementation + return None + testloader = TestLoader() return testloader.loadTestsFromName('tests.aksyosc.tests.test_connector') diff --git a/src/tests/aksyosc/tests/test_handler.py b/src/tests/aksyosc/tests/test_handler.py index 813fd2f..ea3d61a 100644 --- a/src/tests/aksyosc/tests/test_handler.py +++ b/src/tests/aksyosc/tests/test_handler.py @@ -53,6 +53,9 @@ def testDispatchUnknownCommand(self): self.assertEqual([], self.sampler.recorded); def test_suite(): + # TODO replace OSC implementation + return None + testloader = TestLoader() return testloader.loadTestsFromName('tests.aksyosc.tests.test_handler') diff --git a/src/tests/aksyosc/tests/test_osc.py b/src/tests/aksyosc/tests/test_osc.py index 76394e4..9ffebcc 100644 --- a/src/tests/aksyosc/tests/test_osc.py +++ b/src/tests/aksyosc/tests/test_osc.py @@ -56,6 +56,9 @@ def testDecodeOSCArrayUnbalanced(self): self.assertRaises(OSCException, decodeOSC, '\x00\x00\x00\x00,[[]') def test_suite(): + # TODO replace OSC implementation + return None + testloader = TestLoader() return testloader.loadTestsFromName('tests.aksyosc.tests.test_osc') From 49d8de2a76d998a85b3d405edb653ceaaf6f3261 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 08:24:44 +0200 Subject: [PATCH 16/66] #6 introduce bytes literals --- src/tests/aksyfs/tests/test_aksyfuse.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/aksyfs/tests/test_aksyfuse.py b/src/tests/aksyfs/tests/test_aksyfuse.py index afc5d4f..119cfd4 100644 --- a/src/tests/aksyfs/tests/test_aksyfuse.py +++ b/src/tests/aksyfs/tests/test_aksyfuse.py @@ -7,7 +7,7 @@ from aksy.device import Devices from tests.aksy.util import testutil from stat import S_ISDIR, S_ISREG, ST_MODE, ST_SIZE, S_IRUSR -import os, tempfile +import os log = logging.getLogger('aksy') @@ -127,7 +127,7 @@ def test_read(self): afile = aksyfuse.AksyFile('/memory/Sample99.wav', os.O_RDONLY|S_IRUSR) try: read = afile.read(4, 0) - self.assertEqual('RIFF', read) + self.assertEqual(b'RIFF', read) finally: afile.release('ignored') @@ -135,11 +135,11 @@ def test_mknod_write(self): path = '/memory/Sample100.wav' self.fs.mknod(path, 0, 'ignored') afile = aksyfuse.AksyFile('/memory/Sample100.wav', os.O_WRONLY|S_IRUSR|os.O_CREAT) - afile.write('abc', 0) + afile.write(b'abc', 0) afile.release('ignored') written = os.open(common._create_cache_path(path), os.O_RDONLY) try: - self.assertEqual('abc', os.read(written, 3)) + self.assertEqual(b'abc', os.read(written, 3)) finally: os.close(written) From fca34456ae554bcd3ca39364bf447c999678ee1c Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 08:25:56 +0200 Subject: [PATCH 17/66] #6 2to3 fixes --- examples/checkout.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/checkout.py b/examples/checkout.py index 3fa6e1a..daaa735 100755 --- a/examples/checkout.py +++ b/examples/checkout.py @@ -4,11 +4,11 @@ # usage: checkout.py # checkout.py -import sys, urllib, zipfile, os, os.path +import sys, urllib.request, urllib.parse, urllib.error, zipfile, os, os.path from aksy.device import Devices def checkout(url, destdir=''): - file = urllib.urlretrieve(url)[0] + file = urllib.request.urlretrieve(url)[0] zip = zipfile.ZipFile(file) if zip.testzip() is not None: raise Exception('Corrupt zipfile') @@ -38,10 +38,10 @@ def checkout(url, destdir=''): def process_file(z48, file): name, ext = os.path.splitext(file) - print ext + print(ext) if ext.lower() not in ['.akp', '.akm', '.wav', '.aiff']: return - print "Uploading file: " + repr(file) + print("Uploading file: " + repr(file)) z48.put(file, os.path.basename(file)) # set current program if ext.lower() == '.akp': From 32918573477f4edfe14d850622250f4cafdecec8 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 08:27:58 +0200 Subject: [PATCH 18/66] #6 introduce hello_world replacement for checkout script RIP Steve of Hollow Sun --- examples/checkout.py | 57 ----------------------- examples/hello_world.py | 15 ++++++ src/aksy/devices/akai/mock_z48/sampler.py | 1 + 3 files changed, 16 insertions(+), 57 deletions(-) delete mode 100755 examples/checkout.py create mode 100644 examples/hello_world.py diff --git a/examples/checkout.py b/examples/checkout.py deleted file mode 100755 index daaa735..0000000 --- a/examples/checkout.py +++ /dev/null @@ -1,57 +0,0 @@ -# inspired by the frequent offers of great sounds by Steve of Hollow Sun, this -# script will allow you to download, unpack and audition a new addition in no time! - -# usage: checkout.py -# checkout.py - -import sys, urllib.request, urllib.parse, urllib.error, zipfile, os, os.path -from aksy.device import Devices - -def checkout(url, destdir=''): - file = urllib.request.urlretrieve(url)[0] - zip = zipfile.ZipFile(file) - if zip.testzip() is not None: - raise Exception('Corrupt zipfile') - - destfiles = [] - for name in zip.namelist(): - dest = os.path.join(destdir, os.path.dirname(name)) - filename = os.path.basename(name) - if not os.path.exists(dest): - os.makedirs(dest) - destfile = os.path.join(dest, filename) - file = open(destfile, 'wb') - # XXX lazy but memory should be plenty... - file.write(zip.read(name)) - file.close() - destfiles.append(destfile) - - zip.close() - - # aksy stuff - z48 = Devices.get_instance('z48', 'usb') - try: - for file in destfiles: - process_file(z48, file) - finally: - z48.close() - -def process_file(z48, file): - name, ext = os.path.splitext(file) - print(ext) - if ext.lower() not in ['.akp', '.akm', '.wav', '.aiff']: - return - print("Uploading file: " + repr(file)) - z48.put(file, os.path.basename(file)) - # set current program - if ext.lower() == '.akp': - z48.programtools.set_curr_by_name(file) - # TODO: play file - -if __name__ == "__main__": - if len(sys.argv) == 2: - url = sys.argv[1] - else: - url = 'http://www.hollowsun.com/downloads/s56_m1k/221%20angel.zip' - checkout(url) - diff --git a/examples/hello_world.py b/examples/hello_world.py new file mode 100644 index 0000000..1e59de4 --- /dev/null +++ b/examples/hello_world.py @@ -0,0 +1,15 @@ +from contextlib import closing + +from aksy.device import Devices + + +def get_sampler_name(): + with closing(Devices.get_instance('mock_z48', 'mock')) as z48: + print(f'hello {z48.systemtools.get_sampler_name()}!') + + with closing(Devices.get_instance('z48', 'usb')) as z48: + print(f'hello real {z48.systemtools.get_sampler_name()}!') + + +if __name__ == "__main__": + get_sampler_name() diff --git a/src/aksy/devices/akai/mock_z48/sampler.py b/src/aksy/devices/akai/mock_z48/sampler.py index 670d1ce..f31b0da 100644 --- a/src/aksy/devices/akai/mock_z48/sampler.py +++ b/src/aksy/devices/akai/mock_z48/sampler.py @@ -52,6 +52,7 @@ def __init__(self, connector, debug=1): self.multitools.get_handles_names = lambda: (1, 'multi', 2, 'multi 2') self.sampletools.get_handles_names = lambda: (1, 'sample', 2, 'sample 2') self.recordingtools.get_name = lambda: 'sample' + self.systemtools.get_sampler_name = lambda: 'Mock Z48' self.setup_model() From 4f64cdfc06e703070ac5903c71c2f6ead101b334 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 08:29:14 +0200 Subject: [PATCH 19/66] #6 add refactor TODO to prevent dependency on native library --- src/aksy/devices/akai/model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aksy/devices/akai/model.py b/src/aksy/devices/akai/model.py index 79eb77e..5cca593 100644 --- a/src/aksy/devices/akai/model.py +++ b/src/aksy/devices/akai/model.py @@ -275,6 +275,7 @@ def create_folder(self, name): def upload(self, path): self.set_current() name = os.path.basename(path) + # TODO define enum elsewhere handlers[Disk].z48.put(path, name, destination=AkaiSampler.DISK) item = FileRef(self.path + (name,)) self.children.append(item) From 9eb72543aa59fa16ba5064bf3a65a812ab57c8d5 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 09:04:21 +0200 Subject: [PATCH 20/66] #6 update docker image to python 3.9 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa5abaa..db86160 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,7 @@ jobs: # The executor is the environment in which the steps below will be executed - below will use a python 3.8 container # Change the version below to your required version of python docker: - - image: cimg/python:2.7.18 + - image: cimg/python:3.9 # Checkout the code as the first step. This is a dedicated CircleCI step. # The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default. # Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt. From 68036ce4266b9f526b2a77f50657a21c0ecefee8 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 17 Jun 2022 10:46:26 +0200 Subject: [PATCH 21/66] #6 fix mypy findings (whitespace, typing, python2 remnants) --- src/aksui/UI/programdetails.py | 22 ++++++++++---------- src/aksui/gtkexcepthook.py | 13 ++++++------ src/aksui/main.py | 29 ++++++++++++++------------- src/aksy/devices/akai/model.py | 2 +- src/aksy/devices/akai/z48/akptools.py | 6 +++--- src/aksy/gui/aksyfsview.py | 5 +++-- 6 files changed, 40 insertions(+), 37 deletions(-) diff --git a/src/aksui/UI/programdetails.py b/src/aksui/UI/programdetails.py index 39c364a..2acabf9 100644 --- a/src/aksui/UI/programdetails.py +++ b/src/aksui/UI/programdetails.py @@ -1,13 +1,13 @@ from aksui.UI import base - - + + class ProgramDetails(base.Base): - def __init__(self, program): - base.Base.__init__(self, program, "windowProgramDetails") - self.editor.connect("delete-event", self.on_delete_event) - self.set_samplerobject(program) - - def on_delete_event(self, widget, event): - # nooooo - self.editor.hide_all() - return True + def __init__(self, program): + base.Base.__init__(self, program, "windowProgramDetails") + self.editor.connect("delete-event", self.on_delete_event) + self.set_samplerobject(program) + + def on_delete_event(self, widget, event): + # nooooo + self.editor.hide_all() + return True diff --git a/src/aksui/gtkexcepthook.py b/src/aksui/gtkexcepthook.py index 117bc0a..8cc3014 100644 --- a/src/aksui/gtkexcepthook.py +++ b/src/aksui/gtkexcepthook.py @@ -41,13 +41,14 @@ def _info(type, value, tb): dialog.details = frame dialog.set_position(gtk.WIN_POS_CENTER) dialog.set_gravity(gtk.gdk.GRAVITY_CENTER) - + while 1: - resp = dialog.run() - if resp == 1: - dialog.details.show() - dialog.action_area.get_children()[1].set_sensitive(0) - else: break + resp = dialog.run() + if resp == 1: + dialog.details.show() + dialog.action_area.get_children()[1].set_sensitive(0) + else: + break dialog.destroy() diff --git a/src/aksui/main.py b/src/aksui/main.py index 24822da..357ecd0 100644 --- a/src/aksui/main.py +++ b/src/aksui/main.py @@ -323,8 +323,8 @@ def on_add_keygroup_activate(self, widget): def on_program_properties_activate(self, widget): names = get_selected_from_treeview(self.main.w_treeview_programs) - - for name in names: + + for name in names: self.main.open_program_properties(name) def on_new_multi_activate(self, widget): @@ -467,12 +467,13 @@ def rescroll(self, vadj, scroll): scroll.set_vadjustment(vadj) def move_properties_window(self): - position = self.window.get_position() - size = self.window.get_size() + position = self.window.get_position() + size = self.window.get_size() decoration_width = 10 - if self.program_details_window is not None: + if self.program_details_window is not None: self.program_details_window.editor.move(position[0] + size[0] + decoration_width, position[1]) - def init_lists(self): + + def init_lists(self): try: Main.do_lists(self.s) self.s.samplesmodel.connect("row-changed", self.on_update_models) @@ -601,8 +602,8 @@ def on_about_activate(self, button): dialog.connect('response', lambda dialog, data: dialog.destroy()) dialog.show_all() - def on_configure_event(self, widget, event): - self.move_properties_window() + def on_configure_event(self, widget, event): + self.move_properties_window() return False def on_lcd_activate(self, button): @@ -628,12 +629,12 @@ def on_treeview_event(self, widget, event): return False self.open_keygroup_editor(curr_programs[0]) - - """ - OLD ONE: - self.programsEditor.set_program(curr_program) - self.programsEditor.programsMain.show_all() - """ + + """ + OLD ONE: + self.programsEditor.set_program(curr_program) + self.programsEditor.programsMain.show_all() + """ if widget == self.w_treeview_multis: if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3: diff --git a/src/aksy/devices/akai/model.py b/src/aksy/devices/akai/model.py index 5cca593..64bdda2 100644 --- a/src/aksy/devices/akai/model.py +++ b/src/aksy/devices/akai/model.py @@ -42,7 +42,7 @@ class Disk(Container): def __init__(self, xxx_todo_changeme): (handle, disk_type, format, scsi_id, writable, name) = xxx_todo_changeme self._handle = handle - # type: 0=floppy; 1=hard disk; 2=CD ROM; 3=removable disk. + # type - 0=floppy; 1=hard disk; 2=CD ROM; 3=removable disk. self._disk_type = disk_type # format, where: 0=other; 1=MSDOS; 2=FAT32; 3=ISO9660; 4=S1000; 5=S3000; 6=EMU; 7=ROLAND, # 8=CD-AUDIO, 100=EMPTY diff --git a/src/aksy/devices/akai/z48/akptools.py b/src/aksy/devices/akai/z48/akptools.py index dd2dd3b..d21128c 100644 --- a/src/aksy/devices/akai/z48/akptools.py +++ b/src/aksy/devices/akai/z48/akptools.py @@ -833,6 +833,7 @@ def create_chunk(self): self.velo_to_out_level, 0) + if __name__ == "__main__": import doctest, sys doctest.testmod(sys.modules[__name__]) @@ -844,8 +845,7 @@ def create_chunk(self): import math samples = [] for s in range(no_samples): - samples.append(struct.pack(' Date: Fri, 17 Jun 2022 10:47:09 +0200 Subject: [PATCH 22/66] #6 fix mypy findings (duplicate methods) --- src/aksy/devices/akai/z48/multifxtools.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/aksy/devices/akai/z48/multifxtools.py b/src/aksy/devices/akai/z48/multifxtools.py index 9ef92f4..6ffe207 100644 --- a/src/aksy/devices/akai/z48/multifxtools.py +++ b/src/aksy/devices/akai/z48/multifxtools.py @@ -315,21 +315,6 @@ def get_param_qlinkctrl(self, arg0, arg1, arg2): """ return self.sampler.execute(self.get_param_qlinkctrl_cmd, (arg0, arg1, arg2, )) - def set_channel_mute(self, arg0, arg1): - """Set Mute Status of Channel = (0=ON, 1=MUTE) - """ - return self.sampler.execute(self.set_channel_mute_cmd, (arg0, arg1, )) - - def set_channel_input(self, arg0, arg1): - """Set Channel Input = input - """ - return self.sampler.execute(self.set_channel_input_cmd, (arg0, arg1, )) - - def set_channel_output(self, arg0, arg1): - """Set Channel Output = output - """ - return self.sampler.execute(self.set_channel_output_cmd, (arg0, arg1, )) - def set_fx_by_name(self, arg0, arg1, arg2): """Set effect in module on given channel (by name) = channel; = module; = effect. """ From ff80c3bd06361c9f26b88b6ab5f2d00ca5b2542d Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 18 Jun 2022 23:01:46 +0200 Subject: [PATCH 23/66] #6 byte literals for all sysex commands --- src/aksy/devices/akai/transfertools.py | 8 +- src/aksy/devices/akai/z48/disktools.py | 57 ++--- src/aksy/devices/akai/z48/frontpaneltools.py | 20 +- src/aksy/devices/akai/z48/keygrouptools.py | 164 +++++++------- src/aksy/devices/akai/z48/multifxtools.py | 86 ++++---- src/aksy/devices/akai/z48/multitools.py | 216 +++++++++--------- src/aksy/devices/akai/z48/programtools.py | 220 +++++++++---------- src/aksy/devices/akai/z48/recordingtools.py | 78 +++---- src/aksy/devices/akai/z48/sampletools.py | 150 ++++++------- src/aksy/devices/akai/z48/songtools.py | 82 +++---- src/aksy/devices/akai/z48/sysextools.py | 18 +- src/aksy/devices/akai/z48/systemtools.py | 208 +++++++++--------- src/aksy/devices/akai/z48/zonetools.py | 52 ++--- 13 files changed, 684 insertions(+), 675 deletions(-) diff --git a/src/aksy/devices/akai/transfertools.py b/src/aksy/devices/akai/transfertools.py index 852665a..5bef572 100644 --- a/src/aksy/devices/akai/transfertools.py +++ b/src/aksy/devices/akai/transfertools.py @@ -17,8 +17,12 @@ class Transfertools: def __init__(self, connector): self.connector = connector - self.get_cmd = aksy.devices.akai.sysex.Command('', '', 'transfertools', 'get', (aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING), None) - self.put_cmd = aksy.devices.akai.sysex.Command('', '', 'transfertools', 'put', (aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING), None) + self.get_cmd = aksy.devices.akai.sysex.Command(b'', b'', 'transfertools', 'get', ( + aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING, + aksy.devices.akai.sysex_types.STRING), None) + self.put_cmd = aksy.devices.akai.sysex.Command(b'', b'', 'transfertools', 'put', ( + aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING, + aksy.devices.akai.sysex_types.STRING), None) def get(self, filename, destfile=None, source=AkaiSampler.MEMORY): """Gets a file from the sampler, overwriting destfile if it already exists. diff --git a/src/aksy/devices/akai/z48/disktools.py b/src/aksy/devices/akai/z48/disktools.py index de9c584..d37b868 100644 --- a/src/aksy/devices/akai/z48/disktools.py +++ b/src/aksy/devices/akai/z48/disktools.py @@ -12,42 +12,47 @@ class Disktools: def __init__(self, connector): self.connector = connector - self.update_disklist_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x01', 'disktools', 'update_disklist', (), None, + self.update_disklist_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x01', 'disktools', 'update_disklist', (), None, userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.select_disk_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x02', 'disktools', 'select_disk', (aksy.devices.akai.sysex_types.WORD,), None, + self.select_disk_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x02', 'disktools', 'select_disk', (aksy.devices.akai.sysex_types.WORD,), None, userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.test_disk_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x03', 'disktools', 'test_disk', (aksy.devices.akai.sysex_types.WORD,), None) - self.get_no_disks_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x04', 'disktools', 'get_no_disks', (), None) - self.get_disklist_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x05', 'disktools', 'get_disklist', (), + self.test_disk_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x03', 'disktools', 'test_disk', (aksy.devices.akai.sysex_types.WORD,), None) + self.get_no_disks_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x04', 'disktools', 'get_no_disks', (), None) + self.get_disklist_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x05', 'disktools', 'get_disklist', (), (aksy.devices.akai.sysex_types.DISKLIST,), userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.get_curr_path_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x09', 'disktools', 'get_curr_path', (), None) - self.eject_disk_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x0D', 'disktools', 'eject_disk', (aksy.devices.akai.sysex_types.WORD,), None) - self.get_no_folders_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x10', 'disktools', 'get_no_folders', (), None) - self.get_folder_names_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x12', 'disktools', 'get_folder_names', (), + self.get_curr_path_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x09', 'disktools', 'get_curr_path', (), None) + self.eject_disk_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x0D', 'disktools', 'eject_disk', (aksy.devices.akai.sysex_types.WORD,), None) + self.get_no_folders_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x10', 'disktools', 'get_no_folders', (), None) + self.get_folder_names_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x12', 'disktools', 'get_folder_names', (), (aksy.devices.akai.sysex_types.STRINGARRAY,), userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.open_folder_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x13', 'disktools', 'open_folder', (aksy.devices.akai.sysex_types.STRING,), None) - self.load_folder_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x15', 'disktools', 'load_folder', (aksy.devices.akai.sysex_types.STRING,), + self.open_folder_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x13', 'disktools', 'open_folder', (aksy.devices.akai.sysex_types.STRING,), None) + self.load_folder_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x15', 'disktools', 'load_folder', (aksy.devices.akai.sysex_types.STRING,), None, userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.create_folder_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x16', 'disktools', 'create_folder', (aksy.devices.akai.sysex_types.STRING,), None) - self.del_folder_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x17', 'disktools', 'delete_folder', (aksy.devices.akai.sysex_types.STRING,), None) - self.rename_folder_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x18', 'disktools', 'rename_folder', (aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING), None) - self.get_no_files_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x20', 'disktools', 'get_no_files', (), + self.create_folder_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x16', 'disktools', 'create_folder', (aksy.devices.akai.sysex_types.STRING,), None) + self.del_folder_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x17', 'disktools', 'delete_folder', (aksy.devices.akai.sysex_types.STRING,), None) + self.rename_folder_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x18', 'disktools', 'rename_folder', (aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING), None) + self.get_no_files_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x20', 'disktools', 'get_no_files', (), (aksy.devices.akai.sysex_types.WORD,), userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.get_filenames_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x22', 'disktools', 'get_filenames', (), + self.get_filenames_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x22', 'disktools', 'get_filenames', (), (aksy.devices.akai.sysex_types.NAMESIZEARRAY,), userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.rename_file_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x28', 'disktools', 'rename_file', (aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING), None, + self.rename_file_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x28', 'disktools', 'rename_file', (aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING), None, userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.delete_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x29', 'disktools', 'delete', (aksy.devices.akai.sysex_types.STRING,), None, + self.delete_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x29', 'disktools', 'delete', (aksy.devices.akai.sysex_types.STRING,), None, userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.load_file_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x2A', 'disktools', 'load_file', (aksy.devices.akai.sysex_types.STRING,), None, + self.load_file_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x2A', 'disktools', 'load_file', (aksy.devices.akai.sysex_types.STRING,), None, userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.load_file_and_deps_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x2B', 'disktools', 'load_file_and_deps', (aksy.devices.akai.sysex_types.STRING,), None) - self.save_cmd = aksy.devices.akai.sysex.Command('\x5e', '\x10\x2C', 'disktools', 'save', - (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.FILETYPE, aksy.devices.akai.sysex_types.BOOL, - aksy.devices.akai.sysex_types.BOOL), None, - userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) - self.save_all_cmd = aksy.devices.akai.sysex.Command('\x5f', '\x20\x2D', 'disktools', 'save_all', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL, aksy.devices.akai.sysex_types.BOOL), None, - userref_type=aksy.devices.akai.sysex_types.USERREF) + self.load_file_and_deps_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x2B', 'disktools', 'load_file_and_deps', (aksy.devices.akai.sysex_types.STRING,), None) + self.save_cmd = aksy.devices.akai.sysex.Command(b'\x5e', b'\x10\x2C', 'disktools', 'save', + (aksy.devices.akai.sysex_types.DWORD, + aksy.devices.akai.sysex_types.FILETYPE, + aksy.devices.akai.sysex_types.BOOL, + aksy.devices.akai.sysex_types.BOOL), None, + userref_type=aksy.devices.akai.sysex_types.S56K_USERREF) + self.save_all_cmd = aksy.devices.akai.sysex.Command(b'\x5f', b'\x20\x2D', 'disktools', 'save_all', ( + aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL, + aksy.devices.akai.sysex_types.BOOL), + None, + userref_type=aksy.devices.akai.sysex_types.USERREF) def update_disklist(self): """Update the list of disks connected diff --git a/src/aksy/devices/akai/z48/frontpaneltools.py b/src/aksy/devices/akai/z48/frontpaneltools.py index 555f144..3642e10 100644 --- a/src/aksy/devices/akai/z48/frontpaneltools.py +++ b/src/aksy/devices/akai/z48/frontpaneltools.py @@ -14,16 +14,16 @@ class Frontpaneltools: def __init__(self, connector): self.connector = connector - self.mouseclick_at_screen_cmd = Command('_', '\x2C\x20', 'frontpaneltools', 'mouseclick_at_screen', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD), None) - self.mousedoubleclick_at_screen_cmd = Command('_', '\x2C\x21', 'frontpaneltools', 'mousedoubleclick_at_screen', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD), None) - self.keypress_hold_cmd = Command('_', '\x2C\x01', 'frontpaneltools', 'keypress_hold', (aksy.devices.akai.sysex_types.BYTE,), None) - self.keypress_release_cmd = Command('_', '\x2C\x02', 'frontpaneltools', 'keypress_release', (aksy.devices.akai.sysex_types.BYTE,), None) - self.move_datawheel_cmd = Command('_', '\x2C\x03', 'frontpaneltools', 'move_datawheel', (aksy.devices.akai.sysex_types.SBYTE,), None) - self.set_qlink_control_cmd = Command('_', '\x2C\x04', 'frontpaneltools', 'set_qlink_control', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.ascii_keypress_hold_cmd = Command('_', '\x2C\x10', 'frontpaneltools', 'ascii_keypress_hold', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD), None) - self.ascii_keypress_release_cmd = Command('_', '\x2C\x11', 'frontpaneltools', 'ascii_keypress_release', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD), None) - - self.get_panel_state_cmd = aksy.devices.akai.sysex.Command('', '', 'frontpaneltools', 'get_panel_state', (), None) + self.mouseclick_at_screen_cmd = Command(b'_', b'\x2C\x20', 'frontpaneltools', 'mouseclick_at_screen', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD), None) + self.mousedoubleclick_at_screen_cmd = Command(b'_', b'\x2C\x21', 'frontpaneltools', 'mousedoubleclick_at_screen', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD), None) + self.keypress_hold_cmd = Command(b'_', b'\x2C\x01', 'frontpaneltools', 'keypress_hold', (aksy.devices.akai.sysex_types.BYTE,), None) + self.keypress_release_cmd = Command(b'_', b'\x2C\x02', 'frontpaneltools', 'keypress_release', (aksy.devices.akai.sysex_types.BYTE,), None) + self.move_datawheel_cmd = Command(b'_', b'\x2C\x03', 'frontpaneltools', 'move_datawheel', (aksy.devices.akai.sysex_types.SBYTE,), None) + self.set_qlink_control_cmd = Command(b'_', b'\x2C\x04', 'frontpaneltools', 'set_qlink_control', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.ascii_keypress_hold_cmd = Command(b'_', b'\x2C\x10', 'frontpaneltools', 'ascii_keypress_hold', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD), None) + self.ascii_keypress_release_cmd = Command(b'_', b'\x2C\x11', 'frontpaneltools', 'ascii_keypress_release', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD), None) + + self.get_panel_state_cmd = aksy.devices.akai.sysex.Command(b'', b'', 'frontpaneltools', 'get_panel_state', (), None) def mouseclick_at_screen(self, arg0, arg1): """Perform a mouse click diff --git a/src/aksy/devices/akai/z48/keygrouptools.py b/src/aksy/devices/akai/z48/keygrouptools.py index 2eb79e2..79c0a41 100644 --- a/src/aksy/devices/akai/z48/keygrouptools.py +++ b/src/aksy/devices/akai/z48/keygrouptools.py @@ -14,88 +14,88 @@ class Keygrouptools: def __init__(self, z48): self.sampler = z48 - self.set_curr_keygroup_cmd = Command('_', '\x10\x01', 'keygrouptools', 'set_curr_keygroup', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_curr_keygroup_cmd = Command('_', '\x10\x02', 'keygrouptools', 'get_curr_keygroup', (), None) - self.get_group_id_cmd = Command('_', '\x13\x01', 'keygrouptools', 'get_group_id', (), None) - self.get_edit_mode_cmd = Command('_', '\x13\x02', 'keygrouptools', 'get_edit_mode', (), None) - self.get_low_note_cmd = Command('_', '\x13\x04', 'keygrouptools', 'get_low_note', (), None) - self.get_high_note_cmd = Command('_', '\x13\x05', 'keygrouptools', 'get_high_note', (), None) - self.get_mute_group_cmd = Command('_', '\x13\x06', 'keygrouptools', 'get_mute_group', (), None) - self.get_fx_override_cmd = Command('_', '\x13\x07', 'keygrouptools', 'get_fx_override', (), None) - self.get_fx_send_level_cmd = Command('_', '\x13\x08', 'keygrouptools', 'get_fx_send_level', (), None) - self.get_zone_xfade_cmd = Command('_', '\x13\x09', 'keygrouptools', 'get_zone_xfade', (), None) - self.get_zone_xfade_type_cmd = Command('_', '\x13\x0A', 'keygrouptools', 'get_zone_xfade_type', (), None) - self.get_polyphony_cmd = Command('_', '\x13\x0E', 'keygrouptools', 'get_polyphony', (), None) - self.get_zone_xfade_ctrl_no_cmd = Command('_', '\x13\x0F', 'keygrouptools', 'get_zone_xfade_ctrl_no', (), None) - self.get_tune_cmd = Command('_', '\x13\x10', 'keygrouptools', 'get_tune', (), None) - self.get_level_cmd = Command('_', '\x13\x11', 'keygrouptools', 'get_level', (), None) - self.get_play_trigger_cmd = Command('_', '\x13\x18', 'keygrouptools', 'get_play_trigger', (), None) - self.get_play_trigger_velocity_cmd = Command('_', '\x13\x19', 'keygrouptools', 'get_play_trigger_velocity', (), None) - self.get_play_toggle_note_cmd = Command('_', '\x13\x1A', 'keygrouptools', 'get_play_toggle_note', (), None) - self.get_filter_cmd = Command('_', '\x13\x20', 'keygrouptools', 'get_filter', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_filter_cutoff_cmd = Command('_', '\x13\x21', 'keygrouptools', 'get_filter_cutoff', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_filter_resonance_cmd = Command('_', '\x13\x22', 'keygrouptools', 'get_filter_resonance', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_filter_attenuation_cmd = Command('_', '\x13\x23', 'keygrouptools', 'get_filter_attenuation', (), None) - self.get_envelope_rate1_cmd = Command('_', '\x13\x30', 'keygrouptools', 'get_envelope_rate1', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_envelope_level1_cmd = Command('_', '\x13\x31', 'keygrouptools', 'get_envelope_level1', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_envelope_rate2_cmd = Command('_', '\x13\x32', 'keygrouptools', 'get_envelope_rate2', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_envelope_level2_cmd = Command('_', '\x13\x33', 'keygrouptools', 'get_envelope_level2', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_envelope_rate3_cmd = Command('_', '\x13\x34', 'keygrouptools', 'get_envelope_rate3', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_envelope_level3_cmd = Command('_', '\x13\x35', 'keygrouptools', 'get_envelope_level3', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_envelope_rate4_cmd = Command('_', '\x13\x36', 'keygrouptools', 'get_envelope_rate4', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_envelope_level4_cmd = Command('_', '\x13\x37', 'keygrouptools', 'get_envelope_level4', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_envelope_reference_cmd = Command('_', '\x13\x42', 'keygrouptools', 'get_envelope_reference', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_attack_hold_cmd = Command('_', '\x13\x43', 'keygrouptools', 'get_attack_hold', (), None) - self.get_lfo_rate_cmd = Command('_', '\x13\x50', 'keygrouptools', 'get_lfo_rate', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_lfo_delay_cmd = Command('_', '\x13\x51', 'keygrouptools', 'get_lfo_delay', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_lfo_depth_cmd = Command('_', '\x13\x52', 'keygrouptools', 'get_lfo_depth', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_lfo_waveform_cmd = Command('_', '\x13\x53', 'keygrouptools', 'get_lfo_waveform', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_lfo_phase_cmd = Command('_', '\x13\x54', 'keygrouptools', 'get_lfo_phase', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_lfo_shift_cmd = Command('_', '\x13\x55', 'keygrouptools', 'get_lfo_shift', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_lfo_midi_sync_cmd = Command('_', '\x13\x56', 'keygrouptools', 'get_lfo_midi_sync', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_midi_clock_sync_div_cmd = Command('_', '\x13\x57', 'keygrouptools', 'get_midi_clock_sync_div', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_lfo_retrigger_cmd = Command('_', '\x13\x58', 'keygrouptools', 'get_lfo_retrigger', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_lfo_sync_cmd = Command('_', '\x13\x59', 'keygrouptools', 'get_lfo_sync', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_group_id_cmd = Command('_', '\x12\x01', 'keygrouptools', 'set_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_edit_mode_cmd = Command('_', '\x12\x02', 'keygrouptools', 'set_edit_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_low_note_cmd = Command('_', '\x12\x04', 'keygrouptools', 'set_low_note', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_high_note_cmd = Command('_', '\x12\x05', 'keygrouptools', 'set_high_note', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_mute_group_cmd = Command('_', '\x12\x06', 'keygrouptools', 'set_mute_group', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_fx_override_cmd = Command('_', '\x12\x07', 'keygrouptools', 'set_fx_override', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_fx_send_level_cmd = Command('_', '\x12\x08', 'keygrouptools', 'set_fx_send_level', (aksy.devices.akai.sysex_types.SWORD,), None) - self.set_zone_xfade_cmd = Command('_', '\x12\x09', 'keygrouptools', 'set_zone_xfade', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_zone_xfade_type_cmd = Command('_', '\x12\x0A', 'keygrouptools', 'set_zone_xfade_type', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_polyphony_cmd = Command('_', '\x12\x0E', 'keygrouptools', 'set_polyphony', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_zone_xfade_ctrl_no_cmd = Command('_', '\x12\x0F', 'keygrouptools', 'set_zone_xfade_ctrl_no', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_tune_cmd = Command('_', '\x12\x10', 'keygrouptools', 'set_tune', (aksy.devices.akai.sysex_types.SWORD,), None) - self.set_level_cmd = Command('_', '\x12\x11', 'keygrouptools', 'set_level', (aksy.devices.akai.sysex_types.SWORD,), None) - self.set_play_trigger_cmd = Command('_', '\x12\x18', 'keygrouptools', 'set_play_trigger', (), None) - self.set_play_trigger_vel_cmd = Command('_', '\x12\x19', 'keygrouptools', 'set_play_trigger_vel', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_play_toggle_note_cmd = Command('_', '\x12\x1A', 'keygrouptools', 'set_play_toggle_note', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_filter_cmd = Command('_', '\x12\x20', 'keygrouptools', 'set_filter', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_filter_cutoff_cmd = Command('_', '\x12\x21', 'keygrouptools', 'set_filter_cutoff', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_filter_resonance_cmd = Command('_', '\x12\x22', 'keygrouptools', 'set_filter_resonance', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_filter_atten_cmd = Command('_', '\x12\x23', 'keygrouptools', 'set_filter_atten', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_envelope_rate1_cmd = Command('_', '\x12\x30', 'keygrouptools', 'set_envelope_rate1', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_envelope_level1_cmd = Command('_', '\x12\x31', 'keygrouptools', 'set_envelope_level1', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_envelope_rate2_cmd = Command('_', '\x12\x32', 'keygrouptools', 'set_envelope_rate2', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_envelope_level2_cmd = Command('_', '\x12\x33', 'keygrouptools', 'set_envelope_level2', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_envelope_rate3_cmd = Command('_', '\x12\x34', 'keygrouptools', 'set_envelope_rate3', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_envelope_level3_cmd = Command('_', '\x12\x35', 'keygrouptools', 'set_envelope_level3', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_envelope_rate4_cmd = Command('_', '\x12\x36', 'keygrouptools', 'set_envelope_rate4', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_envelope_level4_cmd = Command('_', '\x12\x37', 'keygrouptools', 'set_envelope_level4', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_envelope_reference_cmd = Command('_', '\x12\x42', 'keygrouptools', 'set_envelope_reference', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_attack_hold_cmd = Command('_', '\x12\x43', 'keygrouptools', 'set_attack_hold', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_lfo_rate_cmd = Command('_', '\x12\x50', 'keygrouptools', 'set_lfo_rate', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_lfo_delay_cmd = Command('_', '\x12\x51', 'keygrouptools', 'set_lfo_delay', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_lfo_depth_cmd = Command('_', '\x12\x52', 'keygrouptools', 'set_lfo_depth', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_lfo_waveform_cmd = Command('_', '\x12\x53', 'keygrouptools', 'set_lfo_waveform', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_lfo_phase_cmd = Command('_', '\x12\x54', 'keygrouptools', 'set_lfo_phase', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.set_lfo_shift_cmd = Command('_', '\x12\x55', 'keygrouptools', 'set_lfo_shift', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) - self.set_lfo_midi_sync_cmd = Command('_', '\x12\x56', 'keygrouptools', 'set_lfo_midi_sync', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) - self.set_midi_clock_sync_div_cmd = Command('_', '\x12\x57', 'keygrouptools', 'set_midi_clock_sync_div', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_lfo_retrigger_cmd = Command('_', '\x12\x58', 'keygrouptools', 'set_lfo_retrigger', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.set_lfo_sync_cmd = Command('_', '\x12\x59', 'keygrouptools', 'set_lfo_sync', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_curr_keygroup_cmd = Command(b'_', b'\x10\x01', 'keygrouptools', 'set_curr_keygroup', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_curr_keygroup_cmd = Command(b'_', b'\x10\x02', 'keygrouptools', 'get_curr_keygroup', (), None) + self.get_group_id_cmd = Command(b'_', b'\x13\x01', 'keygrouptools', 'get_group_id', (), None) + self.get_edit_mode_cmd = Command(b'_', b'\x13\x02', 'keygrouptools', 'get_edit_mode', (), None) + self.get_low_note_cmd = Command(b'_', b'\x13\x04', 'keygrouptools', 'get_low_note', (), None) + self.get_high_note_cmd = Command(b'_', b'\x13\x05', 'keygrouptools', 'get_high_note', (), None) + self.get_mute_group_cmd = Command(b'_', b'\x13\x06', 'keygrouptools', 'get_mute_group', (), None) + self.get_fx_override_cmd = Command(b'_', b'\x13\x07', 'keygrouptools', 'get_fx_override', (), None) + self.get_fx_send_level_cmd = Command(b'_', b'\x13\x08', 'keygrouptools', 'get_fx_send_level', (), None) + self.get_zone_xfade_cmd = Command(b'_', b'\x13\x09', 'keygrouptools', 'get_zone_xfade', (), None) + self.get_zone_xfade_type_cmd = Command(b'_', b'\x13\x0A', 'keygrouptools', 'get_zone_xfade_type', (), None) + self.get_polyphony_cmd = Command(b'_', b'\x13\x0E', 'keygrouptools', 'get_polyphony', (), None) + self.get_zone_xfade_ctrl_no_cmd = Command(b'_', b'\x13\x0F', 'keygrouptools', 'get_zone_xfade_ctrl_no', (), None) + self.get_tune_cmd = Command(b'_', b'\x13\x10', 'keygrouptools', 'get_tune', (), None) + self.get_level_cmd = Command(b'_', b'\x13\x11', 'keygrouptools', 'get_level', (), None) + self.get_play_trigger_cmd = Command(b'_', b'\x13\x18', 'keygrouptools', 'get_play_trigger', (), None) + self.get_play_trigger_velocity_cmd = Command(b'_', b'\x13\x19', 'keygrouptools', 'get_play_trigger_velocity', (), None) + self.get_play_toggle_note_cmd = Command(b'_', b'\x13\x1A', 'keygrouptools', 'get_play_toggle_note', (), None) + self.get_filter_cmd = Command(b'_', b'\x13\x20', 'keygrouptools', 'get_filter', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_filter_cutoff_cmd = Command(b'_', b'\x13\x21', 'keygrouptools', 'get_filter_cutoff', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_filter_resonance_cmd = Command(b'_', b'\x13\x22', 'keygrouptools', 'get_filter_resonance', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_filter_attenuation_cmd = Command(b'_', b'\x13\x23', 'keygrouptools', 'get_filter_attenuation', (), None) + self.get_envelope_rate1_cmd = Command(b'_', b'\x13\x30', 'keygrouptools', 'get_envelope_rate1', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_envelope_level1_cmd = Command(b'_', b'\x13\x31', 'keygrouptools', 'get_envelope_level1', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_envelope_rate2_cmd = Command(b'_', b'\x13\x32', 'keygrouptools', 'get_envelope_rate2', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_envelope_level2_cmd = Command(b'_', b'\x13\x33', 'keygrouptools', 'get_envelope_level2', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_envelope_rate3_cmd = Command(b'_', b'\x13\x34', 'keygrouptools', 'get_envelope_rate3', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_envelope_level3_cmd = Command(b'_', b'\x13\x35', 'keygrouptools', 'get_envelope_level3', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_envelope_rate4_cmd = Command(b'_', b'\x13\x36', 'keygrouptools', 'get_envelope_rate4', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_envelope_level4_cmd = Command(b'_', b'\x13\x37', 'keygrouptools', 'get_envelope_level4', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_envelope_reference_cmd = Command(b'_', b'\x13\x42', 'keygrouptools', 'get_envelope_reference', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_attack_hold_cmd = Command(b'_', b'\x13\x43', 'keygrouptools', 'get_attack_hold', (), None) + self.get_lfo_rate_cmd = Command(b'_', b'\x13\x50', 'keygrouptools', 'get_lfo_rate', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_lfo_delay_cmd = Command(b'_', b'\x13\x51', 'keygrouptools', 'get_lfo_delay', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_lfo_depth_cmd = Command(b'_', b'\x13\x52', 'keygrouptools', 'get_lfo_depth', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_lfo_waveform_cmd = Command(b'_', b'\x13\x53', 'keygrouptools', 'get_lfo_waveform', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_lfo_phase_cmd = Command(b'_', b'\x13\x54', 'keygrouptools', 'get_lfo_phase', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_lfo_shift_cmd = Command(b'_', b'\x13\x55', 'keygrouptools', 'get_lfo_shift', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_lfo_midi_sync_cmd = Command(b'_', b'\x13\x56', 'keygrouptools', 'get_lfo_midi_sync', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_midi_clock_sync_div_cmd = Command(b'_', b'\x13\x57', 'keygrouptools', 'get_midi_clock_sync_div', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_lfo_retrigger_cmd = Command(b'_', b'\x13\x58', 'keygrouptools', 'get_lfo_retrigger', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_lfo_sync_cmd = Command(b'_', b'\x13\x59', 'keygrouptools', 'get_lfo_sync', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_group_id_cmd = Command(b'_', b'\x12\x01', 'keygrouptools', 'set_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_edit_mode_cmd = Command(b'_', b'\x12\x02', 'keygrouptools', 'set_edit_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_low_note_cmd = Command(b'_', b'\x12\x04', 'keygrouptools', 'set_low_note', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_high_note_cmd = Command(b'_', b'\x12\x05', 'keygrouptools', 'set_high_note', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_mute_group_cmd = Command(b'_', b'\x12\x06', 'keygrouptools', 'set_mute_group', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_fx_override_cmd = Command(b'_', b'\x12\x07', 'keygrouptools', 'set_fx_override', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_fx_send_level_cmd = Command(b'_', b'\x12\x08', 'keygrouptools', 'set_fx_send_level', (aksy.devices.akai.sysex_types.SWORD,), None) + self.set_zone_xfade_cmd = Command(b'_', b'\x12\x09', 'keygrouptools', 'set_zone_xfade', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_zone_xfade_type_cmd = Command(b'_', b'\x12\x0A', 'keygrouptools', 'set_zone_xfade_type', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_polyphony_cmd = Command(b'_', b'\x12\x0E', 'keygrouptools', 'set_polyphony', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_zone_xfade_ctrl_no_cmd = Command(b'_', b'\x12\x0F', 'keygrouptools', 'set_zone_xfade_ctrl_no', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_tune_cmd = Command(b'_', b'\x12\x10', 'keygrouptools', 'set_tune', (aksy.devices.akai.sysex_types.SWORD,), None) + self.set_level_cmd = Command(b'_', b'\x12\x11', 'keygrouptools', 'set_level', (aksy.devices.akai.sysex_types.SWORD,), None) + self.set_play_trigger_cmd = Command(b'_', b'\x12\x18', 'keygrouptools', 'set_play_trigger', (), None) + self.set_play_trigger_vel_cmd = Command(b'_', b'\x12\x19', 'keygrouptools', 'set_play_trigger_vel', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_play_toggle_note_cmd = Command(b'_', b'\x12\x1A', 'keygrouptools', 'set_play_toggle_note', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_filter_cmd = Command(b'_', b'\x12\x20', 'keygrouptools', 'set_filter', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_filter_cutoff_cmd = Command(b'_', b'\x12\x21', 'keygrouptools', 'set_filter_cutoff', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_filter_resonance_cmd = Command(b'_', b'\x12\x22', 'keygrouptools', 'set_filter_resonance', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_filter_atten_cmd = Command(b'_', b'\x12\x23', 'keygrouptools', 'set_filter_atten', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_envelope_rate1_cmd = Command(b'_', b'\x12\x30', 'keygrouptools', 'set_envelope_rate1', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_envelope_level1_cmd = Command(b'_', b'\x12\x31', 'keygrouptools', 'set_envelope_level1', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_envelope_rate2_cmd = Command(b'_', b'\x12\x32', 'keygrouptools', 'set_envelope_rate2', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_envelope_level2_cmd = Command(b'_', b'\x12\x33', 'keygrouptools', 'set_envelope_level2', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_envelope_rate3_cmd = Command(b'_', b'\x12\x34', 'keygrouptools', 'set_envelope_rate3', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_envelope_level3_cmd = Command(b'_', b'\x12\x35', 'keygrouptools', 'set_envelope_level3', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_envelope_rate4_cmd = Command(b'_', b'\x12\x36', 'keygrouptools', 'set_envelope_rate4', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_envelope_level4_cmd = Command(b'_', b'\x12\x37', 'keygrouptools', 'set_envelope_level4', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_envelope_reference_cmd = Command(b'_', b'\x12\x42', 'keygrouptools', 'set_envelope_reference', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_attack_hold_cmd = Command(b'_', b'\x12\x43', 'keygrouptools', 'set_attack_hold', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_lfo_rate_cmd = Command(b'_', b'\x12\x50', 'keygrouptools', 'set_lfo_rate', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_lfo_delay_cmd = Command(b'_', b'\x12\x51', 'keygrouptools', 'set_lfo_delay', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_lfo_depth_cmd = Command(b'_', b'\x12\x52', 'keygrouptools', 'set_lfo_depth', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_lfo_waveform_cmd = Command(b'_', b'\x12\x53', 'keygrouptools', 'set_lfo_waveform', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_lfo_phase_cmd = Command(b'_', b'\x12\x54', 'keygrouptools', 'set_lfo_phase', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.set_lfo_shift_cmd = Command(b'_', b'\x12\x55', 'keygrouptools', 'set_lfo_shift', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) + self.set_lfo_midi_sync_cmd = Command(b'_', b'\x12\x56', 'keygrouptools', 'set_lfo_midi_sync', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) + self.set_midi_clock_sync_div_cmd = Command(b'_', b'\x12\x57', 'keygrouptools', 'set_midi_clock_sync_div', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_lfo_retrigger_cmd = Command(b'_', b'\x12\x58', 'keygrouptools', 'set_lfo_retrigger', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.set_lfo_sync_cmd = Command(b'_', b'\x12\x59', 'keygrouptools', 'set_lfo_sync', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) def set_curr_keygroup(self, arg0): """Select Keygroup to be current = Keygroup number (starting with 0) diff --git a/src/aksy/devices/akai/z48/multifxtools.py b/src/aksy/devices/akai/z48/multifxtools.py index 6ffe207..cd4395f 100644 --- a/src/aksy/devices/akai/z48/multifxtools.py +++ b/src/aksy/devices/akai/z48/multifxtools.py @@ -14,49 +14,49 @@ class Multifxtools: def __init__(self, z48): self.sampler = z48 - self.is_fxcard_installed_cmd = Command('_', '\x24\x01', 'multifxtools', 'is_fxcard_installed', (), None) - self.get_no_channels_cmd = Command('_', '\x24\x10', 'multifxtools', 'get_no_channels', (), None) - self.get_max_modules_cmd = Command('_', '\x24\x11', 'multifxtools', 'get_max_modules', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_no_cmd = Command('_', '\x24\x20', 'multifxtools', 'get_no', (), None) - self.get_name_cmd = Command('_', '\x24\x21', 'multifxtools', 'get_name', (aksy.devices.akai.sysex_types.WORD,), None) - self.get_id_cmd = Command('_', '\x24\x22', 'multifxtools', 'get_id', (aksy.devices.akai.sysex_types.WORD,), None) - self.get_param_index_output_ctrl_cmd = Command('_', '\x24\x24', 'multifxtools', 'get_param_index_output_ctrl', (aksy.devices.akai.sysex_types.WORD,), None) - self.get_number_of_parameters_cmd = Command('_', '\x24\x30', 'multifxtools', 'get_number_of_parameters', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_parameter_minimum_cmd = Command('_', '\x24\x31', 'multifxtools', 'get_parameter_minimum', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_parameter_maximum_cmd = Command('_', '\x24\x32', 'multifxtools', 'get_parameter_maximum', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_parameter_name_cmd = Command('_', '\x24\x33', 'multifxtools', 'get_parameter_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_parameter_units_cmd = Command('_', '\x24\x34', 'multifxtools', 'get_parameter_units', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_parameter_type_cmd = Command('_', '\x24\x35', 'multifxtools', 'get_parameter_type', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_display_template_cmd = Command('_', '\x24\x36', 'multifxtools', 'get_display_template', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_parameter_position_id_cmd = Command('_', '\x24\x38', 'multifxtools', 'get_parameter_position_id', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_number_of_parameter_groups_cmd = Command('_', '\x24\x40', 'multifxtools', 'get_number_of_parameter_groups', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_group_name_cmd = Command('_', '\x24\x41', 'multifxtools', 'get_group_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_group_index_of_parameter_cmd = Command('_', '\x24\x42', 'multifxtools', 'get_group_index_of_parameter', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_channel_mute_cmd = Command('_', '\x26\x20', 'multifxtools', 'set_channel_mute', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) - self.set_channel_input_cmd = Command('_', '\x26\x21', 'multifxtools', 'set_channel_input', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_channel_output_cmd = Command('_', '\x26\x22', 'multifxtools', 'set_channel_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_effect_by_name_cmd = Command('_', '\x26\x30', 'multifxtools', 'set_effect_by_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.STRING), None) - self.set_effect_by_index_cmd = Command('_', '\x26\x31', 'multifxtools', 'set_effect_by_index', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.enable_fx_module_cmd = Command('_', '\x26\x40', 'multifxtools', 'enable_fx_module', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) - self.set_parameter_value_cmd = Command('_', '\x26\x50', 'multifxtools', 'set_parameter_value', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SDWORD), None) - self.map_qlink_control_cmd = Command('_', '\x26\x52', 'multifxtools', 'map_qlink_control', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.is_channel_muted_cmd = Command('_', '\x27\x20', 'multifxtools', 'is_channel_muted', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_channel_input_cmd = Command('_', '\x27\x21', 'multifxtools', 'get_channel_input', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_channel_output_cmd = Command('_', '\x27\x22', 'multifxtools', 'get_channel_output', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_by_name_cmd = Command('_', '\x27\x30', 'multifxtools', 'get_by_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_by_index_cmd = Command('_', '\x27\x31', 'multifxtools', 'get_by_index', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.is_module_enabled_cmd = Command('_', '\x27\x40', 'multifxtools', 'is_module_enabled', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_param_value_cmd = Command('_', '\x27\x50', 'multifxtools', 'get_param_value', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_param_string_cmd = Command('_', '\x27\x51', 'multifxtools', 'get_param_string', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_param_qlinkctrl_cmd = Command('_', '\x27\x52', 'multifxtools', 'get_param_qlinkctrl', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_channel_mute_cmd = Command('_', '\x26\x20', 'multifxtools', 'set_channel_mute', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) - self.set_channel_input_cmd = Command('_', '\x26\x21', 'multifxtools', 'set_channel_input', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_channel_output_cmd = Command('_', '\x26\x22', 'multifxtools', 'set_channel_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_fx_by_name_cmd = Command('_', '\x26\x30', 'multifxtools', 'set_fx_by_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.STRING), None) - self.set_fx_by_id_cmd = Command('_', '\x26\x31', 'multifxtools', 'set_fx_by_id', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.enable_module_cmd = Command('_', '\x26\x40', 'multifxtools', 'enable_module', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) - self.set_param_value_cmd = Command('_', '\x26\x50', 'multifxtools', 'set_param_value', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_param_qlinkctrl_cmd = Command('_', '\x26\x52', 'multifxtools', 'set_param_qlinkctrl', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.is_fxcard_installed_cmd = Command(b'_', b'\x24\x01', 'multifxtools', 'is_fxcard_installed', (), None) + self.get_no_channels_cmd = Command(b'_', b'\x24\x10', 'multifxtools', 'get_no_channels', (), None) + self.get_max_modules_cmd = Command(b'_', b'\x24\x11', 'multifxtools', 'get_max_modules', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_no_cmd = Command(b'_', b'\x24\x20', 'multifxtools', 'get_no', (), None) + self.get_name_cmd = Command(b'_', b'\x24\x21', 'multifxtools', 'get_name', (aksy.devices.akai.sysex_types.WORD,), None) + self.get_id_cmd = Command(b'_', b'\x24\x22', 'multifxtools', 'get_id', (aksy.devices.akai.sysex_types.WORD,), None) + self.get_param_index_output_ctrl_cmd = Command(b'_', b'\x24\x24', 'multifxtools', 'get_param_index_output_ctrl', (aksy.devices.akai.sysex_types.WORD,), None) + self.get_number_of_parameters_cmd = Command(b'_', b'\x24\x30', 'multifxtools', 'get_number_of_parameters', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_parameter_minimum_cmd = Command(b'_', b'\x24\x31', 'multifxtools', 'get_parameter_minimum', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_parameter_maximum_cmd = Command(b'_', b'\x24\x32', 'multifxtools', 'get_parameter_maximum', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_parameter_name_cmd = Command(b'_', b'\x24\x33', 'multifxtools', 'get_parameter_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_parameter_units_cmd = Command(b'_', b'\x24\x34', 'multifxtools', 'get_parameter_units', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_parameter_type_cmd = Command(b'_', b'\x24\x35', 'multifxtools', 'get_parameter_type', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_display_template_cmd = Command(b'_', b'\x24\x36', 'multifxtools', 'get_display_template', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_parameter_position_id_cmd = Command(b'_', b'\x24\x38', 'multifxtools', 'get_parameter_position_id', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_number_of_parameter_groups_cmd = Command(b'_', b'\x24\x40', 'multifxtools', 'get_number_of_parameter_groups', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_group_name_cmd = Command(b'_', b'\x24\x41', 'multifxtools', 'get_group_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_group_index_of_parameter_cmd = Command(b'_', b'\x24\x42', 'multifxtools', 'get_group_index_of_parameter', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_channel_mute_cmd = Command(b'_', b'\x26\x20', 'multifxtools', 'set_channel_mute', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) + self.set_channel_input_cmd = Command(b'_', b'\x26\x21', 'multifxtools', 'set_channel_input', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_channel_output_cmd = Command(b'_', b'\x26\x22', 'multifxtools', 'set_channel_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_effect_by_name_cmd = Command(b'_', b'\x26\x30', 'multifxtools', 'set_effect_by_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.STRING), None) + self.set_effect_by_index_cmd = Command(b'_', b'\x26\x31', 'multifxtools', 'set_effect_by_index', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.enable_fx_module_cmd = Command(b'_', b'\x26\x40', 'multifxtools', 'enable_fx_module', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) + self.set_parameter_value_cmd = Command(b'_', b'\x26\x50', 'multifxtools', 'set_parameter_value', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SDWORD), None) + self.map_qlink_control_cmd = Command(b'_', b'\x26\x52', 'multifxtools', 'map_qlink_control', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.is_channel_muted_cmd = Command(b'_', b'\x27\x20', 'multifxtools', 'is_channel_muted', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_channel_input_cmd = Command(b'_', b'\x27\x21', 'multifxtools', 'get_channel_input', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_channel_output_cmd = Command(b'_', b'\x27\x22', 'multifxtools', 'get_channel_output', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_by_name_cmd = Command(b'_', b'\x27\x30', 'multifxtools', 'get_by_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_by_index_cmd = Command(b'_', b'\x27\x31', 'multifxtools', 'get_by_index', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.is_module_enabled_cmd = Command(b'_', b'\x27\x40', 'multifxtools', 'is_module_enabled', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_param_value_cmd = Command(b'_', b'\x27\x50', 'multifxtools', 'get_param_value', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_param_string_cmd = Command(b'_', b'\x27\x51', 'multifxtools', 'get_param_string', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_param_qlinkctrl_cmd = Command(b'_', b'\x27\x52', 'multifxtools', 'get_param_qlinkctrl', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_channel_mute_cmd = Command(b'_', b'\x26\x20', 'multifxtools', 'set_channel_mute', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) + self.set_channel_input_cmd = Command(b'_', b'\x26\x21', 'multifxtools', 'set_channel_input', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_channel_output_cmd = Command(b'_', b'\x26\x22', 'multifxtools', 'set_channel_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_fx_by_name_cmd = Command(b'_', b'\x26\x30', 'multifxtools', 'set_fx_by_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.STRING), None) + self.set_fx_by_id_cmd = Command(b'_', b'\x26\x31', 'multifxtools', 'set_fx_by_id', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.enable_module_cmd = Command(b'_', b'\x26\x40', 'multifxtools', 'enable_module', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) + self.set_param_value_cmd = Command(b'_', b'\x26\x50', 'multifxtools', 'set_param_value', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_param_qlinkctrl_cmd = Command(b'_', b'\x26\x52', 'multifxtools', 'set_param_qlinkctrl', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) def is_fxcard_installed(self): """Get FX card installed diff --git a/src/aksy/devices/akai/z48/multitools.py b/src/aksy/devices/akai/z48/multitools.py index 3194a02..86b326a 100644 --- a/src/aksy/devices/akai/z48/multitools.py +++ b/src/aksy/devices/akai/z48/multitools.py @@ -14,114 +14,114 @@ class Multitools: def __init__(self, z48): self.sampler = z48 - self.get_no_items_cmd = Command('_', '\x18\x01', 'multitools', 'get_no_items', (), None) - self.get_handles_cmd = Command('_', '\x18\x02\x00', 'multitools', 'get_handles', (), None) - self.get_names_cmd = Command('_', '\x18\x02\x01', 'multitools', 'get_names', (), None) - self.get_handles_names_cmd = Command('_', '\x18\x02\x02', 'multitools', 'get_handles_names', (), None) - self.get_handles_tagged_cmd = Command('_', '\x18\x02\x03', 'multitools', 'get_handles_tagged', (), None) - self.set_curr_by_handle_cmd = Command('_', '\x18\x03', 'multitools', 'set_curr_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.set_curr_by_name_cmd = Command('_', '\x18\x04', 'multitools', 'set_curr_by_name', (aksy.devices.akai.sysex_types.STRING,), None) - self.get_curr_handle_cmd = Command('_', '\x18\x05', 'multitools', 'get_curr_handle', (), None) - self.get_curr_name_cmd = Command('_', '\x18\x06', 'multitools', 'get_curr_name', (), None) - self.get_name_by_handle_cmd = Command('_', '\x18\x07', 'multitools', 'get_name_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.get_handle_by_name_cmd = Command('_', '\x18\x08', 'multitools', 'get_handle_by_name', (aksy.devices.akai.sysex_types.STRING,), None) - self.delete_all_cmd = Command('_', '\x18\x09', 'multitools', 'delete_all', (), None) - self.delete_curr_cmd = Command('_', '\x18\x0A', 'multitools', 'delete_curr', (), None) - self.delete_by_handle_cmd = Command('_', '\x18\x0B', 'multitools', 'delete_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.rename_curr_cmd = Command('_', '\x18\x0C', 'multitools', 'rename_curr', (aksy.devices.akai.sysex_types.STRING,), None) - self.rename_by_handle_cmd = Command('_', '\x18\x0D', 'multitools', 'rename_by_handle', (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.STRING), None) - self.tag_cmd = Command('_', '\x18\x0E', 'multitools', 'tag', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_tag_bitmap_cmd = Command('_', '\x18\x0F', 'multitools', 'get_tag_bitmap', (), None) - self.get_curr_modified_cmd = Command('_', '\x18\x10', 'multitools', 'get_curr_modified', (), None) - self.get_modified_cmd = Command('_', '\x18\x11', 'multitools', 'get_modified', (), None) - self.delete_tagged_cmd = Command('_', '\x18\x18', 'multitools', 'delete_tagged', (aksy.devices.akai.sysex_types.BYTE,), None) - self.create_new_cmd = Command('_', '\x18\x40', 'multitools', 'create_new', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.STRING), None) - self.copy_cmd = Command('_', '\x18\x41', 'multitools', 'copy', (aksy.devices.akai.sysex_types.STRING,), None) - self.delete_part_cmd = Command('_', '\x18\x42', 'multitools', 'delete_part', (aksy.devices.akai.sysex_types.BYTE,), None) - self.delete_unused_parts_cmd = Command('_', '\x18\x43', 'multitools', 'delete_unused_parts', (), None) - self.arrange_parts_cmd = Command('_', '\x18\x44', 'multitools', 'arrange_parts', (), None) - self.set_group_id_cmd = Command('_', '\x1A\x01', 'multitools', 'set_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_multi_select_method_cmd = Command('_', '\x1A\x02', 'multitools', 'set_multi_select_method', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_multi_select_channel_cmd = Command('_', '\x1A\x03', 'multitools', 'set_multi_select_channel', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_multi_tempo_cmd = Command('_', '\x1A\x04', 'multitools', 'set_multi_tempo', (aksy.devices.akai.sysex_types.WORD,), None) - self.set_multi_program_no_cmd = Command('_', '\x1A\x08', 'multitools', 'set_multi_program_no', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_multi_part_by_handle_cmd = Command('_', '\x1A\x09', 'multitools', 'set_multi_part_by_handle', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.DWORD), None) - self.set_multi_part_name_cmd = Command('_', '\x1A\x0A', 'multitools', 'set_multi_part_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.STRING), None) - self.set_no_parts_cmd = Command('_', '\x1A\x0F', 'multitools', 'set_no_parts', (aksy.devices.akai.sysex_types.WORD,), None) - self.set_part_midi_channel_cmd = Command('_', '\x1A\x10', 'multitools', 'set_part_midi_channel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_part_mute_cmd = Command('_', '\x1A\x11', 'multitools', 'set_part_mute', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) - self.set_part_solo_cmd = Command('_', '\x1A\x12', 'multitools', 'set_part_solo', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) - self.set_part_level_cmd = Command('_', '\x1A\x13', 'multitools', 'set_part_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) - self.set_part_output_cmd = Command('_', '\x1A\x14', 'multitools', 'set_part_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_part_pan_cmd = Command('_', '\x1A\x15', 'multitools', 'set_part_pan', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_part_fx_channel_cmd = Command('_', '\x1A\x16', 'multitools', 'set_part_fx_channel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_part_fx_send_level_cmd = Command('_', '\x1A\x17', 'multitools', 'set_part_fx_send_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) - self.set_part_cents_tune_cmd = Command('_', '\x1A\x18', 'multitools', 'set_part_cents_tune', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) - self.set_part_low_note_cmd = Command('_', '\x1A\x1A', 'multitools', 'set_part_low_note', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_part_high_note_cmd = Command('_', '\x1A\x1B', 'multitools', 'set_part_high_note', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_part_priority_cmd = Command('_', '\x1A\x1C', 'multitools', 'set_part_priority', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_part_program_no_cmd = Command('_', '\x1A\x1D', 'multitools', 'set_part_program_no', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_part_group_id_cmd = Command('_', '\x1A\x1F', 'multitools', 'set_part_group_id', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_eq_output_channel_cmd = Command('_', '\x1A\x30', 'multitools', 'set_eq_output_channel', (aksy.devices.akai.sysex_types.BYTE,), None) - self.enable_eq_cmd = Command('_', '\x1A\x31', 'multitools', 'enable_eq', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_eq_low_gain_cmd = Command('_', '\x1A\x33', 'multitools', 'set_eq_low_gain', (aksy.devices.akai.sysex_types.SWORD,), None) - self.set_eq_low_freq_cmd = Command('_', '\x1A\x32', 'multitools', 'set_eq_low_freq', (aksy.devices.akai.sysex_types.WORD,), None) - self.set_eq_mid_gain_cmd = Command('_', '\x1A\x34', 'multitools', 'set_eq_mid_gain', (aksy.devices.akai.sysex_types.SWORD,), None) - self.set_eq_mid_freq_cmd = Command('_', '\x1A\x34', 'multitools', 'set_eq_mid_freq', (aksy.devices.akai.sysex_types.WORD,), None) - self.set_eq_high_gain_cmd = Command('_', '\x1A\x37', 'multitools', 'set_eq_high_gain', (aksy.devices.akai.sysex_types.SWORD,), None) - self.set_eq_high_freq_cmd = Command('_', '\x1A\x36', 'multitools', 'set_eq_high_freq', (aksy.devices.akai.sysex_types.WORD,), None) - self.enable_midi_filter_cmd = Command('_', '\x1A\x40', 'multitools', 'enable_midi_filter', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_midi_filter_by_part_cmd = Command('_', '\x1A\x41', 'multitools', 'set_midi_filter_by_part', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_midi_filter_by_channel_cmd = Command('_', '\x1A\x42', 'multitools', 'set_midi_filter_by_channel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_fx_assign_type_cmd = Command('_', '\x1A\x50', 'multitools', 'set_fx_assign_type', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_target_cmd = Command('_', '\x1A\x51', 'multitools', 'set_target', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.set_destination_cmd = Command('_', '\x1A\x52', 'multitools', 'set_destination', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.set_change_type_cmd = Command('_', '\x1A\x53', 'multitools', 'set_change_type', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_scale_min_cmd = Command('_', '\x1A\x54', 'multitools', 'set_scale_min', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) - self.set_scale_max_cmd = Command('_', '\x1A\x55', 'multitools', 'set_scale_max', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) - self.set_midi_ctl_output_cmd = Command('_', '\x1A\x56', 'multitools', 'set_midi_ctl_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.set_midi_channel_output_cmd = Command('_', '\x1A\x57', 'multitools', 'set_midi_channel_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) - self.get_group_id_cmd = Command('_', '\x1B\x01', 'multitools', 'get_group_id', (), None) - self.get_multi_select_method_cmd = Command('_', '\x1B\x02', 'multitools', 'get_multi_select_method', (), None) - self.get_multi_select_channel_cmd = Command('_', '\x1B\x03', 'multitools', 'get_multi_select_channel', (), None) - self.get_multi_tempo_cmd = Command('_', '\x1B\x04', 'multitools', 'get_multi_tempo', (), None) - self.get_multi_program_no_cmd = Command('_', '\x1B\x08', 'multitools', 'get_multi_program_no', (), None) - self.get_multi_part_handle_cmd = Command('_', '\x1B\x09', 'multitools', 'get_multi_part_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.get_multi_part_name_cmd = Command('_', '\x1B\x0A', 'multitools', 'get_multi_part_name', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_no_parts_cmd = Command('_', '\x1B\x0F', 'multitools', 'get_no_parts', (), None) - self.get_part_midi_channel_cmd = Command('_', '\x1B\x10', 'multitools', 'get_part_midi_channel', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_mute_cmd = Command('_', '\x1B\x11', 'multitools', 'get_part_mute', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_solo_cmd = Command('_', '\x1B\x12', 'multitools', 'get_part_solo', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_level_cmd = Command('_', '\x1B\x13', 'multitools', 'get_part_level', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_output_cmd = Command('_', '\x1B\x14', 'multitools', 'get_part_output', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_pan_cmd = Command('_', '\x1B\x15', 'multitools', 'get_part_pan', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_fx_channel_cmd = Command('_', '\x1B\x16', 'multitools', 'get_part_fx_channel', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_fx_send_level_cmd = Command('_', '\x1B\x17', 'multitools', 'get_part_fx_send_level', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_tune_cmd = Command('_', '\x1B\x18', 'multitools', 'get_part_tune', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_low_note_cmd = Command('_', '\x1B\x1A', 'multitools', 'get_part_low_note', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_high_note_cmd = Command('_', '\x1B\x1B', 'multitools', 'get_part_high_note', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_priority_cmd = Command('_', '\x1B\x1C', 'multitools', 'get_part_priority', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_prog_no_cmd = Command('_', '\x1B\x1D', 'multitools', 'get_part_prog_no', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_part_group_id_cmd = Command('_', '\x1B\x1F', 'multitools', 'get_part_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_eq_output_channel_cmd = Command('_', '\x1B\x30', 'multitools', 'get_eq_output_channel', (), None) - self.is_eq_enabled_cmd = Command('_', '\x1B\x31', 'multitools', 'is_eq_enabled', (), None) - self.get_eq_low_gain_cmd = Command('_', '\x1B\x33', 'multitools', 'get_eq_low_gain', (), None) - self.get_eq_low_freq_cmd = Command('_', '\x1B\x32', 'multitools', 'get_eq_low_freq', (), None) - self.get_eq_mid_gain_cmd = Command('_', '\x1B\x35', 'multitools', 'get_eq_mid_gain', (), None) - self.get_eq_mid_freq_cmd = Command('_', '\x1B\x34', 'multitools', 'get_eq_mid_freq', (), None) - self.get_eq_high_gain_cmd = Command('_', '\x1B\x37', 'multitools', 'get_eq_high_gain', (), None) - self.get_eq_high_freq_cmd = Command('_', '\x1B\x36', 'multitools', 'get_eq_high_freq', (), None) - self.is_midi_filter_enabled_cmd = Command('_', '\x1B\x40', 'multitools', 'is_midi_filter_enabled', (), None) - self.get_midi_filter_by_part_cmd = Command('_', '\x1B\x41', 'multitools', 'get_midi_filter_by_part', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_midi_filter_by_channel_cmd = Command('_', '\x1B\x42', 'multitools', 'get_midi_filter_by_channel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_fx_assign_type_cmd = Command('_', '\x1B\x50', 'multitools', 'get_fx_assign_type', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_target_cmd = Command('_', '\x1B\x51', 'multitools', 'get_target', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_destination_cmd = Command('_', '\x1B\x52', 'multitools', 'get_destination', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_change_type_cmd = Command('_', '\x1B\x53', 'multitools', 'get_change_type', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_scale_min_cmd = Command('_', '\x1B\x54', 'multitools', 'get_scale_min', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_scale_max_cmd = Command('_', '\x1B\x55', 'multitools', 'get_scale_max', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_midi_ctl_output_cmd = Command('_', '\x1B\x56', 'multitools', 'get_midi_ctl_output', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_midi_channel_output_cmd = Command('_', '\x1B\x57', 'multitools', 'get_midi_channel_output', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_no_items_cmd = Command(b'_', b'\x18\x01', 'multitools', 'get_no_items', (), None) + self.get_handles_cmd = Command(b'_', b'\x18\x02\x00', 'multitools', 'get_handles', (), None) + self.get_names_cmd = Command(b'_', b'\x18\x02\x01', 'multitools', 'get_names', (), None) + self.get_handles_names_cmd = Command(b'_', b'\x18\x02\x02', 'multitools', 'get_handles_names', (), None) + self.get_handles_tagged_cmd = Command(b'_', b'\x18\x02\x03', 'multitools', 'get_handles_tagged', (), None) + self.set_curr_by_handle_cmd = Command(b'_', b'\x18\x03', 'multitools', 'set_curr_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.set_curr_by_name_cmd = Command(b'_', b'\x18\x04', 'multitools', 'set_curr_by_name', (aksy.devices.akai.sysex_types.STRING,), None) + self.get_curr_handle_cmd = Command(b'_', b'\x18\x05', 'multitools', 'get_curr_handle', (), None) + self.get_curr_name_cmd = Command(b'_', b'\x18\x06', 'multitools', 'get_curr_name', (), None) + self.get_name_by_handle_cmd = Command(b'_', b'\x18\x07', 'multitools', 'get_name_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.get_handle_by_name_cmd = Command(b'_', b'\x18\x08', 'multitools', 'get_handle_by_name', (aksy.devices.akai.sysex_types.STRING,), None) + self.delete_all_cmd = Command(b'_', b'\x18\x09', 'multitools', 'delete_all', (), None) + self.delete_curr_cmd = Command(b'_', b'\x18\x0A', 'multitools', 'delete_curr', (), None) + self.delete_by_handle_cmd = Command(b'_', b'\x18\x0B', 'multitools', 'delete_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.rename_curr_cmd = Command(b'_', b'\x18\x0C', 'multitools', 'rename_curr', (aksy.devices.akai.sysex_types.STRING,), None) + self.rename_by_handle_cmd = Command(b'_', b'\x18\x0D', 'multitools', 'rename_by_handle', (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.STRING), None) + self.tag_cmd = Command(b'_', b'\x18\x0E', 'multitools', 'tag', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_tag_bitmap_cmd = Command(b'_', b'\x18\x0F', 'multitools', 'get_tag_bitmap', (), None) + self.get_curr_modified_cmd = Command(b'_', b'\x18\x10', 'multitools', 'get_curr_modified', (), None) + self.get_modified_cmd = Command(b'_', b'\x18\x11', 'multitools', 'get_modified', (), None) + self.delete_tagged_cmd = Command(b'_', b'\x18\x18', 'multitools', 'delete_tagged', (aksy.devices.akai.sysex_types.BYTE,), None) + self.create_new_cmd = Command(b'_', b'\x18\x40', 'multitools', 'create_new', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.STRING), None) + self.copy_cmd = Command(b'_', b'\x18\x41', 'multitools', 'copy', (aksy.devices.akai.sysex_types.STRING,), None) + self.delete_part_cmd = Command(b'_', b'\x18\x42', 'multitools', 'delete_part', (aksy.devices.akai.sysex_types.BYTE,), None) + self.delete_unused_parts_cmd = Command(b'_', b'\x18\x43', 'multitools', 'delete_unused_parts', (), None) + self.arrange_parts_cmd = Command(b'_', b'\x18\x44', 'multitools', 'arrange_parts', (), None) + self.set_group_id_cmd = Command(b'_', b'\x1A\x01', 'multitools', 'set_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_multi_select_method_cmd = Command(b'_', b'\x1A\x02', 'multitools', 'set_multi_select_method', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_multi_select_channel_cmd = Command(b'_', b'\x1A\x03', 'multitools', 'set_multi_select_channel', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_multi_tempo_cmd = Command(b'_', b'\x1A\x04', 'multitools', 'set_multi_tempo', (aksy.devices.akai.sysex_types.WORD,), None) + self.set_multi_program_no_cmd = Command(b'_', b'\x1A\x08', 'multitools', 'set_multi_program_no', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_multi_part_by_handle_cmd = Command(b'_', b'\x1A\x09', 'multitools', 'set_multi_part_by_handle', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.DWORD), None) + self.set_multi_part_name_cmd = Command(b'_', b'\x1A\x0A', 'multitools', 'set_multi_part_name', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.STRING), None) + self.set_no_parts_cmd = Command(b'_', b'\x1A\x0F', 'multitools', 'set_no_parts', (aksy.devices.akai.sysex_types.WORD,), None) + self.set_part_midi_channel_cmd = Command(b'_', b'\x1A\x10', 'multitools', 'set_part_midi_channel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_part_mute_cmd = Command(b'_', b'\x1A\x11', 'multitools', 'set_part_mute', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) + self.set_part_solo_cmd = Command(b'_', b'\x1A\x12', 'multitools', 'set_part_solo', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) + self.set_part_level_cmd = Command(b'_', b'\x1A\x13', 'multitools', 'set_part_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) + self.set_part_output_cmd = Command(b'_', b'\x1A\x14', 'multitools', 'set_part_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_part_pan_cmd = Command(b'_', b'\x1A\x15', 'multitools', 'set_part_pan', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_part_fx_channel_cmd = Command(b'_', b'\x1A\x16', 'multitools', 'set_part_fx_channel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_part_fx_send_level_cmd = Command(b'_', b'\x1A\x17', 'multitools', 'set_part_fx_send_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) + self.set_part_cents_tune_cmd = Command(b'_', b'\x1A\x18', 'multitools', 'set_part_cents_tune', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) + self.set_part_low_note_cmd = Command(b'_', b'\x1A\x1A', 'multitools', 'set_part_low_note', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_part_high_note_cmd = Command(b'_', b'\x1A\x1B', 'multitools', 'set_part_high_note', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_part_priority_cmd = Command(b'_', b'\x1A\x1C', 'multitools', 'set_part_priority', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_part_program_no_cmd = Command(b'_', b'\x1A\x1D', 'multitools', 'set_part_program_no', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_part_group_id_cmd = Command(b'_', b'\x1A\x1F', 'multitools', 'set_part_group_id', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_eq_output_channel_cmd = Command(b'_', b'\x1A\x30', 'multitools', 'set_eq_output_channel', (aksy.devices.akai.sysex_types.BYTE,), None) + self.enable_eq_cmd = Command(b'_', b'\x1A\x31', 'multitools', 'enable_eq', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_eq_low_gain_cmd = Command(b'_', b'\x1A\x33', 'multitools', 'set_eq_low_gain', (aksy.devices.akai.sysex_types.SWORD,), None) + self.set_eq_low_freq_cmd = Command(b'_', b'\x1A\x32', 'multitools', 'set_eq_low_freq', (aksy.devices.akai.sysex_types.WORD,), None) + self.set_eq_mid_gain_cmd = Command(b'_', b'\x1A\x34', 'multitools', 'set_eq_mid_gain', (aksy.devices.akai.sysex_types.SWORD,), None) + self.set_eq_mid_freq_cmd = Command(b'_', b'\x1A\x34', 'multitools', 'set_eq_mid_freq', (aksy.devices.akai.sysex_types.WORD,), None) + self.set_eq_high_gain_cmd = Command(b'_', b'\x1A\x37', 'multitools', 'set_eq_high_gain', (aksy.devices.akai.sysex_types.SWORD,), None) + self.set_eq_high_freq_cmd = Command(b'_', b'\x1A\x36', 'multitools', 'set_eq_high_freq', (aksy.devices.akai.sysex_types.WORD,), None) + self.enable_midi_filter_cmd = Command(b'_', b'\x1A\x40', 'multitools', 'enable_midi_filter', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_midi_filter_by_part_cmd = Command(b'_', b'\x1A\x41', 'multitools', 'set_midi_filter_by_part', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_midi_filter_by_channel_cmd = Command(b'_', b'\x1A\x42', 'multitools', 'set_midi_filter_by_channel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_fx_assign_type_cmd = Command(b'_', b'\x1A\x50', 'multitools', 'set_fx_assign_type', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_target_cmd = Command(b'_', b'\x1A\x51', 'multitools', 'set_target', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.set_destination_cmd = Command(b'_', b'\x1A\x52', 'multitools', 'set_destination', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.set_change_type_cmd = Command(b'_', b'\x1A\x53', 'multitools', 'set_change_type', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_scale_min_cmd = Command(b'_', b'\x1A\x54', 'multitools', 'set_scale_min', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) + self.set_scale_max_cmd = Command(b'_', b'\x1A\x55', 'multitools', 'set_scale_max', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) + self.set_midi_ctl_output_cmd = Command(b'_', b'\x1A\x56', 'multitools', 'set_midi_ctl_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.set_midi_channel_output_cmd = Command(b'_', b'\x1A\x57', 'multitools', 'set_midi_channel_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) + self.get_group_id_cmd = Command(b'_', b'\x1B\x01', 'multitools', 'get_group_id', (), None) + self.get_multi_select_method_cmd = Command(b'_', b'\x1B\x02', 'multitools', 'get_multi_select_method', (), None) + self.get_multi_select_channel_cmd = Command(b'_', b'\x1B\x03', 'multitools', 'get_multi_select_channel', (), None) + self.get_multi_tempo_cmd = Command(b'_', b'\x1B\x04', 'multitools', 'get_multi_tempo', (), None) + self.get_multi_program_no_cmd = Command(b'_', b'\x1B\x08', 'multitools', 'get_multi_program_no', (), None) + self.get_multi_part_handle_cmd = Command(b'_', b'\x1B\x09', 'multitools', 'get_multi_part_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.get_multi_part_name_cmd = Command(b'_', b'\x1B\x0A', 'multitools', 'get_multi_part_name', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_no_parts_cmd = Command(b'_', b'\x1B\x0F', 'multitools', 'get_no_parts', (), None) + self.get_part_midi_channel_cmd = Command(b'_', b'\x1B\x10', 'multitools', 'get_part_midi_channel', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_mute_cmd = Command(b'_', b'\x1B\x11', 'multitools', 'get_part_mute', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_solo_cmd = Command(b'_', b'\x1B\x12', 'multitools', 'get_part_solo', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_level_cmd = Command(b'_', b'\x1B\x13', 'multitools', 'get_part_level', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_output_cmd = Command(b'_', b'\x1B\x14', 'multitools', 'get_part_output', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_pan_cmd = Command(b'_', b'\x1B\x15', 'multitools', 'get_part_pan', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_fx_channel_cmd = Command(b'_', b'\x1B\x16', 'multitools', 'get_part_fx_channel', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_fx_send_level_cmd = Command(b'_', b'\x1B\x17', 'multitools', 'get_part_fx_send_level', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_tune_cmd = Command(b'_', b'\x1B\x18', 'multitools', 'get_part_tune', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_low_note_cmd = Command(b'_', b'\x1B\x1A', 'multitools', 'get_part_low_note', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_high_note_cmd = Command(b'_', b'\x1B\x1B', 'multitools', 'get_part_high_note', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_priority_cmd = Command(b'_', b'\x1B\x1C', 'multitools', 'get_part_priority', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_prog_no_cmd = Command(b'_', b'\x1B\x1D', 'multitools', 'get_part_prog_no', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_part_group_id_cmd = Command(b'_', b'\x1B\x1F', 'multitools', 'get_part_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_eq_output_channel_cmd = Command(b'_', b'\x1B\x30', 'multitools', 'get_eq_output_channel', (), None) + self.is_eq_enabled_cmd = Command(b'_', b'\x1B\x31', 'multitools', 'is_eq_enabled', (), None) + self.get_eq_low_gain_cmd = Command(b'_', b'\x1B\x33', 'multitools', 'get_eq_low_gain', (), None) + self.get_eq_low_freq_cmd = Command(b'_', b'\x1B\x32', 'multitools', 'get_eq_low_freq', (), None) + self.get_eq_mid_gain_cmd = Command(b'_', b'\x1B\x35', 'multitools', 'get_eq_mid_gain', (), None) + self.get_eq_mid_freq_cmd = Command(b'_', b'\x1B\x34', 'multitools', 'get_eq_mid_freq', (), None) + self.get_eq_high_gain_cmd = Command(b'_', b'\x1B\x37', 'multitools', 'get_eq_high_gain', (), None) + self.get_eq_high_freq_cmd = Command(b'_', b'\x1B\x36', 'multitools', 'get_eq_high_freq', (), None) + self.is_midi_filter_enabled_cmd = Command(b'_', b'\x1B\x40', 'multitools', 'is_midi_filter_enabled', (), None) + self.get_midi_filter_by_part_cmd = Command(b'_', b'\x1B\x41', 'multitools', 'get_midi_filter_by_part', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_midi_filter_by_channel_cmd = Command(b'_', b'\x1B\x42', 'multitools', 'get_midi_filter_by_channel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_fx_assign_type_cmd = Command(b'_', b'\x1B\x50', 'multitools', 'get_fx_assign_type', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_target_cmd = Command(b'_', b'\x1B\x51', 'multitools', 'get_target', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_destination_cmd = Command(b'_', b'\x1B\x52', 'multitools', 'get_destination', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_change_type_cmd = Command(b'_', b'\x1B\x53', 'multitools', 'get_change_type', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_scale_min_cmd = Command(b'_', b'\x1B\x54', 'multitools', 'get_scale_min', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_scale_max_cmd = Command(b'_', b'\x1B\x55', 'multitools', 'get_scale_max', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_midi_ctl_output_cmd = Command(b'_', b'\x1B\x56', 'multitools', 'get_midi_ctl_output', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_midi_channel_output_cmd = Command(b'_', b'\x1B\x57', 'multitools', 'get_midi_channel_output', (aksy.devices.akai.sysex_types.BYTE,), None) def get_no_items(self): """Get number of items in memory diff --git a/src/aksy/devices/akai/z48/programtools.py b/src/aksy/devices/akai/z48/programtools.py index 6921a26..43c4bc9 100644 --- a/src/aksy/devices/akai/z48/programtools.py +++ b/src/aksy/devices/akai/z48/programtools.py @@ -14,116 +14,116 @@ class Programtools: def __init__(self, z48): self.sampler = z48 - self.get_no_items_cmd = Command('_', '\x14\x01', 'programtools', 'get_no_items', (), None) - self.get_handles_cmd = Command('_', '\x14\x02\x00', 'programtools', 'get_handles', (), None) - self.get_names_cmd = Command('_', '\x14\x02\x01', 'programtools', 'get_names', (), None) - self.get_handles_names_cmd = Command('_', '\x14\x02\x02', 'programtools', 'get_handles_names', (), None) - self.get_modified_cmd = Command('_', '\x14\x02\x03', 'programtools', 'get_modified', (), None) - self.set_curr_by_handle_cmd = Command('_', '\x14\x03', 'programtools', 'set_curr_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.set_curr_by_name_cmd = Command('_', '\x14\x04', 'programtools', 'set_curr_by_name', (aksy.devices.akai.sysex_types.STRING,), None) - self.get_curr_handle_cmd = Command('_', '\x14\x05', 'programtools', 'get_curr_handle', (), None) - self.get_curr_name_cmd = Command('_', '\x14\x06', 'programtools', 'get_curr_name', (), None) - self.get_name_by_handle_cmd = Command('_', '\x14\x07', 'programtools', 'get_name_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.get_handle_by_name_cmd = Command('_', '\x14\x08', 'programtools', 'get_handle_by_name', (aksy.devices.akai.sysex_types.STRING,), None) - self.delete_all_cmd = Command('_', '\x14\x09', 'programtools', 'delete_all', (), None) - self.delete_curr_cmd = Command('_', '\x14\x0A', 'programtools', 'delete_curr', (), None) - self.delete_by_handle_cmd = Command('_', '\x14\x0B', 'programtools', 'delete_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.rename_curr_cmd = Command('_', '\x14\x0C', 'programtools', 'rename_curr', (aksy.devices.akai.sysex_types.STRING,), None) - self.rename_by_handle_cmd = Command('_', '\x14\x0D', 'programtools', 'rename_by_handle', (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.STRING), None) - self.tag_cmd = Command('_', '\x14\x0E', 'programtools', 'tag', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_tag_bitmap_cmd = Command('_', '\x14\x0F', 'programtools', 'get_tag_bitmap', (), None) - self.get_modified_name_cmd = Command('_', '\x14\x10', 'programtools', 'get_modified_name', (), None) - self.get_modified_state_cmd = Command('_', '\x14\x11', 'programtools', 'get_modified_state', (), None) - self.delete_tagged_cmd = Command('_', '\x14\x18', 'programtools', 'delete_tagged', (aksy.devices.akai.sysex_types.BYTE,), None) - self.create_new_cmd = Command('_', '\x14\x40', 'programtools', 'create_new', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.STRING), None) - self.add_keygroups_cmd = Command('_', '\x14\x41', 'programtools', 'add_keygroups', (aksy.devices.akai.sysex_types.BYTE,), None) - self.delete_keygroup_cmd = Command('_', '\x14\x42', 'programtools', 'delete_keygroup', (aksy.devices.akai.sysex_types.BYTE,), None) - self.delete_blank_keygroups_cmd = Command('_', '\x14\x43', 'programtools', 'delete_blank_keygroups', (), None) - self.arrange_keygroups_cmd = Command('_', '\x14\x44', 'programtools', 'arrange_keygroups', (aksy.devices.akai.sysex_types.BYTE,), None) - self.copy_keygroup_cmd = Command('_', '\x14\x45', 'programtools', 'copy_keygroup', (aksy.devices.akai.sysex_types.BYTE,), None) - self.copy_cmd = Command('_', '\x14\x48', 'programtools', 'copy', (aksy.devices.akai.sysex_types.STRING,), None) - self.merge_programs_cmd = Command('_', '\x14\x49', 'programtools', 'merge_programs', (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.DWORD), None) - self.add_keygroup_sample_cmd = Command('_', '\x14\x4A', 'programtools', 'add_keygroup_sample', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL, aksy.devices.akai.sysex_types.STRING), None) - self.copy_temperament_to_user_cmd = Command('_', '\x14\x50', 'programtools', 'copy_temperament_to_user', (), None) - self.get_no_modulation_connections_cmd = Command('_', '\x14\x54', 'programtools', 'get_no_modulation_connections', (), None) - self.get_no_modulation_sources_cmd = Command('_', '\x14\x55', 'programtools', 'get_no_modulation_sources', (), None) - self.get_no_modulation_destinations_cmd = Command('_', '\x14\x56', 'programtools', 'get_no_modulation_destinations', (), None) - self.get_name_modulation_source_cmd = Command('_', '\x14\x57', 'programtools', 'get_name_modulation_source', (aksy.devices.akai.sysex_types.WORD,), None) - self.get_name_modulation_dest_cmd = Command('_', '\x14\x58', 'programtools', 'get_name_modulation_dest', (aksy.devices.akai.sysex_types.WORD,), None) - self.get_group_id_cmd = Command('_', '\x17\x01', 'programtools', 'get_group_id', (), None) - self.get_type_cmd = Command('_', '\x17\x03', 'programtools', 'get_type', (), None) - self.get_genre_cmd = Command('_', '\x17\x04', 'programtools', 'get_genre', (), None) - self.get_program_no_cmd = Command('_', '\x17\x08', 'programtools', 'get_program_no', (), None) - self.get_no_keygroups_cmd = Command('_', '\x17\x09', 'programtools', 'get_no_keygroups', (), None) - self.get_keygroup_xfade_cmd = Command('_', '\x17\x0A', 'programtools', 'get_keygroup_xfade', (), None) - self.get_keygroup_xfade_type_cmd = Command('_', '\x17\x0B', 'programtools', 'get_keygroup_xfade_type', (), None) - self.get_level_cmd = Command('_', '\x17\x0C', 'programtools', 'get_level', (), None) - self.get_polyphony_cmd = Command('_', '\x17\x10', 'programtools', 'get_polyphony', (), None) - self.get_reassignment_method_cmd = Command('_', '\x17\x11', 'programtools', 'get_reassignment_method', (), None) - self.get_softpedal_loudness_reduction_cmd = Command('_', '\x17\x12', 'programtools', 'get_softpedal_loudness_reduction', (), None) - self.get_softpedal_attack_stretch_cmd = Command('_', '\x17\x13', 'programtools', 'get_softpedal_attack_stretch', (), None) - self.get_softpedal_filter_close_cmd = Command('_', '\x17\x14', 'programtools', 'get_softpedal_filter_close', (), None) - self.get_midi_transpose_cmd = Command('_', '\x17\x15', 'programtools', 'get_midi_transpose', (), None) - self.get_mpc_pad_assignment_cmd = Command('_', '\x17\x18', 'programtools', 'get_mpc_pad_assignment', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_modulation_connection_cmd = Command('_', '\x17\x20', 'programtools', 'get_modulation_connection', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.get_modulation_source_type_cmd = Command('_', '\x17\x21', 'programtools', 'get_modulation_source_type', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_modulation_destination_type_cmd = Command('_', '\x17\x22', 'programtools', 'get_modulation_destination_type', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_modulation_level_cmd = Command('_', '\x17\x23', 'programtools', 'get_modulation_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.get_midi_controller_number_cmd = Command('_', '\x17\x24', 'programtools', 'get_midi_controller_number', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_edit_keygroup_cmd = Command('_', '\x17\x25', 'programtools', 'get_edit_keygroup', (), None) - self.get_modulation_level_edit_keygroup_cmd = Command('_', '\x17\x26', 'programtools', 'get_modulation_level_edit_keygroup', (), None) - self.get_tune_cmd = Command('_', '\x17\x30', 'programtools', 'get_tune', (), None) - self.get_temperament_template_cmd = Command('_', '\x17\x31', 'programtools', 'get_temperament_template', (), None) - self.get_program_temperament_cmd = Command('_', '\x17\x32', 'programtools', 'get_program_temperament', (), None) - self.get_key_cmd = Command('_', '\x17\x33', 'programtools', 'get_key', (), None) - self.get_user_temperament_note_cmd = Command('_', '\x17\x34', 'programtools', 'get_user_temperament_note', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_pitchbend_up_cmd = Command('_', '\x17\x40', 'programtools', 'get_pitchbend_up', (), None) - self.get_pitchbend_down_cmd = Command('_', '\x17\x41', 'programtools', 'get_pitchbend_down', (), None) - self.get_pitchbend_mode_cmd = Command('_', '\x17\x42', 'programtools', 'get_pitchbend_mode', (), None) - self.get_aftertouch_value_cmd = Command('_', '\x17\x43', 'programtools', 'get_aftertouch_value', (), None) - self.get_legato_cmd = Command('_', '\x17\x44', 'programtools', 'get_legato', (), None) - self.get_portamento_enabled_cmd = Command('_', '\x17\x45', 'programtools', 'get_portamento_enabled', (), None) - self.get_portamento_mode_cmd = Command('_', '\x17\x46', 'programtools', 'get_portamento_mode', (), None) - self.get_portamento_time_cmd = Command('_', '\x17\x47', 'programtools', 'get_portamento_time', (), None) - self.get_glissando_mode_cmd = Command('_', '\x17\x48', 'programtools', 'get_glissando_mode', (), None) - self.get_aftertouch_mode_cmd = Command('_', '\x17\x49', 'programtools', 'get_aftertouch_mode', (), None) - self.set_group_id_cmd = Command('_', '\x16\x01', 'programtools', 'set_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_type_cmd = Command('_', '\x16\x03', 'programtools', 'set_type', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_genre_cmd = Command('_', '\x16\x04', 'programtools', 'set_genre', (aksy.devices.akai.sysex_types.STRING,), None) - self.set_program_no_cmd = Command('_', '\x16\x08', 'programtools', 'set_program_no', (aksy.devices.akai.sysex_types.WORD,), None) - self.set_no_keygroups_cmd = Command('_', '\x16\x09', 'programtools', 'set_no_keygroups', (aksy.devices.akai.sysex_types.WORD,), None) - self.set_keygroup_xfade_cmd = Command('_', '\x16\x0A', 'programtools', 'set_keygroup_xfade', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_keygroup_xfade_type_cmd = Command('_', '\x16\x0B', 'programtools', 'set_keygroup_xfade_type', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_level_cmd = Command('_', '\x16\x0C', 'programtools', 'set_level', (aksy.devices.akai.sysex_types.SWORD,), None) - self.set_polyphony_cmd = Command('_', '\x16\x10', 'programtools', 'set_polyphony', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_reassignment_method_cmd = Command('_', '\x16\x11', 'programtools', 'set_reassignment_method', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_softpedal_loudness_reduction_cmd = Command('_', '\x16\x12', 'programtools', 'set_softpedal_loudness_reduction', (), None) - self.set_softpedal_attack_stretch_cmd = Command('_', '\x16\x13', 'programtools', 'set_softpedal_attack_stretch', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_softpedal_filter_close_cmd = Command('_', '\x16\x14', 'programtools', 'set_softpedal_filter_close', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_midi_transpose_cmd = Command('_', '\x16\x15', 'programtools', 'set_midi_transpose', (aksy.devices.akai.sysex_types.SBYTE,), None) - self.set_mpc_pad_assignment_cmd = Command('_', '\x16\x18', 'programtools', 'set_mpc_pad_assignment', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_modulation_connection_cmd = Command('_', '\x16\x20', 'programtools', 'set_modulation_connection', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.SBYTE), None) - self.set_modulation_source_cmd = Command('_', '\x16\x21', 'programtools', 'set_modulation_source', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.set_modulation_destination_cmd = Command('_', '\x16\x22', 'programtools', 'set_modulation_destination', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.set_modulation_level_cmd = Command('_', '\x16\x23', 'programtools', 'set_modulation_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.SBYTE), None) - self.set_midi_ctrl_no_cmd = Command('_', '\x16\x24', 'programtools', 'set_midi_ctrl_no', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_edit_keygroup_cmd = Command('_', '\x16\x25', 'programtools', 'set_edit_keygroup', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) - self.set_edit_kegyroup_modulation_level_cmd = Command('_', '\x16\x26', 'programtools', 'set_edit_kegyroup_modulation_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_tune_cmd = Command('_', '\x16\x30', 'programtools', 'set_tune', (aksy.devices.akai.sysex_types.TUNE,), None) - self.set_temperament_template_cmd = Command('_', '\x16\x31', 'programtools', 'set_temperament_template', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_program_temperament_cmd = Command('_', '\x16\x32', 'programtools', 'set_program_temperament', (aksy.devices.akai.sysex_types.SBYTE,), None) - self.set_key_cmd = Command('_', '\x16\x33', 'programtools', 'set_key', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_user_temperament_note_cmd = Command('_', '\x16\x34', 'programtools', 'set_user_temperament_note', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) - self.set_pitchbend_up_cmd = Command('_', '\x16\x40', 'programtools', 'set_pitchbend_up', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_pitchbend_down_cmd = Command('_', '\x16\x41', 'programtools', 'set_pitchbend_down', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_pitchbend_mode_cmd = Command('_', '\x16\x42', 'programtools', 'set_pitchbend_mode', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_aftertouch_value_cmd = Command('_', '\x16\x43', 'programtools', 'set_aftertouch_value', (aksy.devices.akai.sysex_types.SBYTE,), None) - self.set_legato_cmd = Command('_', '\x16\x44', 'programtools', 'set_legato', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_portamento_enabled_cmd = Command('_', '\x16\x45', 'programtools', 'set_portamento_enabled', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_portamento_mode_cmd = Command('_', '\x16\x46', 'programtools', 'set_portamento_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_portamento_time_cmd = Command('_', '\x16\x47', 'programtools', 'set_portamento_time', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_glissando_mode_cmd = Command('_', '\x16\x48', 'programtools', 'set_glissando_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_aftertouch_mode_cmd = Command('_', '\x16\x49', 'programtools', 'set_aftertouch_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_no_items_cmd = Command(b'_', b'\x14\x01', 'programtools', 'get_no_items', (), None) + self.get_handles_cmd = Command(b'_', b'\x14\x02\x00', 'programtools', 'get_handles', (), None) + self.get_names_cmd = Command(b'_', b'\x14\x02\x01', 'programtools', 'get_names', (), None) + self.get_handles_names_cmd = Command(b'_', b'\x14\x02\x02', 'programtools', 'get_handles_names', (), None) + self.get_modified_cmd = Command(b'_', b'\x14\x02\x03', 'programtools', 'get_modified', (), None) + self.set_curr_by_handle_cmd = Command(b'_', b'\x14\x03', 'programtools', 'set_curr_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.set_curr_by_name_cmd = Command(b'_', b'\x14\x04', 'programtools', 'set_curr_by_name', (aksy.devices.akai.sysex_types.STRING,), None) + self.get_curr_handle_cmd = Command(b'_', b'\x14\x05', 'programtools', 'get_curr_handle', (), None) + self.get_curr_name_cmd = Command(b'_', b'\x14\x06', 'programtools', 'get_curr_name', (), None) + self.get_name_by_handle_cmd = Command(b'_', b'\x14\x07', 'programtools', 'get_name_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.get_handle_by_name_cmd = Command(b'_', b'\x14\x08', 'programtools', 'get_handle_by_name', (aksy.devices.akai.sysex_types.STRING,), None) + self.delete_all_cmd = Command(b'_', b'\x14\x09', 'programtools', 'delete_all', (), None) + self.delete_curr_cmd = Command(b'_', b'\x14\x0A', 'programtools', 'delete_curr', (), None) + self.delete_by_handle_cmd = Command(b'_', b'\x14\x0B', 'programtools', 'delete_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.rename_curr_cmd = Command(b'_', b'\x14\x0C', 'programtools', 'rename_curr', (aksy.devices.akai.sysex_types.STRING,), None) + self.rename_by_handle_cmd = Command(b'_', b'\x14\x0D', 'programtools', 'rename_by_handle', (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.STRING), None) + self.tag_cmd = Command(b'_', b'\x14\x0E', 'programtools', 'tag', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_tag_bitmap_cmd = Command(b'_', b'\x14\x0F', 'programtools', 'get_tag_bitmap', (), None) + self.get_modified_name_cmd = Command(b'_', b'\x14\x10', 'programtools', 'get_modified_name', (), None) + self.get_modified_state_cmd = Command(b'_', b'\x14\x11', 'programtools', 'get_modified_state', (), None) + self.delete_tagged_cmd = Command(b'_', b'\x14\x18', 'programtools', 'delete_tagged', (aksy.devices.akai.sysex_types.BYTE,), None) + self.create_new_cmd = Command(b'_', b'\x14\x40', 'programtools', 'create_new', (aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.STRING), None) + self.add_keygroups_cmd = Command(b'_', b'\x14\x41', 'programtools', 'add_keygroups', (aksy.devices.akai.sysex_types.BYTE,), None) + self.delete_keygroup_cmd = Command(b'_', b'\x14\x42', 'programtools', 'delete_keygroup', (aksy.devices.akai.sysex_types.BYTE,), None) + self.delete_blank_keygroups_cmd = Command(b'_', b'\x14\x43', 'programtools', 'delete_blank_keygroups', (), None) + self.arrange_keygroups_cmd = Command(b'_', b'\x14\x44', 'programtools', 'arrange_keygroups', (aksy.devices.akai.sysex_types.BYTE,), None) + self.copy_keygroup_cmd = Command(b'_', b'\x14\x45', 'programtools', 'copy_keygroup', (aksy.devices.akai.sysex_types.BYTE,), None) + self.copy_cmd = Command(b'_', b'\x14\x48', 'programtools', 'copy', (aksy.devices.akai.sysex_types.STRING,), None) + self.merge_programs_cmd = Command(b'_', b'\x14\x49', 'programtools', 'merge_programs', (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.DWORD), None) + self.add_keygroup_sample_cmd = Command(b'_', b'\x14\x4A', 'programtools', 'add_keygroup_sample', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL, aksy.devices.akai.sysex_types.STRING), None) + self.copy_temperament_to_user_cmd = Command(b'_', b'\x14\x50', 'programtools', 'copy_temperament_to_user', (), None) + self.get_no_modulation_connections_cmd = Command(b'_', b'\x14\x54', 'programtools', 'get_no_modulation_connections', (), None) + self.get_no_modulation_sources_cmd = Command(b'_', b'\x14\x55', 'programtools', 'get_no_modulation_sources', (), None) + self.get_no_modulation_destinations_cmd = Command(b'_', b'\x14\x56', 'programtools', 'get_no_modulation_destinations', (), None) + self.get_name_modulation_source_cmd = Command(b'_', b'\x14\x57', 'programtools', 'get_name_modulation_source', (aksy.devices.akai.sysex_types.WORD,), None) + self.get_name_modulation_dest_cmd = Command(b'_', b'\x14\x58', 'programtools', 'get_name_modulation_dest', (aksy.devices.akai.sysex_types.WORD,), None) + self.get_group_id_cmd = Command(b'_', b'\x17\x01', 'programtools', 'get_group_id', (), None) + self.get_type_cmd = Command(b'_', b'\x17\x03', 'programtools', 'get_type', (), None) + self.get_genre_cmd = Command(b'_', b'\x17\x04', 'programtools', 'get_genre', (), None) + self.get_program_no_cmd = Command(b'_', b'\x17\x08', 'programtools', 'get_program_no', (), None) + self.get_no_keygroups_cmd = Command(b'_', b'\x17\x09', 'programtools', 'get_no_keygroups', (), None) + self.get_keygroup_xfade_cmd = Command(b'_', b'\x17\x0A', 'programtools', 'get_keygroup_xfade', (), None) + self.get_keygroup_xfade_type_cmd = Command(b'_', b'\x17\x0B', 'programtools', 'get_keygroup_xfade_type', (), None) + self.get_level_cmd = Command(b'_', b'\x17\x0C', 'programtools', 'get_level', (), None) + self.get_polyphony_cmd = Command(b'_', b'\x17\x10', 'programtools', 'get_polyphony', (), None) + self.get_reassignment_method_cmd = Command(b'_', b'\x17\x11', 'programtools', 'get_reassignment_method', (), None) + self.get_softpedal_loudness_reduction_cmd = Command(b'_', b'\x17\x12', 'programtools', 'get_softpedal_loudness_reduction', (), None) + self.get_softpedal_attack_stretch_cmd = Command(b'_', b'\x17\x13', 'programtools', 'get_softpedal_attack_stretch', (), None) + self.get_softpedal_filter_close_cmd = Command(b'_', b'\x17\x14', 'programtools', 'get_softpedal_filter_close', (), None) + self.get_midi_transpose_cmd = Command(b'_', b'\x17\x15', 'programtools', 'get_midi_transpose', (), None) + self.get_mpc_pad_assignment_cmd = Command(b'_', b'\x17\x18', 'programtools', 'get_mpc_pad_assignment', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_modulation_connection_cmd = Command(b'_', b'\x17\x20', 'programtools', 'get_modulation_connection', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.get_modulation_source_type_cmd = Command(b'_', b'\x17\x21', 'programtools', 'get_modulation_source_type', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_modulation_destination_type_cmd = Command(b'_', b'\x17\x22', 'programtools', 'get_modulation_destination_type', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_modulation_level_cmd = Command(b'_', b'\x17\x23', 'programtools', 'get_modulation_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.get_midi_controller_number_cmd = Command(b'_', b'\x17\x24', 'programtools', 'get_midi_controller_number', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_edit_keygroup_cmd = Command(b'_', b'\x17\x25', 'programtools', 'get_edit_keygroup', (), None) + self.get_modulation_level_edit_keygroup_cmd = Command(b'_', b'\x17\x26', 'programtools', 'get_modulation_level_edit_keygroup', (), None) + self.get_tune_cmd = Command(b'_', b'\x17\x30', 'programtools', 'get_tune', (), None) + self.get_temperament_template_cmd = Command(b'_', b'\x17\x31', 'programtools', 'get_temperament_template', (), None) + self.get_program_temperament_cmd = Command(b'_', b'\x17\x32', 'programtools', 'get_program_temperament', (), None) + self.get_key_cmd = Command(b'_', b'\x17\x33', 'programtools', 'get_key', (), None) + self.get_user_temperament_note_cmd = Command(b'_', b'\x17\x34', 'programtools', 'get_user_temperament_note', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_pitchbend_up_cmd = Command(b'_', b'\x17\x40', 'programtools', 'get_pitchbend_up', (), None) + self.get_pitchbend_down_cmd = Command(b'_', b'\x17\x41', 'programtools', 'get_pitchbend_down', (), None) + self.get_pitchbend_mode_cmd = Command(b'_', b'\x17\x42', 'programtools', 'get_pitchbend_mode', (), None) + self.get_aftertouch_value_cmd = Command(b'_', b'\x17\x43', 'programtools', 'get_aftertouch_value', (), None) + self.get_legato_cmd = Command(b'_', b'\x17\x44', 'programtools', 'get_legato', (), None) + self.get_portamento_enabled_cmd = Command(b'_', b'\x17\x45', 'programtools', 'get_portamento_enabled', (), None) + self.get_portamento_mode_cmd = Command(b'_', b'\x17\x46', 'programtools', 'get_portamento_mode', (), None) + self.get_portamento_time_cmd = Command(b'_', b'\x17\x47', 'programtools', 'get_portamento_time', (), None) + self.get_glissando_mode_cmd = Command(b'_', b'\x17\x48', 'programtools', 'get_glissando_mode', (), None) + self.get_aftertouch_mode_cmd = Command(b'_', b'\x17\x49', 'programtools', 'get_aftertouch_mode', (), None) + self.set_group_id_cmd = Command(b'_', b'\x16\x01', 'programtools', 'set_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_type_cmd = Command(b'_', b'\x16\x03', 'programtools', 'set_type', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_genre_cmd = Command(b'_', b'\x16\x04', 'programtools', 'set_genre', (aksy.devices.akai.sysex_types.STRING,), None) + self.set_program_no_cmd = Command(b'_', b'\x16\x08', 'programtools', 'set_program_no', (aksy.devices.akai.sysex_types.WORD,), None) + self.set_no_keygroups_cmd = Command(b'_', b'\x16\x09', 'programtools', 'set_no_keygroups', (aksy.devices.akai.sysex_types.WORD,), None) + self.set_keygroup_xfade_cmd = Command(b'_', b'\x16\x0A', 'programtools', 'set_keygroup_xfade', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_keygroup_xfade_type_cmd = Command(b'_', b'\x16\x0B', 'programtools', 'set_keygroup_xfade_type', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_level_cmd = Command(b'_', b'\x16\x0C', 'programtools', 'set_level', (aksy.devices.akai.sysex_types.SWORD,), None) + self.set_polyphony_cmd = Command(b'_', b'\x16\x10', 'programtools', 'set_polyphony', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_reassignment_method_cmd = Command(b'_', b'\x16\x11', 'programtools', 'set_reassignment_method', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_softpedal_loudness_reduction_cmd = Command(b'_', b'\x16\x12', 'programtools', 'set_softpedal_loudness_reduction', (), None) + self.set_softpedal_attack_stretch_cmd = Command(b'_', b'\x16\x13', 'programtools', 'set_softpedal_attack_stretch', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_softpedal_filter_close_cmd = Command(b'_', b'\x16\x14', 'programtools', 'set_softpedal_filter_close', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_midi_transpose_cmd = Command(b'_', b'\x16\x15', 'programtools', 'set_midi_transpose', (aksy.devices.akai.sysex_types.SBYTE,), None) + self.set_mpc_pad_assignment_cmd = Command(b'_', b'\x16\x18', 'programtools', 'set_mpc_pad_assignment', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_modulation_connection_cmd = Command(b'_', b'\x16\x20', 'programtools', 'set_modulation_connection', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.SBYTE), None) + self.set_modulation_source_cmd = Command(b'_', b'\x16\x21', 'programtools', 'set_modulation_source', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.set_modulation_destination_cmd = Command(b'_', b'\x16\x22', 'programtools', 'set_modulation_destination', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.set_modulation_level_cmd = Command(b'_', b'\x16\x23', 'programtools', 'set_modulation_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD, aksy.devices.akai.sysex_types.SBYTE), None) + self.set_midi_ctrl_no_cmd = Command(b'_', b'\x16\x24', 'programtools', 'set_midi_ctrl_no', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_edit_keygroup_cmd = Command(b'_', b'\x16\x25', 'programtools', 'set_edit_keygroup', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.WORD), None) + self.set_edit_kegyroup_modulation_level_cmd = Command(b'_', b'\x16\x26', 'programtools', 'set_edit_kegyroup_modulation_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_tune_cmd = Command(b'_', b'\x16\x30', 'programtools', 'set_tune', (aksy.devices.akai.sysex_types.TUNE,), None) + self.set_temperament_template_cmd = Command(b'_', b'\x16\x31', 'programtools', 'set_temperament_template', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_program_temperament_cmd = Command(b'_', b'\x16\x32', 'programtools', 'set_program_temperament', (aksy.devices.akai.sysex_types.SBYTE,), None) + self.set_key_cmd = Command(b'_', b'\x16\x33', 'programtools', 'set_key', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_user_temperament_note_cmd = Command(b'_', b'\x16\x34', 'programtools', 'set_user_temperament_note', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) + self.set_pitchbend_up_cmd = Command(b'_', b'\x16\x40', 'programtools', 'set_pitchbend_up', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_pitchbend_down_cmd = Command(b'_', b'\x16\x41', 'programtools', 'set_pitchbend_down', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_pitchbend_mode_cmd = Command(b'_', b'\x16\x42', 'programtools', 'set_pitchbend_mode', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_aftertouch_value_cmd = Command(b'_', b'\x16\x43', 'programtools', 'set_aftertouch_value', (aksy.devices.akai.sysex_types.SBYTE,), None) + self.set_legato_cmd = Command(b'_', b'\x16\x44', 'programtools', 'set_legato', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_portamento_enabled_cmd = Command(b'_', b'\x16\x45', 'programtools', 'set_portamento_enabled', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_portamento_mode_cmd = Command(b'_', b'\x16\x46', 'programtools', 'set_portamento_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_portamento_time_cmd = Command(b'_', b'\x16\x47', 'programtools', 'set_portamento_time', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_glissando_mode_cmd = Command(b'_', b'\x16\x48', 'programtools', 'set_glissando_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_aftertouch_mode_cmd = Command(b'_', b'\x16\x49', 'programtools', 'set_aftertouch_mode', (aksy.devices.akai.sysex_types.BYTE,), None) def get_no_items(self): """Get number of items in memory diff --git a/src/aksy/devices/akai/z48/recordingtools.py b/src/aksy/devices/akai/z48/recordingtools.py index 96d684d..01f9796 100644 --- a/src/aksy/devices/akai/z48/recordingtools.py +++ b/src/aksy/devices/akai/z48/recordingtools.py @@ -14,45 +14,45 @@ class Recordingtools: def __init__(self, z48): self.sampler = z48 - self.get_status_cmd = Command('_', '\x30\x01', 'recordingtools', 'get_status', (), None) - self.get_progress_cmd = Command('_', '\x30\x02', 'recordingtools', 'get_progress', (), None) - self.get_max_rec_time_cmd = Command('_', '\x30\x03', 'recordingtools', 'get_max_rec_time', (), None) - self.arm_cmd = Command('_', '\x30\x10', 'recordingtools', 'arm', (), None) - self.start_cmd = Command('_', '\x30\x11', 'recordingtools', 'start', (), None) - self.stop_cmd = Command('_', '\x30\x12', 'recordingtools', 'stop', (), None) - self.cancel_cmd = Command('_', '\x30\x13', 'recordingtools', 'cancel', (), None) - self.start_playing_cmd = Command('_', '\x30\x20', 'recordingtools', 'start_playing', (), None) - self.stop_playing_cmd = Command('_', '\x30\x21', 'recordingtools', 'stop_playing', (), None) - self.keep_cmd = Command('_', '\x30\x22', 'recordingtools', 'keep', (), None) - self.delete_cmd = Command('_', '\x30\x23', 'recordingtools', 'delete', (), None) - self.set_input_cmd = Command('_', '\x32\x01', 'recordingtools', 'set_input', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_mode_cmd = Command('_', '\x32\x02', 'recordingtools', 'set_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.enable_monitor_cmd = Command('_', '\x32\x03', 'recordingtools', 'enable_monitor', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_rec_time_cmd = Command('_', '\x32\x04', 'recordingtools', 'set_rec_time', (aksy.devices.akai.sysex_types.DWORD,), None) - self.set_orig_pitch_cmd = Command('_', '\x32\x05', 'recordingtools', 'set_orig_pitch', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_threshold_cmd = Command('_', '\x32\x06', 'recordingtools', 'set_threshold', (aksy.devices.akai.sysex_types.SBYTE,), None) - self.set_trigger_src_cmd = Command('_', '\x32\x07', 'recordingtools', 'set_trigger_src', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_bit_depth_cmd = Command('_', '\x32\x08', 'recordingtools', 'set_bit_depth', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_prerec_time_cmd = Command('_', '\x32\x09', 'recordingtools', 'set_prerec_time', (aksy.devices.akai.sysex_types.WORD,), None) - self.set_dest_cmd = Command('_', '\x32\x0A', 'recordingtools', 'set_dest', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_name_cmd = Command('_', '\x32\x10', 'recordingtools', 'set_name', (aksy.devices.akai.sysex_types.STRING,), None) - self.set_name_seed_cmd = Command('_', '\x32\x11', 'recordingtools', 'set_name_seed', (aksy.devices.akai.sysex_types.STRING,), None) - self.set_autorec_mode_cmd = Command('_', '\x32\x12', 'recordingtools', 'set_autorec_mode', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_autonormalize_cmd = Command('_', '\x32\x13', 'recordingtools', 'set_autonormalize', (aksy.devices.akai.sysex_types.BOOL,), None) - self.get_input_cmd = Command('_', '\x33\x01', 'recordingtools', 'get_input', (), None) - self.get_mode_cmd = Command('_', '\x33\x02', 'recordingtools', 'get_mode', (), None) - self.get_monitor_cmd = Command('_', '\x33\x03', 'recordingtools', 'get_monitor', (), None) - self.get_rec_time_cmd = Command('_', '\x33\x04', 'recordingtools', 'get_rec_time', (), None) - self.get_pitch_cmd = Command('_', '\x33\x05', 'recordingtools', 'get_pitch', (), None) - self.get_threshold_cmd = Command('_', '\x33\x06', 'recordingtools', 'get_threshold', (), None) - self.get_trigger_src_cmd = Command('_', '\x33\x07', 'recordingtools', 'get_trigger_src', (), None) - self.get_bit_depth_cmd = Command('_', '\x33\x08', 'recordingtools', 'get_bit_depth', (), None) - self.get_prerec_time_cmd = Command('_', '\x33\x09', 'recordingtools', 'get_prerec_time', (), None) - self.get_dest_cmd = Command('_', '\x33\x0A', 'recordingtools', 'get_dest', (), None) - self.get_name_cmd = Command('_', '\x33\x10', 'recordingtools', 'get_name', (), None) - self.get_name_seed_cmd = Command('_', '\x33\x11', 'recordingtools', 'get_name_seed', (), None) - self.get_autorec_mode_cmd = Command('_', '\x33\x12', 'recordingtools', 'get_autorec_mode', (), None) - self.get_autonormalize_cmd = Command('_', '\x33\x13', 'recordingtools', 'get_autonormalize', (), None) + self.get_status_cmd = Command(b'_', b'\x30\x01', 'recordingtools', 'get_status', (), None) + self.get_progress_cmd = Command(b'_', b'\x30\x02', 'recordingtools', 'get_progress', (), None) + self.get_max_rec_time_cmd = Command(b'_', b'\x30\x03', 'recordingtools', 'get_max_rec_time', (), None) + self.arm_cmd = Command(b'_', b'\x30\x10', 'recordingtools', 'arm', (), None) + self.start_cmd = Command(b'_', b'\x30\x11', 'recordingtools', 'start', (), None) + self.stop_cmd = Command(b'_', b'\x30\x12', 'recordingtools', 'stop', (), None) + self.cancel_cmd = Command(b'_', b'\x30\x13', 'recordingtools', 'cancel', (), None) + self.start_playing_cmd = Command(b'_', b'\x30\x20', 'recordingtools', 'start_playing', (), None) + self.stop_playing_cmd = Command(b'_', b'\x30\x21', 'recordingtools', 'stop_playing', (), None) + self.keep_cmd = Command(b'_', b'\x30\x22', 'recordingtools', 'keep', (), None) + self.delete_cmd = Command(b'_', b'\x30\x23', 'recordingtools', 'delete', (), None) + self.set_input_cmd = Command(b'_', b'\x32\x01', 'recordingtools', 'set_input', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_mode_cmd = Command(b'_', b'\x32\x02', 'recordingtools', 'set_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.enable_monitor_cmd = Command(b'_', b'\x32\x03', 'recordingtools', 'enable_monitor', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_rec_time_cmd = Command(b'_', b'\x32\x04', 'recordingtools', 'set_rec_time', (aksy.devices.akai.sysex_types.DWORD,), None) + self.set_orig_pitch_cmd = Command(b'_', b'\x32\x05', 'recordingtools', 'set_orig_pitch', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_threshold_cmd = Command(b'_', b'\x32\x06', 'recordingtools', 'set_threshold', (aksy.devices.akai.sysex_types.SBYTE,), None) + self.set_trigger_src_cmd = Command(b'_', b'\x32\x07', 'recordingtools', 'set_trigger_src', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_bit_depth_cmd = Command(b'_', b'\x32\x08', 'recordingtools', 'set_bit_depth', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_prerec_time_cmd = Command(b'_', b'\x32\x09', 'recordingtools', 'set_prerec_time', (aksy.devices.akai.sysex_types.WORD,), None) + self.set_dest_cmd = Command(b'_', b'\x32\x0A', 'recordingtools', 'set_dest', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_name_cmd = Command(b'_', b'\x32\x10', 'recordingtools', 'set_name', (aksy.devices.akai.sysex_types.STRING,), None) + self.set_name_seed_cmd = Command(b'_', b'\x32\x11', 'recordingtools', 'set_name_seed', (aksy.devices.akai.sysex_types.STRING,), None) + self.set_autorec_mode_cmd = Command(b'_', b'\x32\x12', 'recordingtools', 'set_autorec_mode', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_autonormalize_cmd = Command(b'_', b'\x32\x13', 'recordingtools', 'set_autonormalize', (aksy.devices.akai.sysex_types.BOOL,), None) + self.get_input_cmd = Command(b'_', b'\x33\x01', 'recordingtools', 'get_input', (), None) + self.get_mode_cmd = Command(b'_', b'\x33\x02', 'recordingtools', 'get_mode', (), None) + self.get_monitor_cmd = Command(b'_', b'\x33\x03', 'recordingtools', 'get_monitor', (), None) + self.get_rec_time_cmd = Command(b'_', b'\x33\x04', 'recordingtools', 'get_rec_time', (), None) + self.get_pitch_cmd = Command(b'_', b'\x33\x05', 'recordingtools', 'get_pitch', (), None) + self.get_threshold_cmd = Command(b'_', b'\x33\x06', 'recordingtools', 'get_threshold', (), None) + self.get_trigger_src_cmd = Command(b'_', b'\x33\x07', 'recordingtools', 'get_trigger_src', (), None) + self.get_bit_depth_cmd = Command(b'_', b'\x33\x08', 'recordingtools', 'get_bit_depth', (), None) + self.get_prerec_time_cmd = Command(b'_', b'\x33\x09', 'recordingtools', 'get_prerec_time', (), None) + self.get_dest_cmd = Command(b'_', b'\x33\x0A', 'recordingtools', 'get_dest', (), None) + self.get_name_cmd = Command(b'_', b'\x33\x10', 'recordingtools', 'get_name', (), None) + self.get_name_seed_cmd = Command(b'_', b'\x33\x11', 'recordingtools', 'get_name_seed', (), None) + self.get_autorec_mode_cmd = Command(b'_', b'\x33\x12', 'recordingtools', 'get_autorec_mode', (), None) + self.get_autonormalize_cmd = Command(b'_', b'\x33\x13', 'recordingtools', 'get_autonormalize', (), None) def get_status(self): """Get Record Status diff --git a/src/aksy/devices/akai/z48/sampletools.py b/src/aksy/devices/akai/z48/sampletools.py index 891a222..8229ce5 100644 --- a/src/aksy/devices/akai/z48/sampletools.py +++ b/src/aksy/devices/akai/z48/sampletools.py @@ -14,81 +14,81 @@ class Sampletools: def __init__(self, z48): self.sampler = z48 - self.get_no_items_cmd = Command('_', '\x1C\x01', 'sampletools', 'get_no_items', (), None) - self.get_handles_cmd = Command('_', '\x1C\x02\x00', 'sampletools', 'get_handles', (), None) - self.get_names_cmd = Command('_', '\x1C\x02\x01', 'sampletools', 'get_names', (), None) - self.get_handles_names_cmd = Command('_', '\x1C\x02\x02', 'sampletools', 'get_handles_names', (), None) - self.get_handles_modified_cmd = Command('_', '\x1C\x02\x03', 'sampletools', 'get_handles_modified', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_curr_by_handle_cmd = Command('_', '\x1C\x03', 'sampletools', 'set_curr_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.set_curr_by_name_cmd = Command('_', '\x1C\x04', 'sampletools', 'set_curr_by_name', (aksy.devices.akai.sysex_types.STRING,), None) - self.get_curr_handle_cmd = Command('_', '\x1C\x05', 'sampletools', 'get_curr_handle', (), None) - self.get_curr_name_cmd = Command('_', '\x1C\x06', 'sampletools', 'get_curr_name', (), None) - self.get_name_by_handle_cmd = Command('_', '\x1C\x07', 'sampletools', 'get_name_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.get_handle_by_name_cmd = Command('_', '\x1C\x08', 'sampletools', 'get_handle_by_name', (aksy.devices.akai.sysex_types.STRING,), None) - self.delete_all_cmd = Command('_', '\x1C\x09', 'sampletools', 'delete_all', (), None) - self.delete_curr_cmd = Command('_', '\x1C\x0A', 'sampletools', 'delete_curr', (), None) - self.delete_by_handle_cmd = Command('_', '\x1C\x0B', 'sampletools', 'delete_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.rename_curr_cmd = Command('_', '\x1C\x0C', 'sampletools', 'rename_curr', (aksy.devices.akai.sysex_types.STRING,), None) - self.rename_by_handle_cmd = Command('_', '\x1C\x0D', 'sampletools', 'rename_by_handle', (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.STRING), None) - self.set_tag_bit_cmd = Command('_', '\x1C\x0E', 'sampletools', 'set_tag_bit', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_tag_bitmap_cmd = Command('_', '\x1C\x0F', 'sampletools', 'get_tag_bitmap', (), None) - self.get_curr_modified_cmd = Command('_', '\x1C\x10', 'sampletools', 'get_curr_modified', (), None) - self.get_modified_cmd = Command('_', '\x1C\x11', 'sampletools', 'get_modified', (), None) - self.delete_tagged_cmd = Command('_', '\x1C\x18', 'sampletools', 'delete_tagged', (aksy.devices.akai.sysex_types.BYTE,), None) - self.play_cmd = Command('_', '\x1C\x40', 'sampletools', 'play', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) - self.stop_cmd = Command('_', '\x1C\x41', 'sampletools', 'stop', (), None) - self.play_until_cmd = Command('_', '\x1C\x42', 'sampletools', 'play_until', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) - self.play_from_cmd = Command('_', '\x1C\x43', 'sampletools', 'play_from', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) - self.play_over_cmd = Command('_', '\x1C\x44', 'sampletools', 'play_over', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) - self.play_loop_cmd = Command('_', '\x1C\x45', 'sampletools', 'play_loop', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.play_region_cmd = Command('_', '\x1C\x46', 'sampletools', 'play_region', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.create_loop_cmd = Command('_', '\x1C\x48', 'sampletools', 'create_loop', (), None) - self.delete_loop_cmd = Command('_', '\x1C\x49', 'sampletools', 'delete_loop', (aksy.devices.akai.sysex_types.BYTE,), None) - self.create_region_cmd = Command('_', '\x1C\x4A', 'sampletools', 'create_region', (), None) - self.delete_region_cmd = Command('_', '\x1C\x4B', 'sampletools', 'delete_region', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_group_id_cmd = Command('_', '\x1F\x01', 'sampletools', 'get_group_id', (), None) - self.get_trim_start_cmd = Command('_', '\x1F\x20', 'sampletools', 'get_trim_start', (), None) - self.get_trim_end_cmd = Command('_', '\x1F\x21', 'sampletools', 'get_trim_end', (), None) - self.get_trim_length_cmd = Command('_', '\x1F\x22', 'sampletools', 'get_trim_length', (), None) - self.get_orig_pitch_cmd = Command('_', '\x1F\x24', 'sampletools', 'get_orig_pitch', (), None) - self.get_cents_tune_cmd = Command('_', '\x1F\x25', 'sampletools', 'get_cents_tune', (), None) - self.get_playback_mode_cmd = Command('_', '\x1F\x26', 'sampletools', 'get_playback_mode', (), None) - self.get_loop_start_cmd = Command('_', '\x1F\x30', 'sampletools', 'get_loop_start', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_loop_end_cmd = Command('_', '\x1F\x31', 'sampletools', 'get_loop_end', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_loop_length_cmd = Command('_', '\x1F\x32', 'sampletools', 'get_loop_length', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_loop_lock_cmd = Command('_', '\x1F\x33', 'sampletools', 'get_loop_lock', (aksy.devices.akai.sysex_types.BOOL,), None) - self.get_loop_tune_cmd = Command('_', '\x1F\x34', 'sampletools', 'get_loop_tune', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_loop_dir_cmd = Command('_', '\x1F\x35', 'sampletools', 'get_loop_dir', (aksy.devices.akai.sysex_types.BOOL,), None) - self.get_loop_type_cmd = Command('_', '\x1F\x36', 'sampletools', 'get_loop_type', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_no_loop_reps_cmd = Command('_', '\x1F\x37', 'sampletools', 'get_no_loop_reps', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_no_loops_cmd = Command('_', '\x1F\x38', 'sampletools', 'get_no_loops', (), None) - self.get_region_start_cmd = Command('_', '\x1F\x40', 'sampletools', 'get_region_start', (), None) - self.get_region_end_cmd = Command('_', '\x1F\x41', 'sampletools', 'get_region_end', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_region_length_cmd = Command('_', '\x1F\x42', 'sampletools', 'get_region_length', (), None) - self.get_no_regions_cmd = Command('_', '\x1F\x44', 'sampletools', 'get_no_regions', (), None) - self.get_sample_length_cmd = Command('_', '\x1F\x50', 'sampletools', 'get_sample_length', (), None) - self.get_sample_rate_cmd = Command('_', '\x1F\x51', 'sampletools', 'get_sample_rate', (), None) - self.get_bit_depth_cmd = Command('_', '\x1F\x52', 'sampletools', 'get_bit_depth', (), None) - self.get_sample_type_cmd = Command('_', '\x1F\x54', 'sampletools', 'get_sample_type', (), None) - self.get_no_channels_cmd = Command('_', '\x1F\x55', 'sampletools', 'get_no_channels', (), None) - self.set_group_id_cmd = Command('_', '\x1E\x01', 'sampletools', 'set_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_trim_start_cmd = Command('_', '\x1E\x20', 'sampletools', 'set_trim_start', (aksy.devices.akai.sysex_types.QWORD,), None) - self.set_trim_end_cmd = Command('_', '\x1E\x21', 'sampletools', 'set_trim_end', (aksy.devices.akai.sysex_types.QWORD,), None) - self.set_trim_length_cmd = Command('_', '\x1E\x22', 'sampletools', 'set_trim_length', (aksy.devices.akai.sysex_types.QWORD,), None) - self.set_orig_pitch_cmd = Command('_', '\x1E\x24', 'sampletools', 'set_orig_pitch', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_tune_cmd = Command('_', '\x1E\x25', 'sampletools', 'set_tune', (aksy.devices.akai.sysex_types.SWORD,), None) - self.set_playback_mode_cmd = Command('_', '\x1E\x26', 'sampletools', 'set_playback_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_loop_start_cmd = Command('_', '\x1E\x30', 'sampletools', 'set_loop_start', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) - self.set_loop_end_cmd = Command('_', '\x1E\x31', 'sampletools', 'set_loop_end', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) - self.set_loop_length_cmd = Command('_', '\x1E\x32', 'sampletools', 'set_loop_length', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) - self.set_loop_lock_cmd = Command('_', '\x1E\x33', 'sampletools', 'set_loop_lock', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) - self.set_loop_tune_cmd = Command('_', '\x1E\x34', 'sampletools', 'set_loop_tune', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) - self.set_loop_direction_cmd = Command('_', '\x1E\x35', 'sampletools', 'set_loop_direction', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_loop_type_cmd = Command('_', '\x1E\x36', 'sampletools', 'set_loop_type', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_no_loop_reps_cmd = Command('_', '\x1E\x37', 'sampletools', 'set_no_loop_reps', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_region_start_cmd = Command('_', '\x1E\x40', 'sampletools', 'set_region_start', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) - self.set_region_end_cmd = Command('_', '\x1E\x41', 'sampletools', 'set_region_end', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) - self.set_region_length_cmd = Command('_', '\x1E\x42', 'sampletools', 'set_region_length', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) + self.get_no_items_cmd = Command(b'_', b'\x1C\x01', 'sampletools', 'get_no_items', (), None) + self.get_handles_cmd = Command(b'_', b'\x1C\x02\x00', 'sampletools', 'get_handles', (), None) + self.get_names_cmd = Command(b'_', b'\x1C\x02\x01', 'sampletools', 'get_names', (), None) + self.get_handles_names_cmd = Command(b'_', b'\x1C\x02\x02', 'sampletools', 'get_handles_names', (), None) + self.get_handles_modified_cmd = Command(b'_', b'\x1C\x02\x03', 'sampletools', 'get_handles_modified', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_curr_by_handle_cmd = Command(b'_', b'\x1C\x03', 'sampletools', 'set_curr_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.set_curr_by_name_cmd = Command(b'_', b'\x1C\x04', 'sampletools', 'set_curr_by_name', (aksy.devices.akai.sysex_types.STRING,), None) + self.get_curr_handle_cmd = Command(b'_', b'\x1C\x05', 'sampletools', 'get_curr_handle', (), None) + self.get_curr_name_cmd = Command(b'_', b'\x1C\x06', 'sampletools', 'get_curr_name', (), None) + self.get_name_by_handle_cmd = Command(b'_', b'\x1C\x07', 'sampletools', 'get_name_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.get_handle_by_name_cmd = Command(b'_', b'\x1C\x08', 'sampletools', 'get_handle_by_name', (aksy.devices.akai.sysex_types.STRING,), None) + self.delete_all_cmd = Command(b'_', b'\x1C\x09', 'sampletools', 'delete_all', (), None) + self.delete_curr_cmd = Command(b'_', b'\x1C\x0A', 'sampletools', 'delete_curr', (), None) + self.delete_by_handle_cmd = Command(b'_', b'\x1C\x0B', 'sampletools', 'delete_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.rename_curr_cmd = Command(b'_', b'\x1C\x0C', 'sampletools', 'rename_curr', (aksy.devices.akai.sysex_types.STRING,), None) + self.rename_by_handle_cmd = Command(b'_', b'\x1C\x0D', 'sampletools', 'rename_by_handle', (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.STRING), None) + self.set_tag_bit_cmd = Command(b'_', b'\x1C\x0E', 'sampletools', 'set_tag_bit', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_tag_bitmap_cmd = Command(b'_', b'\x1C\x0F', 'sampletools', 'get_tag_bitmap', (), None) + self.get_curr_modified_cmd = Command(b'_', b'\x1C\x10', 'sampletools', 'get_curr_modified', (), None) + self.get_modified_cmd = Command(b'_', b'\x1C\x11', 'sampletools', 'get_modified', (), None) + self.delete_tagged_cmd = Command(b'_', b'\x1C\x18', 'sampletools', 'delete_tagged', (aksy.devices.akai.sysex_types.BYTE,), None) + self.play_cmd = Command(b'_', b'\x1C\x40', 'sampletools', 'play', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) + self.stop_cmd = Command(b'_', b'\x1C\x41', 'sampletools', 'stop', (), None) + self.play_until_cmd = Command(b'_', b'\x1C\x42', 'sampletools', 'play_until', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) + self.play_from_cmd = Command(b'_', b'\x1C\x43', 'sampletools', 'play_from', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) + self.play_over_cmd = Command(b'_', b'\x1C\x44', 'sampletools', 'play_over', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) + self.play_loop_cmd = Command(b'_', b'\x1C\x45', 'sampletools', 'play_loop', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.play_region_cmd = Command(b'_', b'\x1C\x46', 'sampletools', 'play_region', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.create_loop_cmd = Command(b'_', b'\x1C\x48', 'sampletools', 'create_loop', (), None) + self.delete_loop_cmd = Command(b'_', b'\x1C\x49', 'sampletools', 'delete_loop', (aksy.devices.akai.sysex_types.BYTE,), None) + self.create_region_cmd = Command(b'_', b'\x1C\x4A', 'sampletools', 'create_region', (), None) + self.delete_region_cmd = Command(b'_', b'\x1C\x4B', 'sampletools', 'delete_region', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_group_id_cmd = Command(b'_', b'\x1F\x01', 'sampletools', 'get_group_id', (), None) + self.get_trim_start_cmd = Command(b'_', b'\x1F\x20', 'sampletools', 'get_trim_start', (), None) + self.get_trim_end_cmd = Command(b'_', b'\x1F\x21', 'sampletools', 'get_trim_end', (), None) + self.get_trim_length_cmd = Command(b'_', b'\x1F\x22', 'sampletools', 'get_trim_length', (), None) + self.get_orig_pitch_cmd = Command(b'_', b'\x1F\x24', 'sampletools', 'get_orig_pitch', (), None) + self.get_cents_tune_cmd = Command(b'_', b'\x1F\x25', 'sampletools', 'get_cents_tune', (), None) + self.get_playback_mode_cmd = Command(b'_', b'\x1F\x26', 'sampletools', 'get_playback_mode', (), None) + self.get_loop_start_cmd = Command(b'_', b'\x1F\x30', 'sampletools', 'get_loop_start', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_loop_end_cmd = Command(b'_', b'\x1F\x31', 'sampletools', 'get_loop_end', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_loop_length_cmd = Command(b'_', b'\x1F\x32', 'sampletools', 'get_loop_length', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_loop_lock_cmd = Command(b'_', b'\x1F\x33', 'sampletools', 'get_loop_lock', (aksy.devices.akai.sysex_types.BOOL,), None) + self.get_loop_tune_cmd = Command(b'_', b'\x1F\x34', 'sampletools', 'get_loop_tune', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_loop_dir_cmd = Command(b'_', b'\x1F\x35', 'sampletools', 'get_loop_dir', (aksy.devices.akai.sysex_types.BOOL,), None) + self.get_loop_type_cmd = Command(b'_', b'\x1F\x36', 'sampletools', 'get_loop_type', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_no_loop_reps_cmd = Command(b'_', b'\x1F\x37', 'sampletools', 'get_no_loop_reps', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_no_loops_cmd = Command(b'_', b'\x1F\x38', 'sampletools', 'get_no_loops', (), None) + self.get_region_start_cmd = Command(b'_', b'\x1F\x40', 'sampletools', 'get_region_start', (), None) + self.get_region_end_cmd = Command(b'_', b'\x1F\x41', 'sampletools', 'get_region_end', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_region_length_cmd = Command(b'_', b'\x1F\x42', 'sampletools', 'get_region_length', (), None) + self.get_no_regions_cmd = Command(b'_', b'\x1F\x44', 'sampletools', 'get_no_regions', (), None) + self.get_sample_length_cmd = Command(b'_', b'\x1F\x50', 'sampletools', 'get_sample_length', (), None) + self.get_sample_rate_cmd = Command(b'_', b'\x1F\x51', 'sampletools', 'get_sample_rate', (), None) + self.get_bit_depth_cmd = Command(b'_', b'\x1F\x52', 'sampletools', 'get_bit_depth', (), None) + self.get_sample_type_cmd = Command(b'_', b'\x1F\x54', 'sampletools', 'get_sample_type', (), None) + self.get_no_channels_cmd = Command(b'_', b'\x1F\x55', 'sampletools', 'get_no_channels', (), None) + self.set_group_id_cmd = Command(b'_', b'\x1E\x01', 'sampletools', 'set_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_trim_start_cmd = Command(b'_', b'\x1E\x20', 'sampletools', 'set_trim_start', (aksy.devices.akai.sysex_types.QWORD,), None) + self.set_trim_end_cmd = Command(b'_', b'\x1E\x21', 'sampletools', 'set_trim_end', (aksy.devices.akai.sysex_types.QWORD,), None) + self.set_trim_length_cmd = Command(b'_', b'\x1E\x22', 'sampletools', 'set_trim_length', (aksy.devices.akai.sysex_types.QWORD,), None) + self.set_orig_pitch_cmd = Command(b'_', b'\x1E\x24', 'sampletools', 'set_orig_pitch', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_tune_cmd = Command(b'_', b'\x1E\x25', 'sampletools', 'set_tune', (aksy.devices.akai.sysex_types.SWORD,), None) + self.set_playback_mode_cmd = Command(b'_', b'\x1E\x26', 'sampletools', 'set_playback_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_loop_start_cmd = Command(b'_', b'\x1E\x30', 'sampletools', 'set_loop_start', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) + self.set_loop_end_cmd = Command(b'_', b'\x1E\x31', 'sampletools', 'set_loop_end', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) + self.set_loop_length_cmd = Command(b'_', b'\x1E\x32', 'sampletools', 'set_loop_length', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) + self.set_loop_lock_cmd = Command(b'_', b'\x1E\x33', 'sampletools', 'set_loop_lock', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) + self.set_loop_tune_cmd = Command(b'_', b'\x1E\x34', 'sampletools', 'set_loop_tune', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) + self.set_loop_direction_cmd = Command(b'_', b'\x1E\x35', 'sampletools', 'set_loop_direction', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_loop_type_cmd = Command(b'_', b'\x1E\x36', 'sampletools', 'set_loop_type', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_no_loop_reps_cmd = Command(b'_', b'\x1E\x37', 'sampletools', 'set_no_loop_reps', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_region_start_cmd = Command(b'_', b'\x1E\x40', 'sampletools', 'set_region_start', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) + self.set_region_end_cmd = Command(b'_', b'\x1E\x41', 'sampletools', 'set_region_end', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) + self.set_region_length_cmd = Command(b'_', b'\x1E\x42', 'sampletools', 'set_region_length', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.QWORD), None) def get_no_items(self): """Get number of items in memory diff --git a/src/aksy/devices/akai/z48/songtools.py b/src/aksy/devices/akai/z48/songtools.py index 50f5b5b..b68a141 100644 --- a/src/aksy/devices/akai/z48/songtools.py +++ b/src/aksy/devices/akai/z48/songtools.py @@ -14,47 +14,47 @@ class Songtools: def __init__(self, z48): self.sampler = z48 - self.get_no_items_cmd = Command('_', '\x28\x01', 'songtools', 'get_no_items', (), None) - self.get_handles_cmd = Command('_', '\x28\x02\x00', 'songtools', 'get_handles', (), None) - self.get_names_cmd = Command('_', '\x28\x02\x01', 'songtools', 'get_names', (), None) - self.get_handles_names_cmd = Command('_', '\x28\x02\x02', 'songtools', 'get_handles_names', (), None) - self.get_handles_modified_cmd = Command('_', '\x28\x02\x03', 'songtools', 'get_handles_modified', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_curr_by_handle_cmd = Command('_', '\x28\x03', 'songtools', 'set_curr_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.set_curr_by_name_cmd = Command('_', '\x28\x04', 'songtools', 'set_curr_by_name', (aksy.devices.akai.sysex_types.STRING,), None) - self.get_curr_handle_cmd = Command('_', '\x28\x05', 'songtools', 'get_curr_handle', (), None) - self.get_curr_name_cmd = Command('_', '\x28\x06', 'songtools', 'get_curr_name', (), None) - self.get_name_by_handle_cmd = Command('_', '\x28\x07', 'songtools', 'get_name_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.get_handle_by_name_cmd = Command('_', '\x28\x08', 'songtools', 'get_handle_by_name', (aksy.devices.akai.sysex_types.STRING,), None) - self.delete_all_cmd = Command('_', '\x28\x09', 'songtools', 'delete_all', (), None) - self.delete_curr_cmd = Command('_', '\x28\x0A', 'songtools', 'delete_curr', (), None) - self.delete_by_handle_cmd = Command('_', '\x28\x0B', 'songtools', 'delete_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) - self.rename_curr_cmd = Command('_', '\x28\x0C', 'songtools', 'rename_curr', (aksy.devices.akai.sysex_types.STRING,), None) - self.rename_by_handle_cmd = Command('_', '\x28\x0D', 'songtools', 'rename_by_handle', (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.STRING), None) - self.set_tag_bit_cmd = Command('_', '\x28\x0E', 'songtools', 'set_tag_bit', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.get_tag_bitmap_cmd = Command('_', '\x28\x0F', 'songtools', 'get_tag_bitmap', (), None) - self.get_curr_modified_cmd = Command('_', '\x28\x10', 'songtools', 'get_curr_modified', (), None) - self.get_modified_cmd = Command('_', '\x28\x11', 'songtools', 'get_modified', (), None) - self.delete_tagged_cmd = Command('_', '\x28\x18', 'songtools', 'delete_tagged', (aksy.devices.akai.sysex_types.BYTE,), None) - self.play_song_cmd = Command('_', '\x28\x40', 'songtools', 'play_song', (), None) - self.pause_song_cmd = Command('_', '\x28\x41', 'songtools', 'pause_song', (), None) - self.stop_song_cmd = Command('_', '\x28\x42', 'songtools', 'stop_song', (), None) - self.set_group_id_cmd = Command('_', '\x28\x01', 'songtools', 'set_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_from_bar_cmd = Command('_', '\x28\x10', 'songtools', 'set_from_bar', (aksy.devices.akai.sysex_types.WORD,), None) - self.set_to_bar_cmd = Command('_', '\x28\x10', 'songtools', 'set_to_bar', (aksy.devices.akai.sysex_types.WORD,), None) - self.set_tempo_mode_cmd = Command('_', '\x28\x12', 'songtools', 'set_tempo_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_manual_tempo_cmd = Command('_', '\x28\x13', 'songtools', 'set_manual_tempo', (aksy.devices.akai.sysex_types.WORD,), None) - self.set_midi_output_cmd = Command('_', '\x28\x18', 'songtools', 'set_midi_output', (aksy.devices.akai.sysex_types.BOOL,), None) - self.get_group_id_cmd = Command('_', '\x28\x01', 'songtools', 'get_group_id', (), None) - self.get_from_bar_cmd = Command('_', '\x28\x10', 'songtools', 'get_from_bar', (), None) - self.get_to_bar_cmd = Command('_', '\x28\x11', 'songtools', 'get_to_bar', (), None) - self.get_tempo_mode_cmd = Command('_', '\x28\x12', 'songtools', 'get_tempo_mode', (), None) - self.get_manual_tempo_cmd = Command('_', '\x28\x13', 'songtools', 'get_manual_tempo', (), None) - self.get_midi_output_port_cmd = Command('_', '\x28\x18', 'songtools', 'get_midi_output_port', (), None) - self.get_time_signature_beat_cmd = Command('_', '\x28\x20', 'songtools', 'get_time_signature_beat', (), None) - self.get_time_sig_beat_no_cmd = Command('_', '\x28\x21', 'songtools', 'get_time_sig_beat_no', (), None) - self.get_curr_beat_cmd = Command('_', '\x28\x22', 'songtools', 'get_curr_beat', (), None) - self.get_curr_bar_cmd = Command('_', '\x28\x23', 'songtools', 'get_curr_bar', (), None) - self.get_curr_tempo_cmd = Command('_', '\x28\x24', 'songtools', 'get_curr_tempo', (), None) + self.get_no_items_cmd = Command(b'_', b'\x28\x01', 'songtools', 'get_no_items', (), None) + self.get_handles_cmd = Command(b'_', b'\x28\x02\x00', 'songtools', 'get_handles', (), None) + self.get_names_cmd = Command(b'_', b'\x28\x02\x01', 'songtools', 'get_names', (), None) + self.get_handles_names_cmd = Command(b'_', b'\x28\x02\x02', 'songtools', 'get_handles_names', (), None) + self.get_handles_modified_cmd = Command(b'_', b'\x28\x02\x03', 'songtools', 'get_handles_modified', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_curr_by_handle_cmd = Command(b'_', b'\x28\x03', 'songtools', 'set_curr_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.set_curr_by_name_cmd = Command(b'_', b'\x28\x04', 'songtools', 'set_curr_by_name', (aksy.devices.akai.sysex_types.STRING,), None) + self.get_curr_handle_cmd = Command(b'_', b'\x28\x05', 'songtools', 'get_curr_handle', (), None) + self.get_curr_name_cmd = Command(b'_', b'\x28\x06', 'songtools', 'get_curr_name', (), None) + self.get_name_by_handle_cmd = Command(b'_', b'\x28\x07', 'songtools', 'get_name_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.get_handle_by_name_cmd = Command(b'_', b'\x28\x08', 'songtools', 'get_handle_by_name', (aksy.devices.akai.sysex_types.STRING,), None) + self.delete_all_cmd = Command(b'_', b'\x28\x09', 'songtools', 'delete_all', (), None) + self.delete_curr_cmd = Command(b'_', b'\x28\x0A', 'songtools', 'delete_curr', (), None) + self.delete_by_handle_cmd = Command(b'_', b'\x28\x0B', 'songtools', 'delete_by_handle', (aksy.devices.akai.sysex_types.DWORD,), None) + self.rename_curr_cmd = Command(b'_', b'\x28\x0C', 'songtools', 'rename_curr', (aksy.devices.akai.sysex_types.STRING,), None) + self.rename_by_handle_cmd = Command(b'_', b'\x28\x0D', 'songtools', 'rename_by_handle', (aksy.devices.akai.sysex_types.DWORD, aksy.devices.akai.sysex_types.STRING), None) + self.set_tag_bit_cmd = Command(b'_', b'\x28\x0E', 'songtools', 'set_tag_bit', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_tag_bitmap_cmd = Command(b'_', b'\x28\x0F', 'songtools', 'get_tag_bitmap', (), None) + self.get_curr_modified_cmd = Command(b'_', b'\x28\x10', 'songtools', 'get_curr_modified', (), None) + self.get_modified_cmd = Command(b'_', b'\x28\x11', 'songtools', 'get_modified', (), None) + self.delete_tagged_cmd = Command(b'_', b'\x28\x18', 'songtools', 'delete_tagged', (aksy.devices.akai.sysex_types.BYTE,), None) + self.play_song_cmd = Command(b'_', b'\x28\x40', 'songtools', 'play_song', (), None) + self.pause_song_cmd = Command(b'_', b'\x28\x41', 'songtools', 'pause_song', (), None) + self.stop_song_cmd = Command(b'_', b'\x28\x42', 'songtools', 'stop_song', (), None) + self.set_group_id_cmd = Command(b'_', b'\x28\x01', 'songtools', 'set_group_id', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_from_bar_cmd = Command(b'_', b'\x28\x10', 'songtools', 'set_from_bar', (aksy.devices.akai.sysex_types.WORD,), None) + self.set_to_bar_cmd = Command(b'_', b'\x28\x10', 'songtools', 'set_to_bar', (aksy.devices.akai.sysex_types.WORD,), None) + self.set_tempo_mode_cmd = Command(b'_', b'\x28\x12', 'songtools', 'set_tempo_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_manual_tempo_cmd = Command(b'_', b'\x28\x13', 'songtools', 'set_manual_tempo', (aksy.devices.akai.sysex_types.WORD,), None) + self.set_midi_output_cmd = Command(b'_', b'\x28\x18', 'songtools', 'set_midi_output', (aksy.devices.akai.sysex_types.BOOL,), None) + self.get_group_id_cmd = Command(b'_', b'\x28\x01', 'songtools', 'get_group_id', (), None) + self.get_from_bar_cmd = Command(b'_', b'\x28\x10', 'songtools', 'get_from_bar', (), None) + self.get_to_bar_cmd = Command(b'_', b'\x28\x11', 'songtools', 'get_to_bar', (), None) + self.get_tempo_mode_cmd = Command(b'_', b'\x28\x12', 'songtools', 'get_tempo_mode', (), None) + self.get_manual_tempo_cmd = Command(b'_', b'\x28\x13', 'songtools', 'get_manual_tempo', (), None) + self.get_midi_output_port_cmd = Command(b'_', b'\x28\x18', 'songtools', 'get_midi_output_port', (), None) + self.get_time_signature_beat_cmd = Command(b'_', b'\x28\x20', 'songtools', 'get_time_signature_beat', (), None) + self.get_time_sig_beat_no_cmd = Command(b'_', b'\x28\x21', 'songtools', 'get_time_sig_beat_no', (), None) + self.get_curr_beat_cmd = Command(b'_', b'\x28\x22', 'songtools', 'get_curr_beat', (), None) + self.get_curr_bar_cmd = Command(b'_', b'\x28\x23', 'songtools', 'get_curr_bar', (), None) + self.get_curr_tempo_cmd = Command(b'_', b'\x28\x24', 'songtools', 'get_curr_tempo', (), None) def get_no_items(self): """Get number of items in memory diff --git a/src/aksy/devices/akai/z48/sysextools.py b/src/aksy/devices/akai/z48/sysextools.py index 25ba517..1f32657 100644 --- a/src/aksy/devices/akai/z48/sysextools.py +++ b/src/aksy/devices/akai/z48/sysextools.py @@ -14,15 +14,15 @@ class Sysextools: def __init__(self, z48): self.sampler = z48 - self.query_cmd = Command('_', '\x00\x00', 'sysextools', 'query', (), None) - self.enable_msg_notification_cmd = Command('_', '\x00\x01', 'sysextools', 'enable_msg_notification', (aksy.devices.akai.sysex_types.BOOL,), None) - self.enable_item_sync_cmd = Command('_', '\x00\x03', 'sysextools', 'enable_item_sync', (aksy.devices.akai.sysex_types.BOOL,), None) - self.enable_checksum_verification_cmd = Command('_', '\x00\x04', 'sysextools', 'enable_checksum_verification', (aksy.devices.akai.sysex_types.BOOL,), None) - self.enable_screen_updates_cmd = Command('_', '\x00\x05', 'sysextools', 'enable_screen_updates', (aksy.devices.akai.sysex_types.BOOL,), None) - self.echo_cmd = Command('_', '\x00\x06', 'sysextools', 'echo', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.enable_heartbeat_cmd = Command('_', '\x00\x07', 'sysextools', 'enable_heartbeat', (), None) - self.enable_playback_sync_cmd = Command('_', '\x00\x08', 'sysextools', 'enable_playback_sync', (aksy.devices.akai.sysex_types.BOOL,), None) - self.get_sysex_buffersize_cmd = Command('_', '\x00\x10', 'sysextools', 'get_sysex_buffersize', (), None) + self.query_cmd = Command(b'_', b'\x00\x00', 'sysextools', 'query', (), None) + self.enable_msg_notification_cmd = Command(b'_', b'\x00\x01', 'sysextools', 'enable_msg_notification', (aksy.devices.akai.sysex_types.BOOL,), None) + self.enable_item_sync_cmd = Command(b'_', b'\x00\x03', 'sysextools', 'enable_item_sync', (aksy.devices.akai.sysex_types.BOOL,), None) + self.enable_checksum_verification_cmd = Command(b'_', b'\x00\x04', 'sysextools', 'enable_checksum_verification', (aksy.devices.akai.sysex_types.BOOL,), None) + self.enable_screen_updates_cmd = Command(b'_', b'\x00\x05', 'sysextools', 'enable_screen_updates', (aksy.devices.akai.sysex_types.BOOL,), None) + self.echo_cmd = Command(b'_', b'\x00\x06', 'sysextools', 'echo', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.enable_heartbeat_cmd = Command(b'_', b'\x00\x07', 'sysextools', 'enable_heartbeat', (), None) + self.enable_playback_sync_cmd = Command(b'_', b'\x00\x08', 'sysextools', 'enable_playback_sync', (aksy.devices.akai.sysex_types.BOOL,), None) + self.get_sysex_buffersize_cmd = Command(b'_', b'\x00\x10', 'sysextools', 'get_sysex_buffersize', (), None) def query(self): """Query device, returns device ID diff --git a/src/aksy/devices/akai/z48/systemtools.py b/src/aksy/devices/akai/z48/systemtools.py index f3b2dd3..d6ecc06 100644 --- a/src/aksy/devices/akai/z48/systemtools.py +++ b/src/aksy/devices/akai/z48/systemtools.py @@ -14,110 +14,110 @@ class Systemtools: def __init__(self, z48): self.sampler = z48 - self.get_os_software_version_cmd = Command('_', '\x04\x00', 'systemtools', 'get_os_software_version', (), None) - self.get_os_subversion_cmd = Command('_', '\x04\x01', 'systemtools', 'get_os_subversion', (), None) - self.get_sampler_model_cmd = Command('_', '\x04\x04', 'systemtools', 'get_sampler_model', (), None) - self.get_supported_filetypes_cmd = Command('_', '\x04\x08', 'systemtools', 'get_supported_filetypes', (), None) - self.get_perc_free_wave_mem_cmd = Command('_', '\x04\x10', 'systemtools', 'get_perc_free_wave_mem', (), None) - self.get_perc_free_cpu_mem_cmd = Command('_', '\x04\x11', 'systemtools', 'get_perc_free_cpu_mem', (), None) - self.get_wave_mem_size_cmd = Command('_', '\x04\x12', 'systemtools', 'get_wave_mem_size', (), None) - self.get_free_wave_mem_size_cmd = Command('_', '\x04\x13', 'systemtools', 'get_free_wave_mem_size', (), None) - self.clear_sampler_mem_cmd = Command('_', '\x04\x18', 'systemtools', 'clear_sampler_mem', (), None) - self.purge_unused_cmd = Command('_', '\x04\x19', 'systemtools', 'purge_unused', (aksy.devices.akai.sysex_types.BYTE,), None) - self.tag_unused_cmd = Command('_', '\x04\x1A', 'systemtools', 'tag_unused', (aksy.devices.akai.sysex_types.BYTE,), None) - self.compact_wave_mem_cmd = Command('_', '\x04\x20', 'systemtools', 'compact_wave_mem', (), None) - self.cancel_compact_wave_mem_cmd = Command('_', '\x04\x21', 'systemtools', 'cancel_compact_wave_mem', (), None) - self.get_compact_wave_mem_progress_cmd = Command('_', '\x04\x22', 'systemtools', 'get_compact_wave_mem_progress', (), None) - self.get_async_operation_state_cmd = Command('_', '\x04\x30', 'systemtools', 'get_async_operation_state', (), None) - self.cancel_curr_async_operation_cmd = Command('_', '\x04\x31', 'systemtools', 'cancel_curr_async_operation', (), None) - self.get_sampler_name_cmd = Command('_', '\x07\x01', 'systemtools', 'get_sampler_name', (), None) - self.get_scsi_id_cmd = Command('_', '\x07\x02', 'systemtools', 'get_scsi_id', (), None) - self.get_master_tune_cmd = Command('_', '\x07\x03', 'systemtools', 'get_master_tune', (), None) - self.get_master_level_cmd = Command('_', '\x07\x04', 'systemtools', 'get_master_level', (), None) - self.get_midi_mode_cmd = Command('_', '\x07\x05', 'systemtools', 'get_midi_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.is_qlink_local_ctrl_enabled_cmd = Command('_', '\x07\x06', 'systemtools', 'is_qlink_local_ctrl_enabled', (), None) - self.is_default_items_enabled_cmd = Command('_', '\x07\x07', 'systemtools', 'is_default_items_enabled', (), None) - self.get_midi_file_save_format_cmd = Command('_', '\x07\x08', 'systemtools', 'get_midi_file_save_format', (), None) - self.get_cdr_write_speed_cmd = Command('_', '\x07\x09', 'systemtools', 'get_cdr_write_speed', (), None) - self.get_cdr_write_mode_cmd = Command('_', '\x07\x0A', 'systemtools', 'get_cdr_write_mode', (), None) - self.is_front_panel_locked_cmd = Command('_', '\x07\x10', 'systemtools', 'is_front_panel_locked', (), None) - self.get_display_contrast_cmd = Command('_', '\x07\x11', 'systemtools', 'get_display_contrast', (), None) - self.get_note_display_cmd = Command('_', '\x07\x12', 'systemtools', 'get_note_display', (), None) - self.get_date_format_cmd = Command('_', '\x07\x13', 'systemtools', 'get_date_format', (), None) - self.get_time_format_cmd = Command('_', '\x07\x14', 'systemtools', 'get_time_format', (), None) - self.get_waveform_view_scale_cmd = Command('_', '\x07\x18', 'systemtools', 'get_waveform_view_scale', (), None) - self.get_waveform_view_type_cmd = Command('_', '\x07\x19', 'systemtools', 'get_waveform_view_type', (), None) - self.get_waveform_view_fill_cmd = Command('_', '\x07\x1A', 'systemtools', 'get_waveform_view_fill', (), None) - self.get_item_sort_mode_cmd = Command('_', '\x07\x1B', 'systemtools', 'get_item_sort_mode', (), None) - self.get_year_cmd = Command('_', '\x07\x20', 'systemtools', 'get_year', (), None) - self.get_month_cmd = Command('_', '\x07\x21', 'systemtools', 'get_month', (), None) - self.get_day_cmd = Command('_', '\x07\x22', 'systemtools', 'get_day', (), None) - self.get_day_of_week_cmd = Command('_', '\x07\x23', 'systemtools', 'get_day_of_week', (), None) - self.get_hours_cmd = Command('_', '\x07\x24', 'systemtools', 'get_hours', (), None) - self.get_mins_cmd = Command('_', '\x07\x25', 'systemtools', 'get_mins', (), None) - self.get_secs_cmd = Command('_', '\x07\x26', 'systemtools', 'get_secs', (), None) - self.get_system_clock_cmd = Command('_', '\x07\x30', 'systemtools', 'get_system_clock', (), None) - self.get_dig_sync_cmd = Command('_', '\x07\x31', 'systemtools', 'get_dig_sync', (), None) - self.get_dig_format_cmd = Command('_', '\x07\x32', 'systemtools', 'get_dig_format', (), None) - self.get_adat_main_out_cmd = Command('_', '\x07\x33', 'systemtools', 'get_adat_main_out', (), None) - self.get_play_mode_cmd = Command('_', '\x07\x40', 'systemtools', 'get_play_mode', (), None) - self.get_prog_monitor_mode_cmd = Command('_', '\x07\x41', 'systemtools', 'get_prog_monitor_mode', (), None) - self.get_sample_monitor_mode_cmd = Command('_', '\x07\x42', 'systemtools', 'get_sample_monitor_mode', (), None) - self.get_play_key_note_cmd = Command('_', '\x07\x48', 'systemtools', 'get_play_key_note', (), None) - self.get_play_key_velocity_cmd = Command('_', '\x07\x49', 'systemtools', 'get_play_key_velocity', (), None) - self.get_play_key_midi_channel_cmd = Command('_', '\x07\x4a', 'systemtools', 'get_play_key_midi_channel', (), None) - self.get_play_key_echo_cmd = Command('_', '\x07\x4b', 'systemtools', 'get_play_key_echo', (), None) - self.get_prog_change_enable_cmd = Command('_', '\x07\x4c', 'systemtools', 'get_prog_change_enable', (), None) - self.get_autoload_enable_cmd = Command('_', '\x07\x4d', 'systemtools', 'get_autoload_enable', (), None) - self.get_global_pad_mode_cmd = Command('_', '\x07\x50', 'systemtools', 'get_global_pad_mode', (), None) - self.get_pad_midi_channel_cmd = Command('_', '\x07\x51', 'systemtools', 'get_pad_midi_channel', (), None) - self.get_pad_sensitivity_cmd = Command('_', '\x07\x52', 'systemtools', 'get_pad_sensitivity', (), None) - self.get_def_note_assign_cmd = Command('_', '\x07\x53', 'systemtools', 'get_def_note_assign', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_chrom_start_note_cmd = Command('_', '\x07\x54', 'systemtools', 'get_chrom_start_note', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_sampler_name_cmd = Command('_', '\x06\x01', 'systemtools', 'set_sampler_name', (aksy.devices.akai.sysex_types.STRING,), None) - self.set_scsi_id_cmd = Command('_', '\x06\x02', 'systemtools', 'set_scsi_id', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_master_tune_cmd = Command('_', '\x06\x03', 'systemtools', 'set_master_tune', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_master_level_cmd = Command('_', '\x06\x04', 'systemtools', 'set_master_level', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_midi_out_thru_cmd = Command('_', '\x06\x05', 'systemtools', 'set_midi_out_thru', (), None) - self.set_qlink_local_control_cmd = Command('_', '\x06\x06', 'systemtools', 'set_qlink_local_control', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_create_default_items_cmd = Command('_', '\x06\x07', 'systemtools', 'set_create_default_items', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_midi_file_save_format_cmd = Command('_', '\x06\x08', 'systemtools', 'set_midi_file_save_format', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_cdr_write_speed_cmd = Command('_', '\x06\x09', 'systemtools', 'set_cdr_write_speed', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_cdr_write_mode_cmd = Command('_', '\x06\x0a', 'systemtools', 'set_cdr_write_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_front_panel_lockout_state_cmd = Command('_', '\x06\x10', 'systemtools', 'set_front_panel_lockout_state', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_display_contrast_cmd = Command('_', '\x06\x11', 'systemtools', 'set_display_contrast', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_note_display_cmd = Command('_', '\x06\x12', 'systemtools', 'set_note_display', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_date_display_format_cmd = Command('_', '\x06\x13', 'systemtools', 'set_date_display_format', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_time_display_format_cmd = Command('_', '\x06\x14', 'systemtools', 'set_time_display_format', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_waveform_view_scale_cmd = Command('_', '\x06\x18', 'systemtools', 'set_waveform_view_scale', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_waveform_view_type_cmd = Command('_', '\x06\x19', 'systemtools', 'set_waveform_view_type', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_waveform_view_fill_cmd = Command('_', '\x06\x1a', 'systemtools', 'set_waveform_view_fill', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_item_sort_mode_cmd = Command('_', '\x06\x1b', 'systemtools', 'set_item_sort_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_year_cmd = Command('_', '\x06\x20', 'systemtools', 'set_year', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_month_cmd = Command('_', '\x06\x21', 'systemtools', 'set_month', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_day_cmd = Command('_', '\x06\x22', 'systemtools', 'set_day', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_day_of_week_cmd = Command('_', '\x06\x23', 'systemtools', 'set_day_of_week', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_hours_cmd = Command('_', '\x06\x24', 'systemtools', 'set_hours', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_minutes_cmd = Command('_', '\x06\x25', 'systemtools', 'set_minutes', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_seconds_cmd = Command('_', '\x06\x26', 'systemtools', 'set_seconds', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_system_clock_cmd = Command('_', '\x06\x30', 'systemtools', 'set_system_clock', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_digital_out_sync_cmd = Command('_', '\x06\x31', 'systemtools', 'set_digital_out_sync', (), None) - self.set_digital_format_cmd = Command('_', '\x06\x32', 'systemtools', 'set_digital_format', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_adat_main_out_cmd = Command('_', '\x06\x33', 'systemtools', 'set_adat_main_out', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_play_mode_cmd = Command('_', '\x06\x40', 'systemtools', 'set_play_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_program_monitor_mode_cmd = Command('_', '\x06\x41', 'systemtools', 'set_program_monitor_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_sample_monitor_mode_cmd = Command('_', '\x06\x42', 'systemtools', 'set_sample_monitor_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_play_key_note_cmd = Command('_', '\x06\x48', 'systemtools', 'set_play_key_note', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_play_key_velocity_cmd = Command('_', '\x06\x49', 'systemtools', 'set_play_key_velocity', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_play_key_midi_channel_cmd = Command('_', '\x06\x4a', 'systemtools', 'set_play_key_midi_channel', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_play_key_echo_cmd = Command('_', '\x06\x4b', 'systemtools', 'set_play_key_echo', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_program_change_enable_cmd = Command('_', '\x06\x4c', 'systemtools', 'set_program_change_enable', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_autoload_enable_cmd = Command('_', '\x06\x4d', 'systemtools', 'set_autoload_enable', (aksy.devices.akai.sysex_types.BOOL,), None) - self.set_global_pad_mode_cmd = Command('_', '\x05\x50', 'systemtools', 'set_global_pad_mode', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_pad_midi_channel_cmd = Command('_', '\x06\x51', 'systemtools', 'set_pad_midi_channel', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_pad_sensitivity_cmd = Command('_', '\x06\x52', 'systemtools', 'set_pad_sensitivity', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_default_note_assignment_cmd = Command('_', '\x06\x53', 'systemtools', 'set_default_note_assignment', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_chromatic_start_note_cmd = Command('_', '\x06\x54', 'systemtools', 'set_chromatic_start_note', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_os_software_version_cmd = Command(b'_', b'\x04\x00', 'systemtools', 'get_os_software_version', (), None) + self.get_os_subversion_cmd = Command(b'_', b'\x04\x01', 'systemtools', 'get_os_subversion', (), None) + self.get_sampler_model_cmd = Command(b'_', b'\x04\x04', 'systemtools', 'get_sampler_model', (), None) + self.get_supported_filetypes_cmd = Command(b'_', b'\x04\x08', 'systemtools', 'get_supported_filetypes', (), None) + self.get_perc_free_wave_mem_cmd = Command(b'_', b'\x04\x10', 'systemtools', 'get_perc_free_wave_mem', (), None) + self.get_perc_free_cpu_mem_cmd = Command(b'_', b'\x04\x11', 'systemtools', 'get_perc_free_cpu_mem', (), None) + self.get_wave_mem_size_cmd = Command(b'_', b'\x04\x12', 'systemtools', 'get_wave_mem_size', (), None) + self.get_free_wave_mem_size_cmd = Command(b'_', b'\x04\x13', 'systemtools', 'get_free_wave_mem_size', (), None) + self.clear_sampler_mem_cmd = Command(b'_', b'\x04\x18', 'systemtools', 'clear_sampler_mem', (), None) + self.purge_unused_cmd = Command(b'_', b'\x04\x19', 'systemtools', 'purge_unused', (aksy.devices.akai.sysex_types.BYTE,), None) + self.tag_unused_cmd = Command(b'_', b'\x04\x1A', 'systemtools', 'tag_unused', (aksy.devices.akai.sysex_types.BYTE,), None) + self.compact_wave_mem_cmd = Command(b'_', b'\x04\x20', 'systemtools', 'compact_wave_mem', (), None) + self.cancel_compact_wave_mem_cmd = Command(b'_', b'\x04\x21', 'systemtools', 'cancel_compact_wave_mem', (), None) + self.get_compact_wave_mem_progress_cmd = Command(b'_', b'\x04\x22', 'systemtools', 'get_compact_wave_mem_progress', (), None) + self.get_async_operation_state_cmd = Command(b'_', b'\x04\x30', 'systemtools', 'get_async_operation_state', (), None) + self.cancel_curr_async_operation_cmd = Command(b'_', b'\x04\x31', 'systemtools', 'cancel_curr_async_operation', (), None) + self.get_sampler_name_cmd = Command(b'_', b'\x07\x01', 'systemtools', 'get_sampler_name', (), None) + self.get_scsi_id_cmd = Command(b'_', b'\x07\x02', 'systemtools', 'get_scsi_id', (), None) + self.get_master_tune_cmd = Command(b'_', b'\x07\x03', 'systemtools', 'get_master_tune', (), None) + self.get_master_level_cmd = Command(b'_', b'\x07\x04', 'systemtools', 'get_master_level', (), None) + self.get_midi_mode_cmd = Command(b'_', b'\x07\x05', 'systemtools', 'get_midi_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.is_qlink_local_ctrl_enabled_cmd = Command(b'_', b'\x07\x06', 'systemtools', 'is_qlink_local_ctrl_enabled', (), None) + self.is_default_items_enabled_cmd = Command(b'_', b'\x07\x07', 'systemtools', 'is_default_items_enabled', (), None) + self.get_midi_file_save_format_cmd = Command(b'_', b'\x07\x08', 'systemtools', 'get_midi_file_save_format', (), None) + self.get_cdr_write_speed_cmd = Command(b'_', b'\x07\x09', 'systemtools', 'get_cdr_write_speed', (), None) + self.get_cdr_write_mode_cmd = Command(b'_', b'\x07\x0A', 'systemtools', 'get_cdr_write_mode', (), None) + self.is_front_panel_locked_cmd = Command(b'_', b'\x07\x10', 'systemtools', 'is_front_panel_locked', (), None) + self.get_display_contrast_cmd = Command(b'_', b'\x07\x11', 'systemtools', 'get_display_contrast', (), None) + self.get_note_display_cmd = Command(b'_', b'\x07\x12', 'systemtools', 'get_note_display', (), None) + self.get_date_format_cmd = Command(b'_', b'\x07\x13', 'systemtools', 'get_date_format', (), None) + self.get_time_format_cmd = Command(b'_', b'\x07\x14', 'systemtools', 'get_time_format', (), None) + self.get_waveform_view_scale_cmd = Command(b'_', b'\x07\x18', 'systemtools', 'get_waveform_view_scale', (), None) + self.get_waveform_view_type_cmd = Command(b'_', b'\x07\x19', 'systemtools', 'get_waveform_view_type', (), None) + self.get_waveform_view_fill_cmd = Command(b'_', b'\x07\x1A', 'systemtools', 'get_waveform_view_fill', (), None) + self.get_item_sort_mode_cmd = Command(b'_', b'\x07\x1B', 'systemtools', 'get_item_sort_mode', (), None) + self.get_year_cmd = Command(b'_', b'\x07\x20', 'systemtools', 'get_year', (), None) + self.get_month_cmd = Command(b'_', b'\x07\x21', 'systemtools', 'get_month', (), None) + self.get_day_cmd = Command(b'_', b'\x07\x22', 'systemtools', 'get_day', (), None) + self.get_day_of_week_cmd = Command(b'_', b'\x07\x23', 'systemtools', 'get_day_of_week', (), None) + self.get_hours_cmd = Command(b'_', b'\x07\x24', 'systemtools', 'get_hours', (), None) + self.get_mins_cmd = Command(b'_', b'\x07\x25', 'systemtools', 'get_mins', (), None) + self.get_secs_cmd = Command(b'_', b'\x07\x26', 'systemtools', 'get_secs', (), None) + self.get_system_clock_cmd = Command(b'_', b'\x07\x30', 'systemtools', 'get_system_clock', (), None) + self.get_dig_sync_cmd = Command(b'_', b'\x07\x31', 'systemtools', 'get_dig_sync', (), None) + self.get_dig_format_cmd = Command(b'_', b'\x07\x32', 'systemtools', 'get_dig_format', (), None) + self.get_adat_main_out_cmd = Command(b'_', b'\x07\x33', 'systemtools', 'get_adat_main_out', (), None) + self.get_play_mode_cmd = Command(b'_', b'\x07\x40', 'systemtools', 'get_play_mode', (), None) + self.get_prog_monitor_mode_cmd = Command(b'_', b'\x07\x41', 'systemtools', 'get_prog_monitor_mode', (), None) + self.get_sample_monitor_mode_cmd = Command(b'_', b'\x07\x42', 'systemtools', 'get_sample_monitor_mode', (), None) + self.get_play_key_note_cmd = Command(b'_', b'\x07\x48', 'systemtools', 'get_play_key_note', (), None) + self.get_play_key_velocity_cmd = Command(b'_', b'\x07\x49', 'systemtools', 'get_play_key_velocity', (), None) + self.get_play_key_midi_channel_cmd = Command(b'_', b'\x07\x4a', 'systemtools', 'get_play_key_midi_channel', (), None) + self.get_play_key_echo_cmd = Command(b'_', b'\x07\x4b', 'systemtools', 'get_play_key_echo', (), None) + self.get_prog_change_enable_cmd = Command(b'_', b'\x07\x4c', 'systemtools', 'get_prog_change_enable', (), None) + self.get_autoload_enable_cmd = Command(b'_', b'\x07\x4d', 'systemtools', 'get_autoload_enable', (), None) + self.get_global_pad_mode_cmd = Command(b'_', b'\x07\x50', 'systemtools', 'get_global_pad_mode', (), None) + self.get_pad_midi_channel_cmd = Command(b'_', b'\x07\x51', 'systemtools', 'get_pad_midi_channel', (), None) + self.get_pad_sensitivity_cmd = Command(b'_', b'\x07\x52', 'systemtools', 'get_pad_sensitivity', (), None) + self.get_def_note_assign_cmd = Command(b'_', b'\x07\x53', 'systemtools', 'get_def_note_assign', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_chrom_start_note_cmd = Command(b'_', b'\x07\x54', 'systemtools', 'get_chrom_start_note', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_sampler_name_cmd = Command(b'_', b'\x06\x01', 'systemtools', 'set_sampler_name', (aksy.devices.akai.sysex_types.STRING,), None) + self.set_scsi_id_cmd = Command(b'_', b'\x06\x02', 'systemtools', 'set_scsi_id', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_master_tune_cmd = Command(b'_', b'\x06\x03', 'systemtools', 'set_master_tune', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_master_level_cmd = Command(b'_', b'\x06\x04', 'systemtools', 'set_master_level', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_midi_out_thru_cmd = Command(b'_', b'\x06\x05', 'systemtools', 'set_midi_out_thru', (), None) + self.set_qlink_local_control_cmd = Command(b'_', b'\x06\x06', 'systemtools', 'set_qlink_local_control', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_create_default_items_cmd = Command(b'_', b'\x06\x07', 'systemtools', 'set_create_default_items', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_midi_file_save_format_cmd = Command(b'_', b'\x06\x08', 'systemtools', 'set_midi_file_save_format', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_cdr_write_speed_cmd = Command(b'_', b'\x06\x09', 'systemtools', 'set_cdr_write_speed', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_cdr_write_mode_cmd = Command(b'_', b'\x06\x0a', 'systemtools', 'set_cdr_write_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_front_panel_lockout_state_cmd = Command(b'_', b'\x06\x10', 'systemtools', 'set_front_panel_lockout_state', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_display_contrast_cmd = Command(b'_', b'\x06\x11', 'systemtools', 'set_display_contrast', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_note_display_cmd = Command(b'_', b'\x06\x12', 'systemtools', 'set_note_display', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_date_display_format_cmd = Command(b'_', b'\x06\x13', 'systemtools', 'set_date_display_format', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_time_display_format_cmd = Command(b'_', b'\x06\x14', 'systemtools', 'set_time_display_format', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_waveform_view_scale_cmd = Command(b'_', b'\x06\x18', 'systemtools', 'set_waveform_view_scale', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_waveform_view_type_cmd = Command(b'_', b'\x06\x19', 'systemtools', 'set_waveform_view_type', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_waveform_view_fill_cmd = Command(b'_', b'\x06\x1a', 'systemtools', 'set_waveform_view_fill', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_item_sort_mode_cmd = Command(b'_', b'\x06\x1b', 'systemtools', 'set_item_sort_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_year_cmd = Command(b'_', b'\x06\x20', 'systemtools', 'set_year', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_month_cmd = Command(b'_', b'\x06\x21', 'systemtools', 'set_month', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_day_cmd = Command(b'_', b'\x06\x22', 'systemtools', 'set_day', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_day_of_week_cmd = Command(b'_', b'\x06\x23', 'systemtools', 'set_day_of_week', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_hours_cmd = Command(b'_', b'\x06\x24', 'systemtools', 'set_hours', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_minutes_cmd = Command(b'_', b'\x06\x25', 'systemtools', 'set_minutes', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_seconds_cmd = Command(b'_', b'\x06\x26', 'systemtools', 'set_seconds', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_system_clock_cmd = Command(b'_', b'\x06\x30', 'systemtools', 'set_system_clock', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_digital_out_sync_cmd = Command(b'_', b'\x06\x31', 'systemtools', 'set_digital_out_sync', (), None) + self.set_digital_format_cmd = Command(b'_', b'\x06\x32', 'systemtools', 'set_digital_format', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_adat_main_out_cmd = Command(b'_', b'\x06\x33', 'systemtools', 'set_adat_main_out', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_play_mode_cmd = Command(b'_', b'\x06\x40', 'systemtools', 'set_play_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_program_monitor_mode_cmd = Command(b'_', b'\x06\x41', 'systemtools', 'set_program_monitor_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_sample_monitor_mode_cmd = Command(b'_', b'\x06\x42', 'systemtools', 'set_sample_monitor_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_play_key_note_cmd = Command(b'_', b'\x06\x48', 'systemtools', 'set_play_key_note', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_play_key_velocity_cmd = Command(b'_', b'\x06\x49', 'systemtools', 'set_play_key_velocity', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_play_key_midi_channel_cmd = Command(b'_', b'\x06\x4a', 'systemtools', 'set_play_key_midi_channel', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_play_key_echo_cmd = Command(b'_', b'\x06\x4b', 'systemtools', 'set_play_key_echo', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_program_change_enable_cmd = Command(b'_', b'\x06\x4c', 'systemtools', 'set_program_change_enable', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_autoload_enable_cmd = Command(b'_', b'\x06\x4d', 'systemtools', 'set_autoload_enable', (aksy.devices.akai.sysex_types.BOOL,), None) + self.set_global_pad_mode_cmd = Command(b'_', b'\x05\x50', 'systemtools', 'set_global_pad_mode', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_pad_midi_channel_cmd = Command(b'_', b'\x06\x51', 'systemtools', 'set_pad_midi_channel', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_pad_sensitivity_cmd = Command(b'_', b'\x06\x52', 'systemtools', 'set_pad_sensitivity', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_default_note_assignment_cmd = Command(b'_', b'\x06\x53', 'systemtools', 'set_default_note_assignment', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_chromatic_start_note_cmd = Command(b'_', b'\x06\x54', 'systemtools', 'set_chromatic_start_note', (aksy.devices.akai.sysex_types.BYTE,), None) def get_os_software_version(self): """Get Operating System Software Version diff --git a/src/aksy/devices/akai/z48/zonetools.py b/src/aksy/devices/akai/z48/zonetools.py index 5814712..4212d00 100644 --- a/src/aksy/devices/akai/z48/zonetools.py +++ b/src/aksy/devices/akai/z48/zonetools.py @@ -14,32 +14,32 @@ class Zonetools: def __init__(self, z48): self.sampler = z48 - self.get_sample_cmd = Command('_', '\x0F\x01', 'zonetools', 'get_sample', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_level_cmd = Command('_', '\x0F\x02', 'zonetools', 'get_level', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_pan_cmd = Command('_', '\x0F\x03', 'zonetools', 'get_pan', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_output_cmd = Command('_', '\x0F\x04', 'zonetools', 'get_output', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_filter_cmd = Command('_', '\x0F\x05', 'zonetools', 'get_filter', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_tune_cmd = Command('_', '\x0F\x06', 'zonetools', 'get_tune', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_keyboard_track_cmd = Command('_', '\x0F\x07', 'zonetools', 'get_keyboard_track', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_playback_cmd = Command('_', '\x0F\x08', 'zonetools', 'get_playback', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_mod_start_cmd = Command('_', '\x0F\x09', 'zonetools', 'get_mod_start', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_low_velocity_cmd = Command('_', '\x0F\x0A', 'zonetools', 'get_low_velocity', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_high_velocity_cmd = Command('_', '\x0F\x0B', 'zonetools', 'get_high_velocity', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_mute_cmd = Command('_', '\x0F\x0C', 'zonetools', 'get_mute', (aksy.devices.akai.sysex_types.BYTE,), None) - self.get_solo_cmd = Command('_', '\x0F\x0D', 'zonetools', 'get_solo', (aksy.devices.akai.sysex_types.BYTE,), None) - self.set_sample_cmd = Command('_', '\x0E\x01', 'zonetools', 'set_sample', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.STRING), None) - self.set_level_cmd = Command('_', '\x0E\x02', 'zonetools', 'set_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) - self.set_pan_cmd = Command('_', '\x0E\x03', 'zonetools', 'set_pan', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_output_cmd = Command('_', '\x0E\x04', 'zonetools', 'set_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_filter_cmd = Command('_', '\x0E\x05', 'zonetools', 'set_filter', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) - self.set_tune_cmd = Command('_', '\x0E\x06', 'zonetools', 'set_tune', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) - self.set_keyboard_track_cmd = Command('_', '\x0E\x07', 'zonetools', 'set_keyboard_track', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) - self.set_playback_cmd = Command('_', '\x0E\x08', 'zonetools', 'set_playback', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_mod_start_cmd = Command('_', '\x0E\x09', 'zonetools', 'set_mod_start', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) - self.set_low_vel_cmd = Command('_', '\x0E\x0A', 'zonetools', 'set_low_vel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_high_vel_cmd = Command('_', '\x0E\x0B', 'zonetools', 'set_high_vel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_mute_cmd = Command('_', '\x0E\x0C', 'zonetools', 'set_mute', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) - self.set_solo_cmd = Command('_', '\x0E\x0D', 'zonetools', 'set_solo', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.get_sample_cmd = Command(b'_', b'\x0F\x01', 'zonetools', 'get_sample', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_level_cmd = Command(b'_', b'\x0F\x02', 'zonetools', 'get_level', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_pan_cmd = Command(b'_', b'\x0F\x03', 'zonetools', 'get_pan', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_output_cmd = Command(b'_', b'\x0F\x04', 'zonetools', 'get_output', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_filter_cmd = Command(b'_', b'\x0F\x05', 'zonetools', 'get_filter', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_tune_cmd = Command(b'_', b'\x0F\x06', 'zonetools', 'get_tune', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_keyboard_track_cmd = Command(b'_', b'\x0F\x07', 'zonetools', 'get_keyboard_track', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_playback_cmd = Command(b'_', b'\x0F\x08', 'zonetools', 'get_playback', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_mod_start_cmd = Command(b'_', b'\x0F\x09', 'zonetools', 'get_mod_start', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_low_velocity_cmd = Command(b'_', b'\x0F\x0A', 'zonetools', 'get_low_velocity', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_high_velocity_cmd = Command(b'_', b'\x0F\x0B', 'zonetools', 'get_high_velocity', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_mute_cmd = Command(b'_', b'\x0F\x0C', 'zonetools', 'get_mute', (aksy.devices.akai.sysex_types.BYTE,), None) + self.get_solo_cmd = Command(b'_', b'\x0F\x0D', 'zonetools', 'get_solo', (aksy.devices.akai.sysex_types.BYTE,), None) + self.set_sample_cmd = Command(b'_', b'\x0E\x01', 'zonetools', 'set_sample', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.STRING), None) + self.set_level_cmd = Command(b'_', b'\x0E\x02', 'zonetools', 'set_level', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) + self.set_pan_cmd = Command(b'_', b'\x0E\x03', 'zonetools', 'set_pan', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_output_cmd = Command(b'_', b'\x0E\x04', 'zonetools', 'set_output', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_filter_cmd = Command(b'_', b'\x0E\x05', 'zonetools', 'set_filter', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SBYTE), None) + self.set_tune_cmd = Command(b'_', b'\x0E\x06', 'zonetools', 'set_tune', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) + self.set_keyboard_track_cmd = Command(b'_', b'\x0E\x07', 'zonetools', 'set_keyboard_track', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BOOL), None) + self.set_playback_cmd = Command(b'_', b'\x0E\x08', 'zonetools', 'set_playback', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_mod_start_cmd = Command(b'_', b'\x0E\x09', 'zonetools', 'set_mod_start', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.SWORD), None) + self.set_low_vel_cmd = Command(b'_', b'\x0E\x0A', 'zonetools', 'set_low_vel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_high_vel_cmd = Command(b'_', b'\x0E\x0B', 'zonetools', 'set_high_vel', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_mute_cmd = Command(b'_', b'\x0E\x0C', 'zonetools', 'set_mute', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) + self.set_solo_cmd = Command(b'_', b'\x0E\x0D', 'zonetools', 'set_solo', (aksy.devices.akai.sysex_types.BYTE, aksy.devices.akai.sysex_types.BYTE), None) def get_sample(self, arg0): """Get Zone Sample (Data1=zone number 1-4) From 5b777e38c856208b1ea3ca36747a46bdff5065f9 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 18 Jun 2022 23:24:04 +0200 Subject: [PATCH 24/66] #6 refactor transfer location into a python enum to reduce depedency on native code, simplifying running unit tests --- src/aksy/constants.py | 6 ++++++ src/aksy/devices/akai/mock_z48/sampler.py | 8 ++++---- src/aksy/devices/akai/model.py | 5 ++--- src/aksy/devices/akai/sampler.py | 3 --- src/aksy/devices/akai/transfertools.py | 12 ++++++------ src/aksyfs/aksyfuse.py | 6 +++--- src/tests/aksy/tests/test_constants.py | 15 +++++++++++++++ 7 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 src/aksy/constants.py create mode 100644 src/tests/aksy/tests/test_constants.py diff --git a/src/aksy/constants.py b/src/aksy/constants.py new file mode 100644 index 0000000..24fe550 --- /dev/null +++ b/src/aksy/constants.py @@ -0,0 +1,6 @@ +import enum + + +class TransferLocation(enum.IntEnum): + DISK = 0 + MEMORY = 1 diff --git a/src/aksy/devices/akai/mock_z48/sampler.py b/src/aksy/devices/akai/mock_z48/sampler.py index f31b0da..cec2167 100644 --- a/src/aksy/devices/akai/mock_z48/sampler.py +++ b/src/aksy/devices/akai/mock_z48/sampler.py @@ -1,9 +1,9 @@ import logging, shutil -from aksy.devices.akai import sysex_types, model +from aksy.devices.akai import model from aksy.devices.akai.sampler import Sampler +from aksy.constants import TransferLocation from aksy.devices.akai.z48.sampler import Z48 -from aksyx import AkaiSampler from aksy import fileutils log = logging.getLogger('aksy') @@ -13,7 +13,7 @@ def __init__(self): self.sample_file = '' self.program_file = '' - def get(self, filename, destpath=None, source=AkaiSampler.MEMORY): + def get(self, filename, destpath=None, source=TransferLocation.MEMORY): log.debug("Transferring file %s to host from source %i" % (filename, source)) try: if fileutils.is_sample(filename): @@ -23,7 +23,7 @@ def get(self, filename, destpath=None, source=AkaiSampler.MEMORY): except IOError: raise model.SamplerException("Failed to get ", filename) - def put(self, path, remote_name=None, destination=AkaiSampler.MEMORY): + def put(self, path, remote_name=None, destination=TransferLocation.MEMORY): log.debug("Transferring file %s to sampler at remote_name %s (%i)" % (path, remote_name, destination)) diff --git a/src/aksy/devices/akai/model.py b/src/aksy/devices/akai/model.py index 64bdda2..61ea3e1 100644 --- a/src/aksy/devices/akai/model.py +++ b/src/aksy/devices/akai/model.py @@ -4,9 +4,8 @@ """ import os.path, logging -from aksyx import AkaiSampler from aksy import fileutils - +from aksy.constants import TransferLocation handlers = {} LOG = logging.getLogger("aksy.model") @@ -276,7 +275,7 @@ def upload(self, path): self.set_current() name = os.path.basename(path) # TODO define enum elsewhere - handlers[Disk].z48.put(path, name, destination=AkaiSampler.DISK) + handlers[Disk].z48.put(path, name, destination=TransferLocation.DISK) item = FileRef(self.path + (name,)) self.children.append(item) return item diff --git a/src/aksy/devices/akai/sampler.py b/src/aksy/devices/akai/sampler.py index 974497b..18da601 100644 --- a/src/aksy/devices/akai/sampler.py +++ b/src/aksy/devices/akai/sampler.py @@ -1,5 +1,4 @@ from aksy.devices.akai import transfertools -from aksyx import AkaiSampler from aksy import fileutils @@ -15,8 +14,6 @@ class Sampler(object): """Base class for AkaiSampler. """ - MEMORY = AkaiSampler.MEMORY - DISK = AkaiSampler.DISK def __init__(self, connector): self.connector = connector self.transfertools = transfertools.Transfertools(connector) diff --git a/src/aksy/devices/akai/transfertools.py b/src/aksy/devices/akai/transfertools.py index 5bef572..240f927 100644 --- a/src/aksy/devices/akai/transfertools.py +++ b/src/aksy/devices/akai/transfertools.py @@ -1,19 +1,19 @@ - """ Transfertools Methods to send and receive files from the sampler. """ -__author__ = 'Walco van Loon' -__version__= "$Rev: 1354 $" +__author__ = 'Walco van Loon' +__version__ = "$Rev: 1354 $" import os.path, logging import aksy.devices.akai.sysex -from aksyx import AkaiSampler +from aksy.constants import TransferLocation LOG = logging.getLogger('aksy.devices.akai.transfertools') + class Transfertools: def __init__(self, connector): self.connector = connector @@ -24,7 +24,7 @@ def __init__(self, connector): aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING, aksy.devices.akai.sysex_types.STRING), None) - def get(self, filename, destfile=None, source=AkaiSampler.MEMORY): + def get(self, filename, destfile=None, source=TransferLocation.MEMORY): """Gets a file from the sampler, overwriting destfile if it already exists. """ if LOG.isEnabledFor(logging.DEBUG): @@ -38,7 +38,7 @@ def get(self, filename, destfile=None, source=AkaiSampler.MEMORY): else: return self.connector.execute(self.get_cmd, (filename, destfile, source)) - def put(self, sourcepath, remote_name=None, destination=AkaiSampler.MEMORY): + def put(self, sourcepath, remote_name=None, destination=TransferLocation.MEMORY): """Transfers a file to the sampler, overwriting it if it already exists. Default destination is memory """ diff --git a/src/aksyfs/aksyfuse.py b/src/aksyfs/aksyfuse.py index 71e74a8..8ab38f3 100644 --- a/src/aksyfs/aksyfuse.py +++ b/src/aksyfs/aksyfuse.py @@ -13,8 +13,8 @@ from aksy.device import Devices from aksy.concurrent import transaction -from aksy.devices.akai import sampler as samplermod from aksy import config +from aksy.constants import TransferLocation from aksyfs import common fuse.fuse_python_api = (0, 2) @@ -39,9 +39,9 @@ def __init__(self, path, flags, *mode): self.name = os.path.basename(path) location = common._splitpath(path)[0] if location == "memory": - self.location = samplermod.AkaiSampler.MEMORY + self.location = TransferLocation.MEMORY elif location == "disks": - self.location = samplermod.AkaiSampler.DISK + self.location = TransferLocation.DISK else: raiseException(errno.ENOENT) diff --git a/src/tests/aksy/tests/test_constants.py b/src/tests/aksy/tests/test_constants.py new file mode 100644 index 0000000..181f57e --- /dev/null +++ b/src/tests/aksy/tests/test_constants.py @@ -0,0 +1,15 @@ +import unittest + +from aksy.constants import TransferLocation +from aksyx import AkaiSampler + + +class TestConstants(unittest.TestCase): + def test_enum_values_shall_be_identical(self): + assert AkaiSampler.DISK == TransferLocation.DISK + assert AkaiSampler.MEMORY == TransferLocation.MEMORY + + +def test_suite(): + testloader = unittest.TestLoader() + return testloader.loadTestsFromName('tests.aksy.tests.test_aksyx') From 103f10e2c1980c4fc4852951b2fa0a801597efdb Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 18 Jun 2022 23:24:56 +0200 Subject: [PATCH 25/66] #6 assert types (could not get mypy to flag the issues) --- src/aksy/devices/akai/sysex.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/aksy/devices/akai/sysex.py b/src/aksy/devices/akai/sysex.py index 4e468ac..0bfeb67 100644 --- a/src/aksy/devices/akai/sysex.py +++ b/src/aksy/devices/akai/sysex.py @@ -16,8 +16,11 @@ class Command: """Represents a system exclusive command. """ - def __init__(self, device_id, cmd_id, section, name, arg_types, - reply_spec, userref_type=sysex_types.USERREF): + def __init__(self, device_id: bytes, cmd_id: bytes, section, name, arg_types, + reply_spec, userref_type=sysex_types.USERREF): + assert isinstance(device_id, bytes) + assert isinstance(cmd_id, bytes) + self.device_id = device_id self.id = cmd_id self.section = section From 095da3c91b097f8ac904bc6cb1fdcb663337d36f Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 18 Jun 2022 23:26:26 +0200 Subject: [PATCH 26/66] #6 fix test name --- src/tests/aksy/tests/test_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/aksy/tests/test_constants.py b/src/tests/aksy/tests/test_constants.py index 181f57e..bd6bcf7 100644 --- a/src/tests/aksy/tests/test_constants.py +++ b/src/tests/aksy/tests/test_constants.py @@ -12,4 +12,4 @@ def test_enum_values_shall_be_identical(self): def test_suite(): testloader = unittest.TestLoader() - return testloader.loadTestsFromName('tests.aksy.tests.test_aksyx') + return testloader.loadTestsFromName('tests.aksy.tests.test_constants') From 42d82f052e09206ccd4632d3303bb7181f072435 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 10:07:07 +0200 Subject: [PATCH 27/66] #6 Updated README.md to mention Python 3 support --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b1ad788..68ce9d9 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,19 @@ functionality (disk functions, transfers and a bunch of untested modules) of the S56K. With Aksui included from 0.3 and onwards, the original goal of Aksy comes in -site again. Stay tuned. +sight again. -And of 2017, this library seems to fulfill its promise: it still compiles and installs +And of 2022, this library starts to fulfill its promise: it still compiles and installs on modern 64 bit systems, thanks to the stability of libusb and python. -Python 2.7 is now supported. Python 3 support is looked into. +## Python 3 support +### Ported modules +* aksy core library works +* aksy-fs, mounting the sampler's memory and filesystem on a MacOS/Linux host system, works + +### Modules still to do +* aksy-ftpd, the FTP server which allows one to map the sampler's filesystem and memory as a Drive on Windows +* Aksui needs to be [ported from pygtk to pygobject](https://pygobject.readthedocs.io/en/latest/guide/porting.html) ## Usage From 375c548a32aae736abc1c4cefeda7fdfa7515442 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 10:07:19 +0200 Subject: [PATCH 28/66] #6 Formatting fixes --- src/aksyfs/aksyfuse.py | 3 ++- src/tests/aksyfs/tests/test_aksyfuse.py | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/aksyfs/aksyfuse.py b/src/aksyfs/aksyfuse.py index 8ab38f3..b35ca11 100644 --- a/src/aksyfs/aksyfuse.py +++ b/src/aksyfs/aksyfuse.py @@ -58,7 +58,7 @@ def release(self, flags): AksyFile.sampler.transfertools.put(self.get_path(), None, self.get_location()) except IOError as exc: # TODO: move to a method where we can raise exceptions - LOG.exception( "Exception occurred: ", exc) + LOG.exception("Exception occurred: ", exc) os.close(self.handle) def write(self, buf, offset): @@ -84,6 +84,7 @@ def get_handle(self): def get_location(self): return self.location + class FSStatInfo(fuse.StatVfs): def __init__(self, mem_total, mem_free): fuse.StatVfs.__init__(self) diff --git a/src/tests/aksyfs/tests/test_aksyfuse.py b/src/tests/aksyfs/tests/test_aksyfuse.py index 119cfd4..27e32f4 100644 --- a/src/tests/aksyfs/tests/test_aksyfuse.py +++ b/src/tests/aksyfs/tests/test_aksyfuse.py @@ -11,6 +11,7 @@ log = logging.getLogger('aksy') + class TestStatInfo(TestCase): def test_set_owner(self): common.StatInfo.set_owner(1, 1) @@ -20,18 +21,21 @@ def test_set_owner(self): self.assertEqual(1, info.st_uid) self.assertEqual(1, info.st_gid) + class TestDirStatInfo(TestCase): def test_stat_directory(self): info = common.DirStatInfo() self.assertTrue(S_ISDIR(info.st_mode)) + class TestFileStatInfo(TestCase): def test_stat_file(self): info = common.FileStatInfo('test.akp', None) self.assertFalse(S_ISDIR(info.st_mode)) self.assertEqual(16*1024, info.st_size) self.assertTrue(S_ISREG(info.st_mode)) - + + class AksyFSTest(TestCase): #IGNORE:R0904 def _assertdir(self, info): self.assertTrue(S_ISDIR(info.st_mode)) @@ -166,7 +170,8 @@ def test_unlink(self): self.fs.getattr(path) self.fs.unlink(path) self.assertRaises(OSError, self.fs.getattr, path) - + + def test_suite(): testloader = TestLoader() return testloader.loadTestsFromName('tests.aksyfs.tests.test_aksyfuse') From 47f3474874bbc9dc3118f5ff9e21e091526f4264 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 10:13:55 +0200 Subject: [PATCH 29/66] #6 pyftpdlib, trivial API changes --- src/aksyfs/ftpd.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/aksyfs/ftpd.py b/src/aksyfs/ftpd.py index 5ffb67c..807d979 100644 --- a/src/aksyfs/ftpd.py +++ b/src/aksyfs/ftpd.py @@ -1,5 +1,10 @@ #!/usr/bin/env python from pyftpdlib import filesystems + +from pyftpdlib.handlers import FTPHandler +from pyftpdlib.servers import FTPServer +from pyftpdlib.authorizers import DummyAuthorizer + from aksyfs import common from aksy.config import create_option_parser from aksy.device import Devices @@ -11,6 +16,7 @@ import logging LOG = logging.getLogger("aksy.aksyfs.ftpd") + class AksyFtpFS(common.AksyFS, filesystems.AbstractedFS): def __call__(self): return AksyFtpFS(self.sampler) @@ -174,7 +180,7 @@ def main(): options = parser.parse_args()[0] - authorizer = ftpserver.DummyAuthorizer() + authorizer = DummyAuthorizer() authorizer.add_anonymous('/', perm=('r', 'w')) address = (options.ftp_host, options.ftp_port) @@ -185,17 +191,18 @@ def main(): sampler = Devices.get_instance(options.sampler_type, options.connector) try: - ftp_handler = ftpserver.FTPHandler + ftp_handler = FTPHandler ftp_handler.authorizer = authorizer - ftp_handler.banner = "aksyftpd (pyftpd version %s) ready." % ftpserver.__ver__ + ftp_handler.banner = "aksyftpd ready." ftp_handler.abstracted_fs = AksyFtpFS(sampler) - ftpd = ftpserver.FTPServer(address, ftp_handler) + ftpd = FTPServer(address, ftp_handler) ftpd.max_cons = 256 ftpd.max_cons_per_ip = ftpd.max_cons ftpd.serve_forever() finally: sampler.close() + if __name__ == "__main__": main() From 9abe93240f9e30429fafef074ce221b7a8599ba3 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 10:24:23 +0200 Subject: [PATCH 30/66] #6 pyftpdlib, fix API and tests --- src/aksyfs/common.py | 72 +++++++++++++++-------------- src/aksyfs/ftpd.py | 1 + src/tests/aksyfs/tests/test_ftpd.py | 12 ++--- 3 files changed, 44 insertions(+), 41 deletions(-) diff --git a/src/aksyfs/common.py b/src/aksyfs/common.py index 0e92c76..fa467ee 100644 --- a/src/aksyfs/common.py +++ b/src/aksyfs/common.py @@ -6,13 +6,13 @@ import errno import logging +from aksy.constants import TransferLocation from aksy.device import Devices from aksy import fileutils from aksy.concurrent import transaction from aksy.devices.akai import sampler as samplermod from aksy.devices.akai import model -from aksy.config import get_config MAX_FILE_SIZE_SAMPLE = 512 * 1024 * 1024 # 512 MB MAX_FILE_SIZE_OTHER = 16 * 1024 # 16K @@ -25,7 +25,7 @@ class StatInfo(object): def set_owner(uid, gid): StatInfo.uid = uid StatInfo.gid = gid - + def __init__(self, mode, size, writable=False): self.st_dev = 0 # TODO: figure out whether required to provide unique value self.st_ino = 0 # TODO: figure out whether required to provide unique value @@ -43,7 +43,7 @@ def __init__(self, mode, size, writable=False): self.st_uid = StatInfo.uid self.st_gid = StatInfo.gid -class DirStatInfo(StatInfo): +class DirStatInfo(StatInfo): def __init__(self, writable=False, child_count=1): StatInfo.__init__(self, stat.S_IFDIR|stat.S_IEXEC, 4096) self.st_nlink = child_count @@ -54,7 +54,7 @@ def __init__(self, path, size, writable=False): size = get_file_size(path) StatInfo.__init__(self, stat.S_IFREG|stat.S_IWUSR, size, writable) self.st_nlink = 0 - + def is_modified(stat_info): return stat_info.st_mtime > START_TIME @@ -68,10 +68,10 @@ def get_file_size(path): cache_path = _get_cache_path(path) if os.path.exists(cache_path): return os.lstat(cache_path).st_size - + if fileutils.is_sample(path): return MAX_FILE_SIZE_SAMPLE - + return MAX_FILE_SIZE_OTHER def _cache_path_exists(path): @@ -88,16 +88,16 @@ class AksyFile(object): @staticmethod def set_sampler(sampler): AksyFile.sampler = sampler - + @staticmethod def parse_location(location): if location == "memory": - return samplermod.AkaiSampler.MEMORY + return TransferLocation.MEMORY elif location == "disks": - return samplermod.AkaiSampler.DISK + return TransferLocation.DISK else: raiseException(errno.ENOENT) - + @transaction() def __init__(self, path, flags, *mode): self.direct_io = True @@ -109,7 +109,7 @@ def __init__(self, path, flags, *mode): if not self.is_upload() or not _cache_path_exists(path): AksyFile.sampler.get(self.name, self.path, self.location) - + self.handle = os.open(self.path, flags, *mode) @transaction() @@ -132,30 +132,32 @@ def read(self, length, offset): def get_name(self): return self.name - + def get_path(self): return self.path - + def is_upload(self): return self.upload def get_handle(self): return self.handle - + def get_location(self): return self.location + class FSRoot(model.Container): def __init__(self, sampler): self.sampler = sampler - + def is_writable(self): return False - + def get_children(self): return [self.sampler.memory, self.sampler.disks] -class AksyFS(object): #IGNORE:R0904 + +class AksyFS(object): def __init__(self, sampler=None): if sampler is not None: self.init_sampler(sampler) @@ -169,9 +171,9 @@ def open_for_read(self, path, mode): path = _create_cache_path(path) if location == "memory": - location = samplermod.AkaiSampler.MEMORY + location = TransferLocation.MEMORY elif location == "disks": - location = samplermod.AkaiSampler.DISK + location = TransferLocation.DISK else: raiseException(errno.ENOENT) if LOG.isEnabledFor(logging.DEBUG): @@ -187,21 +189,21 @@ def open_for_write(self, path, mode): path = _create_cache_path(path) handle = open(path, mode) - + class UploadingFileWrapper: def __init__(self, fd, sampler): self.sampler = sampler self.file = fd - + def __getattr__(self, attr): return getattr(self.file, attr) - + def close(self): self.file.close() self.sampler.transfertools.put(path, name, dest) return UploadingFileWrapper(handle, self.sampler) - + def fetch_parent_folder(self, path): return self.get_parent(path).get_child(os.path.basename(path)) @@ -218,14 +220,14 @@ def stat_directory(self, path): def get_parent(self, path): parent = os.path.dirname(path) return self.cache[parent] - + def get_file(self, path): if not samplermod.Sampler.is_filetype_supported(path): raiseException(errno.ENOENT) parent_dir = self.get_parent(path) file_name = os.path.basename(path) - + for child in parent_dir.get_children(): if child.get_name() == file_name: return child @@ -238,7 +240,7 @@ def stat_file(self, path): return cached if _cache_path_exists(path): return os.lstat(_create_cache_path(path)) - + file_obj = self.get_file(path) if file_obj is None: raiseException(errno.ENOENT) @@ -270,7 +272,7 @@ def mkdir(self, path, mode='unused'): raiseException(errno.EROFS) if not hasattr(folder, 'create_folder'): raiseUnsupportedOperationException() - + child = folder.create_folder(os.path.basename(path)) self.cache[path] = child @@ -288,16 +290,16 @@ def rename(self, old_path, new_path): elif hasattr(file_obj, 'load'): file_obj.load() else: - raiseUnsupportedOperationException() + raiseUnsupportedOperationException() return - + new_name = os.path.basename(new_path) if fileutils.is_dirpath(old_path): folder = self.cache[old_path] folder.rename(new_name) self.cache[new_path] = folder del self.cache[old_path] - else: + else: file_obj = self.get_file(old_path) file_obj.rename(new_name) @@ -324,18 +326,20 @@ def unlink(self, path): os.remove(_create_cache_path(path)) except OSError: # file not cached - pass - + pass + self.get_parent(path).refresh() def init_sampler(self, sampler): - self.root = FSRoot(sampler) + self.fs_root = FSRoot(sampler) self.sampler = sampler - self.cache = { '/': self.root } + self.cache = { '/': self.fs_root } AksyFile.set_sampler(sampler) + def raiseUnsupportedOperationException(): raiseException(errno.ENOSYS) + def raiseException(err): raise OSError(err, 'Exception occurred') diff --git a/src/aksyfs/ftpd.py b/src/aksyfs/ftpd.py index 807d979..673b27b 100644 --- a/src/aksyfs/ftpd.py +++ b/src/aksyfs/ftpd.py @@ -171,6 +171,7 @@ def format_list(self, basedir, listing): basename)) return ''.join(result) + def main(): parser = create_option_parser(usage='%prog [options]') parser.add_option("--ftp_host", nargs=1, dest="ftp_host", diff --git a/src/tests/aksyfs/tests/test_ftpd.py b/src/tests/aksyfs/tests/test_ftpd.py index b8b2266..c246d48 100644 --- a/src/tests/aksyfs/tests/test_ftpd.py +++ b/src/tests/aksyfs/tests/test_ftpd.py @@ -105,18 +105,18 @@ def test_read(self): f = self.fs.open('/memory/Sample100.wav', 'rb') try: read = f.read(4) - self.assertEqual('RIFF', read) + self.assertEqual(b'RIFF', read) finally: f.close() def test_mknod_write(self): path = '/memory/Sample100.wav' f = self.fs.open('/memory/Sample100.wav', 'wb') - f.write('abc') + f.write(b'abc') f.close() written = os.open(common._create_cache_path(path), os.O_RDONLY) try: - self.assertEqual('abc', os.read(written, 3)) + self.assertEqual(b'abc', os.read(written, 3)) finally: os.close(written) @@ -143,10 +143,8 @@ def test_remove(self): self.fs.getattr(path) self.fs.remove(path) self.assertRaises(OSError, self.fs.getattr, path) - -def test_suite(): - # TODO re-implement / reconsider FUSE for Windows - return None + +def test_suite(): testloader = TestLoader() return testloader.loadTestsFromName('tests.aksyfs.tests.test_ftpd') From f19f974f5fb0817e6719319058db1c2ae83c41b8 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 10:29:03 +0200 Subject: [PATCH 31/66] #6 fix exception message and make it more helpful --- src/aksy/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aksy/device.py b/src/aksy/device.py index 8062c42..971a31a 100644 --- a/src/aksy/device.py +++ b/src/aksy/device.py @@ -25,5 +25,5 @@ def get_instance(device_id, connector_type='usb', *args, **kwargs): raise Exception("Unknown connector type ", connector_type) return _devices[device_id](connector, *args, **kwargs) except KeyError as e: - raise Exception("Device %s not found" % e[0]) + raise Exception(f"Device {device_id} not found among {_devices.keys()}") From 404e4f0a9337ed3f15999272c33aa74b23d868ca Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 12:19:30 +0200 Subject: [PATCH 32/66] #6 some fixes to allow FTP server to be started; FS not yet compatible --- src/aksyfs/ftpd.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/aksyfs/ftpd.py b/src/aksyfs/ftpd.py index 673b27b..75575c2 100644 --- a/src/aksyfs/ftpd.py +++ b/src/aksyfs/ftpd.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +import tempfile + from pyftpdlib import filesystems from pyftpdlib.handlers import FTPHandler @@ -18,7 +20,7 @@ class AksyFtpFS(common.AksyFS, filesystems.AbstractedFS): - def __call__(self): + def __call__(self, home, handler): return AksyFtpFS(self.sampler) def __init__(self, sampler): @@ -182,7 +184,8 @@ def main(): options = parser.parse_args()[0] authorizer = DummyAuthorizer() - authorizer.add_anonymous('/', perm=('r', 'w')) + jail_dir = tempfile.mkdtemp() + authorizer.add_anonymous(jail_dir, perm=('elradfmwMT')) address = (options.ftp_host, options.ftp_port) if options.ftp_host != 'localhost': From 2937ef4dd6d334cd5be9d3487e05e2cdf57a10ad Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 12:19:44 +0200 Subject: [PATCH 33/66] #6 some fixes to allow FTP server to be started; FS not yet compatible --- src/aksyfs/common.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/aksyfs/common.py b/src/aksyfs/common.py index fa467ee..04b3bc1 100644 --- a/src/aksyfs/common.py +++ b/src/aksyfs/common.py @@ -20,6 +20,7 @@ LOG = logging.getLogger('aksy.aksyfs.common') + class StatInfo(object): @staticmethod def set_owner(uid, gid): @@ -48,6 +49,7 @@ def __init__(self, writable=False, child_count=1): StatInfo.__init__(self, stat.S_IFDIR|stat.S_IEXEC, 4096) self.st_nlink = child_count + class FileStatInfo(StatInfo): def __init__(self, path, size, writable=False): if size is None: @@ -55,15 +57,19 @@ def __init__(self, path, size, writable=False): StatInfo.__init__(self, stat.S_IFREG|stat.S_IWUSR, size, writable) self.st_nlink = 0 + def is_modified(stat_info): return stat_info.st_mtime > START_TIME + def _splitpath(path): return path.split('/', 2)[1:] + def _get_cache_path(path): return os.path.join(os.path.expanduser('~'), '.aksy/cache' + path) + def get_file_size(path): cache_path = _get_cache_path(path) if os.path.exists(cache_path): @@ -74,9 +80,11 @@ def get_file_size(path): return MAX_FILE_SIZE_OTHER + def _cache_path_exists(path): return os.path.exists(_get_cache_path(path)) + def _create_cache_path(path): cache_path = _get_cache_path(path) parent_dir = os.path.dirname(cache_path) @@ -84,6 +92,7 @@ def _create_cache_path(path): os.makedirs(parent_dir) return cache_path + class AksyFile(object): @staticmethod def set_sampler(sampler): @@ -333,7 +342,7 @@ def unlink(self, path): def init_sampler(self, sampler): self.fs_root = FSRoot(sampler) self.sampler = sampler - self.cache = { '/': self.fs_root } + self.cache = { '.': self.fs_root } AksyFile.set_sampler(sampler) From 25ca238eee1053c3f43acc0ea8e0531a99ab70aa Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 17:34:35 +0200 Subject: [PATCH 34/66] #6 fix ftp tests --- src/aksyfs/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aksyfs/common.py b/src/aksyfs/common.py index 04b3bc1..aba31ea 100644 --- a/src/aksyfs/common.py +++ b/src/aksyfs/common.py @@ -342,7 +342,7 @@ def unlink(self, path): def init_sampler(self, sampler): self.fs_root = FSRoot(sampler) self.sampler = sampler - self.cache = { '.': self.fs_root } + self.cache = { '.': self.fs_root, '/': self.fs_root } AksyFile.set_sampler(sampler) From 71c98b4d243ed2f7b25b5b4aaeb20163e5ee6ee1 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 18:14:59 +0200 Subject: [PATCH 35/66] #6 first aksui code changes to support pygobject --- setup.py | 3 +-- src/aksui/UI/base.py | 9 +++++---- src/aksui/ak/samplerobject.py | 2 -- src/aksui/main.py | 6 ++++-- src/aksui/utils/midiutils.py | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/setup.py b/setup.py index 75ef14f..e3bf6e3 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,6 @@ from setuptools import setup from distutils.core import Extension -from distutils.dist import Distribution from distutils.command.build_ext import build_ext import platform, os.path, sys @@ -123,7 +122,7 @@ def build_extension(self, ext): extras_require = { 'FUSE-PYTHON': ["fuse-python >= 0.2pre3"], 'PYFTPDLIB' : ["pyftpdlib == 1.5.6"], - 'PYGTK' : ["pygtk"] + 'PYGTK' : ["PyGObject"] }, test_suite = "tests" ) diff --git a/src/aksui/UI/base.py b/src/aksui/UI/base.py index 58c6187..3b3dcae 100644 --- a/src/aksui/UI/base.py +++ b/src/aksui/UI/base.py @@ -1,12 +1,13 @@ -import gtk.glade +from gi.repository import Gtk +builder = Gtk.Builder() -import os.path +import gtk from pkg_resources import resource_string -glade_str = resource_string('aksui', 'ak.py.glade') +glade_str = resource_string('aksui', 'ak.py.glade').decode('utf-8') def get_glade_xml(root): - return gtk.glade.xml_new_from_buffer(glade_str, len(glade_str), root) + return builder.add_from_string(glade_str) class Base(object): def __init__(self, samplerobject, editor_root): diff --git a/src/aksui/ak/samplerobject.py b/src/aksui/ak/samplerobject.py index 504b1f1..97ddaa1 100644 --- a/src/aksui/ak/samplerobject.py +++ b/src/aksui/ak/samplerobject.py @@ -1,6 +1,4 @@ #import os,os.path,re,logging,sys,struct,math,traceback -import gtk,pygtk,gobject -import aksy import aksui.utils diff --git a/src/aksui/main.py b/src/aksui/main.py index 357ecd0..85e03c7 100644 --- a/src/aksui/main.py +++ b/src/aksui/main.py @@ -29,8 +29,10 @@ import traceback, _thread, os.path -import pygtk -pygtk.require('2.0') +from gi import pygtkcompat +pygtkcompat.enable() +pygtkcompat.enable_gtk(version='3.0') + import gtk # our stuff diff --git a/src/aksui/utils/midiutils.py b/src/aksui/utils/midiutils.py index 7350e27..beac7f3 100644 --- a/src/aksui/utils/midiutils.py +++ b/src/aksui/utils/midiutils.py @@ -1,12 +1,12 @@ from . import modelutils # list of mpc pad -> notes, left -> right = 1 -> 16 -mpcpads = [ +mpcpads = [str(note) for note in [ 37,36,42,82,40,38,46,44,48,47,45,43,49,55,51,53, # a 54,69,81,80,65,66,76,77,56,62,63,64,73,74,71,39, # b 52,57,58,59,60,61,67,68,70,72,75,78,79,35,41,50, # c 83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98 # d - ] + ]] mpc_banks_gm = [ 49,55,51,53, @@ -60,7 +60,7 @@ n = note + ' ' + str(oct) else: n = note + str(oct) - midinotes[i] = n + midinotes[str(i)] = str(n) i = i + 1 mpcpadsmodel = modelutils.get_model_from_list(mpcpads) From c7ae700a49f1a2b2c216f14067667ea73a0454f7 Mon Sep 17 00:00:00 2001 From: walco Date: Sat, 25 Jun 2022 22:24:26 +0200 Subject: [PATCH 36/66] # 6 convert UI definitions to Glade 3 / GtkBuilder --- src/aksui/ak.py.glade | 4207 ++++++++++++++++++++++++----------------- 1 file changed, 2489 insertions(+), 1718 deletions(-) diff --git a/src/aksui/ak.py.glade b/src/aksui/ak.py.glade index 8632124..1046224 100644 --- a/src/aksui/ak.py.glade +++ b/src/aksui/ak.py.glade @@ -1,140 +1,1438 @@ - - + - - + + + 0 + -9999 + 9999 + 1 + 10 + 10 + + + 3 + 0 + 64 + 1 + 10 + 10 + + + 0 + 0 + 129 + 1 + 10 + 10 + + + 1 + 1 + 127 + 0 + 0 + 0 + + + 127 + 1 + 127 + 0 + 0 + 0 + + + 1 + 1 + 64 + 0 + 0 + 0 + + + 1858 + -3600 + 3600 + 0 + 0 + 0 + + + 0 + -600 + 60 + 0 + 0 + 0 + + + 0 + -600 + 60 + 0 + 0 + 0 + + + 0 + 0 + 100 + 0 + 0 + 0 + + + 0 + 0 + 100 + 0 + 0 + 0 + + + 0 + 0 + 127 + 1 + 10 + 10 + + + 0 + 0 + 100 + 0 + 0 + 0 + + + 0 + -12 + 12 + 0 + 0 + 0 + + + 0 + 0 + 100 + 0 + 0 + 0 + + + 0 + 0 + 100 + 0 + 0 + 0 + + + 0 + 0 + 100 + 0 + 0 + 0 + + + 0 + 0 + 128 + 1 + 10 + 10 + + + 1 + 1 + 64 + 0 + 0 + 0 + + + 0 + -600 + 60 + 1 + 0 + 0 + + + 0 + -3600 + 3600 + 0 + 0 + 0 + + + 0 + -36 + 36 + 1 + 0 + 0 + + + 127 + 0 + 127 + 1 + 10 + 10 + + + 1 + 1 + 127 + 1 + 10 + 10 + + + -40 + -63 + 0 + 1 + 10 + 10 + + + 1 + 0 + 100 + 1 + 10 + 10 + + + 0 + -3600 + 3600 + 0 + 0 + 0 + + + 0 + -100 + 100 + 0 + 0 + 0 + + + 50 + 0 + 100 + 0 + 0 + 0 + + + 0 + -600 + 60 + 0 + 0 + 0 + + + 100 + 0 + 100 + 1 + 0 + 0 + + + 0 + 0 + 64 + 1 + 0 + 0 + + + + + + + + Single + + + All + + + Add + + + + + + + + + + Lin + + + Exp + + + Log + + + + + + + + + + Note On + + + Note Off + + + + + + + + + + Portamento + + + Glissando + + + + + + + + + + Time + + + Rate + + + + + + + + + + Off + + + Pitch + + + Loop + + + + + + + + + + Channel + + + Poly + + + + + + + + + + Normal + + + Held + + + + + + + + + + Keygroup + + + Drum + + + + + + + + + + Lin + + + Exp + + + Log + + + + + + + + + + Quietest + + + Oldest + + + + + + + + + + 0 + + + + + + + + + + None + + + + + + + + + + 16-Bit + + + 24-Bit + + + + + + + + + + OFF + + + AUDIO + + + MIDI + + + + + + + + + + STEREO + + + MONO L + + + MONO R + + + MONO L+R MIX + + + + + + + + + + ANALOGUE + + + DIGITAL + + + MAIN OUT + + + ADAT 1/2 + + + ADAT 3/4 + + + ADAT 5/6 + + + ADAT 7/8 + + + + + + + + + + Chromatic + + + Drum + + + + + + + + + + Keygroup + + + Drum + + + + + + + + + + Chromatic + + + GM Drum Map + + + Span Keyboard (0-127) + + + + + + + + + + + + + + + + + + + + No Loop + + + 1 Shot + + + LIR + + + LUR + + + LIR->Rt + + + Retrig + + + As Sample + + + + + + + + + + Off + + + On + + + + + + + + + + Multi + + + L-R + + + 1-2 + + + 3-4 + + + 5-6 + + + 7-8 + + + L + + + R + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + 8 + + + + + + + + + + Off + + + 2-Pole LP + + + 2-Pole LP+ + + + 4-Pole LP + + + 4-Pole LP+ + + + 6-Pole LP + + + 2-Pole BP + + + 2-Pole BP+ + + + 4-Pole BP + + + 4-Pole BP+ + + + 6-Pole BP + + + 1-Pole HP + + + 1-Pole HP+ + + + 2-Pole HP + + + 2-Pole HP+ + + + 6-Pole HP + + + LO<>HI + + + LO<>BAND + + + BAND<>HI + + + Notch 1 + + + Notch 2 + + + Notch 3 + + + Wide Notch + + + Bi-Notch + + + Peak 1 + + + Peak 2 + + + Peak 3 + + + Wide Peak + + + Bi-Peak + + + Phaser 1 + + + Phaser 2 + + + Bi-Phase + + + Voweliser + + + Triple + + + + + + + + + + 0db + + + 6db + + + 12db + + + 18db + + + 24db + + + 30db + + + + + + + + + + Off + + + A + + + B + + + C + + + D + + + AB + + + CD + + + Multi + + + + + + + + + + Off + + + Velocity + + + Real-Time + + + + + + + + + _File + menuitem8 + + + + + gtk-new + new1 + + + + + + gtk-open + open2 + + + + + + gtk-save + save2 + + + + + + gtk-save-as + save_as2 + + + + + + gtk-quit + quit2 + + + + + + _Edit + menuitem9 + + + + + gtk-cut + cut2 + + + + + + gtk-copy + copy2 + + + + + + gtk-paste + paste2 + + + + + + gtk-delete + delete2 + + + + + + _View + menuitem10 + + + + + _Help + menuitem11 + + + + + _About + about2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + _File + menuitem4 + + + + + gtk-new + New _Program... + new_program + + + + + + gtk-new + New _Multi... + new_multi + + + + + + gtk-open + _Upload... + upload1 + + + + + + gtk-save + _Save All... + save + + + + + + gtk-quit + quit1 + + + + + + _Edit + edit_menu + + + + + gtk-cut + cut1 + + + + + + gtk-copy + copy1 + + + + + + gtk-paste + paste1 + + + + + + gtk-delete + delete1 + + + + + + _View + view2 + + + + + _LCD (Test) + lcditem + + + + + + _Recording (Test)... + recording1 + + + + + + _Help + help_menu + + + + + _About + about + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gtk-new + New _Program... + new_program2 + + + + + + gtk-copy + Duplicate + duplicate_program + + + + + + gtk-go-down + Download + download_multi2 + + + + + gtk-delete + delete_program + + + + + + Dump Modulation Matrix (Debug) + menuitemMatrix + + + + + + Fix Recycled + recycleInit + + + + + + Properties... + programProperties + + + + + + S_et as Current Program + set_current_program + + + + + + Keygroup Editor v2 + kgEditorB + + + + + + Add _Keygroup(s)... + add_keygroup + + + + + + gtk-new + New Multi... + new_multi + + + + + + + + + + + + + + + + + + + + + + + + + + + gtk-new + New Program... + new_program + + + + + + gtk-delete + delete_sample + + + + + + gtk-go-down + Download + download + + + + + + _Slice + slice + + + + + + + + + + + + + + + + + + + + gtk-delete + delete_multi + + + + + + gtk-go-down + Download + download_multi + + + + + + gtk-copy + Duplicate + duplicate_multi + + + + + + FX Editor + multfx_editor + + + + + + gtk-new + New _Multi... + new_multi2 + + + + + + + + + + + + + + + + GTK_WINDOW_POPUP Program Editor - + True - + True True False - + True - + True True GTK_POLICY_NEVER GTK_POLICY_AUTOMATIC - + True GTK_SHADOW_NONE - + - + - + - - + + True Details - + - tab False - + True - + True 2 8 - + True - Single -All -Add - + model1 + + + + 0 + + + - + True - 0 - - + model2 + + + + 0 + + + 1 - + False - + True True GTK_POLICY_NEVER GTK_POLICY_NEVER - + True GTK_SHADOW_NONE - + - + 1 - - - 1 - + - - + + True Keygroups - + - tab 1 False - + True True - + True True - + - - - 2 - + - - + + True Keygroup Ranges - + - tab 2 False @@ -142,39 +1440,38 @@ Add - - + + True MPC Pad Editor - + - tab 3 False - + - + True - + False False 1 - + - - + + 203 300 2 ZoneWindow - + 206 True 1 @@ -183,434 +1480,426 @@ Add 1 1 - + True 0 1 - + - - + + - + True 0 Level - + 1 2 - - + + - + True 0 Pan - + 2 3 - - + + - + True 0 Filter - + 3 4 - - + + - + True 0 Start - + 4 5 - - + + - + True 0 Tune - + 5 6 - - + + - + True 0 Pitch - + 6 7 - - + + - + True 0 Playback - + 7 8 - - + + - + True 0 Low Vel. - + 8 9 - - + + - + True 0 Hi Vel. - + 9 10 - - + + - + True 0 Output - + 10 11 - - + + - + True True - 0 -9999 9999 1 10 10 + adjustment1 1 - + 1 2 4 5 - + - + True - No Loop -1 Shot -LIR -LUR -LIR->Rt -Retrig -As Sample - + model3 + + + + 0 + + + 1 2 7 8 - - + + - + True - Off -On - + model4 + + + + 0 + + + 1 2 6 7 - - + + - + True True - 0 0 127 1 10 10 + adjustment2 1 - + 1 2 8 9 - - + + - + True True - 127 0 127 1 10 10 + adjustment3 1 - + 1 2 9 10 - - + + - + True - Multi -L-R -1-2 -3-4 -5-6 -7-8 -L -R -1 -2 -3 -4 -5 -6 -7 -8 - + model5 + + + + 0 + + + 1 2 10 11 - - + + - + 100 True True - 0 -3600 3600 0 0 0 + adjustment4 0 False - + 1 2 5 6 - - + + - + 100 True True - 0 -100 100 0 0 0 + adjustment5 0 False - + 1 2 3 4 - - + + - + 100 True True - 50 0 100 0 0 0 + adjustment6 0 False - + 1 2 2 3 - - + + - + 100 True True - 0 -600 60 0 0 0 + adjustment7 0 False - + 1 2 1 2 - - + + - + True 2 2 True - + True True Mute True - 0 - + False - + True True Solo True - 0 - + False 1 - + 1 2 11 12 - - + + - + True 0 M/S - + 11 12 - - + + - + True - + True - - + - + True gtk-open True - 0 - + False 1 - + 1 2 - - + + - + - - + + Filter - + True 2 4 @@ -622,175 +1911,147 @@ R - + True 0 Cutoff - + - - + + - + True 0 Resonance - + 1 2 - - + + - + True 0 Filter Type - + 2 3 - - + + - + True - Off -2-Pole LP -2-Pole LP+ -4-Pole LP -4-Pole LP+ -6-Pole LP -2-Pole BP -2-Pole BP+ -4-Pole BP -4-Pole BP+ -6-Pole BP -1-Pole HP -1-Pole HP+ -2-Pole HP -2-Pole HP+ -6-Pole HP -LO<>HI -LO<>BAND -BAND<>HI -Notch 1 -Notch 2 -Notch 3 -Wide Notch -Bi-Notch -Peak 1 -Peak 2 -Peak 3 -Wide Peak -Bi-Peak -Phaser 1 -Phaser 2 -Bi-Phase -Voweliser -Triple - + model6 + + + + 0 + + + 1 2 2 3 - + - + True True - 100 0 100 1 0 0 + adjustment8 0 False - + 1 2 - - + + - + True True - 0 0 64 1 0 0 + adjustment9 0 False - + 1 2 1 2 - - + + - + True 0 Attenuation - + 3 4 - - + + - + True - 0db -6db -12db -18db -24db -30db - + model7 + + + + 0 + + + 1 2 3 4 - - + + - + True MOD True - 0 - + 2 3 - + True MOD True - 0 - + 2 3 @@ -798,513 +2059,512 @@ Triple 2 - + - - + + 2 Keygroup Editor - + True 12 2 - + True 0 Low Note - + - - + + - + True 0 High Note - + 1 2 - - + + - + True 0 Mute Group - + 2 3 - - + + - + True True - 3 0 64 1 10 10 + adjustment10 1 - + 1 2 2 3 - + - + True 0 FX Override - + 3 4 - - + + - + True - Off -A -B -C -D -AB -CD -Multi - + model8 + + + + 0 + + + 1 2 3 4 - - + + - + True 0 FX Send Level - + 4 5 - - + + - + True 0 Zone Crossfade - + 5 6 - - + + - + True - Off -Velocity -Real-Time - + model9 + + + + 0 + + + 1 2 5 6 - - + + - + True 0 Crossfade Type - + 6 7 - - + + - + True - Lin -Exp -Log - + model10 + + + + 0 + + + 1 2 6 7 - - + + - + True 0 Polyphony - + 7 8 - - + + - + True 0 Tune - + 8 9 - - + + - + True 0 Level - + 9 10 - - + + - + True 0 Trigger - + 10 11 - - + + - + True - Note On -Note Off - + model11 + + + + 0 + + + 1 2 10 11 - - + + - + True 0 Play Trigger Vel - + 11 12 - - + + - + True True - 0 0 129 1 10 10 + adjustment11 1 - + 1 2 11 12 - + - + True True - 1 1 127 0 0 0 + adjustment12 0 False - + 1 2 - - + + - + True True - 127 1 127 0 0 0 + adjustment13 0 False - + 1 2 1 2 - - + + - + True True - 1 1 64 0 0 0 + adjustment14 0 False - + 1 2 7 8 - - + + - + True True - 1858 -3600 3600 0 0 0 + adjustment15 0 False - + 1 2 8 9 - - + + - + True True - 0 -600 60 0 0 0 + adjustment16 0 False - + 1 2 9 10 - - + + - + True True - 0 -600 60 0 0 0 + adjustment17 0 False - + 1 2 4 5 - - + + - + - - + + Keygroup Editor - + True True False True - + True False GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC - + True GTK_SHADOW_NONE - + True 2 - + True True - - + + True Main - - - label_item - + - + False - + True True - - + + True Filter - - - label_item - + - + False 1 - + True - - + + True LFO - - - label_item - + - + False 2 - + True True - - + + True Modulation Matrix - - - label_item - + - + False 3 - + - + - + - - + + True Global - + - tab False - + True 1 4 @@ -1320,1040 +2580,928 @@ Note Off - - - 1 - + - - + + True Zones - + - tab 1 False - + - - + + 400 400 2 Program Details - + True False GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC - + True - + True GTK_RESIZE_IMMEDIATE 5 2 - + True True - + True 4 5 2 True - + True 0 Porta/Gliss - + - - + + - + True 0 Glissando Mode - + 1 2 - - + + - + True 0 Porta/Gliss Mode - + 2 3 - - + + - + True 0 Porta/Gliss Time - + 3 4 - - + + - + True True Enabled True - 0 - + 1 2 GTK_FILL - + - + True - Portamento -Glissando - + model12 + + + + 0 + + + 1 2 1 2 - + - + True - Time -Rate - + model13 + + + + 0 + + + 1 2 2 3 GTK_FILL - + - + True True - 0 0 100 0 0 0 + adjustment18 0 False - + 1 2 3 4 GTK_FILL - + - + True 0 Legato - + 4 5 - - + + - + True - Off -Pitch -Loop - + model14 + + + + 0 + + + 1 2 4 5 GTK_FILL - + - + - - + + True Portamento GTK_JUSTIFY_RIGHT - - - label_item - + - + 2 1 2 - + - + True True - + True 4 5 2 True - + True 0 Aftertouch Mode - + - - + + - + True 0 Pitchbend Up - + 1 2 - - + + - + True 0 Pitchbend Down - + 2 3 - - + + - + True 0 Aftertouch -> PB - + 3 4 - - + + - + True 0 PB Mode - + 4 5 - - + + - + True - Channel -Poly - + model15 + + + + 0 + + + 1 2 - + - + True True - 0 0 100 0 0 0 + adjustment19 0 False - + 1 2 1 2 GTK_FILL - + - + True True - 0 0 100 0 0 0 + adjustment20 0 False - + 1 2 2 3 GTK_FILL - + - + True True - 0 -12 12 0 0 0 + adjustment21 0 False - + 1 2 3 4 GTK_FILL - + - + True - Normal -Held - + model16 + + + + 0 + + + 1 2 4 5 GTK_FILL - + - + - - + + True Pitchbend - - - label_item - + - + 2 2 3 - + - + True True - + True 4 3 2 True - + True 0 SP Loudness Reduction - + - + - + True True - 0 0 100 0 0 0 + adjustment22 0 False - + 1 2 - + - + True True - 0 0 100 0 0 0 + adjustment23 0 False - + 1 2 2 3 GTK_FILL - + - + True True - 0 0 100 0 0 0 + adjustment24 0 False - + 1 2 1 2 GTK_FILL - + - + True 0 SP Filter Close - + 2 3 - - + + - + True 0 SP Attack Stretch - + 1 2 - - + + - + - - + + True Soft Pedal - - - label_item - + - + 2 3 4 - + - + True True - + True 4 6 2 True - + True 0 Program Number - + - - + + - + True True - 0 0 128 1 10 10 + adjustment25 1 - + 1 2 - + - + True 0 Program Type - + 1 2 - - + + - + True False - Keygroup -Drum - + model17 + + + + 0 + + + 1 2 1 2 GTK_FILL - + - + True 0 Polyphony - + 2 3 - - + + - + True True - 1 1 64 0 0 0 + adjustment26 0 False - + 1 2 2 3 GTK_FILL - + - + True 0 Keygroup X-Fade - + 3 4 - - + + - + True True Keygroup X-Fade True - 0 - + 1 2 3 4 GTK_FILL - + - + True 0 X-Fade Type - + 4 5 - - + + - + True - Lin -Exp -Log - + model18 + + + + 0 + + + 1 2 4 5 GTK_FILL - + - + True 0 Reassignment Method - + 5 6 - - + + - + True - Quietest -Oldest - + model19 + + + + 0 + + + 1 2 5 6 GTK_FILL - + - + - - + + True Miscellaneous - - - label_item - + - + 2 4 5 - + - + True True - + True 4 4 2 True - + True 0 Name - + - - + + - + True True - + 1 2 - + - + True 0 Level - + 1 2 - - + + - + True True - 0 -600 60 1 0 0 + adjustment27 0 False - + 1 2 1 2 GTK_FILL - + - + True 0 Tune - + 2 3 - - + + - + True True - 0 -3600 3600 0 0 0 + adjustment28 0 False - + 1 2 2 3 GTK_FILL - + - + True 0 MIDI Transpose - + 3 4 - - + + - + True True - 0 -36 36 1 0 0 + adjustment29 0 False - + 1 2 3 4 GTK_FILL - + - + - - + + True Main - - - label_item - + - + 2 - + - + - + - + - - + + Programs - + True - + True - - - True - _File - True - - - - - True - gtk-new - True - True - - - - - - True - gtk-open - True - True - - - - - - True - gtk-save - True - True - - - - - - True - gtk-save-as - True - True - - - - - - True - - - - - True - gtk-quit - True - True - - - - - - - - - - True - _Edit - True - - - - - True - gtk-cut - True - True - - - - - - True - gtk-copy - True - True - - - - - - True - gtk-paste - True - True - - - - - - True - gtk-delete - True - True - - - - - - - - - - True - _View - True - - - - - True - _Help - True - - - - - True - _About - True - - - - - - - - + False False - + True - + True Program - + False False - + True - None - + model20 + + + + 0 + + + 1 - + True True gtk-refresh True - 0 - + False False 2 - + 1 @@ -2361,14 +3509,14 @@ Oldest - + - - + + True Envelopes - + True @@ -2379,16 +3527,16 @@ Oldest - + - - + + Record - + True - + True 17 2 @@ -2405,490 +3553,482 @@ Oldest - + True True - + 1 2 7 8 - + - + True True - 1 1 127 1 10 10 + adjustment30 1 - + 1 2 8 9 - + - + True True - -40 -63 0 1 10 10 + adjustment31 1 - + 1 2 9 10 - + - + True True - + 1 2 12 13 - + - + True True - + 1 2 3 4 - + - + True True - + 1 2 4 5 - + - + True - + True True True GTK_RELIEF_NONE - 0 - + True 0 0 - + True 2 - + True gtk-media-record - + False False - + True Arm True - + False False 1 - + - + - + - + True True True - 0 - + True 0 0 - + True 2 - + True gtk-media-record - + False False - + True Record True - + False False 1 - + - + - + 1 - + True True True - 0 - + True 0 0 - + True 2 - + True gtk-media-stop - + False False - + True Stop True - + False False 1 - + - + - + 2 - + True True True - 0 - + True 0 0 - + True 2 - + True gtk-cancel - + False False - + True Cancel True - + False False 1 - + - + - + 3 - + 2 1 2 - + - + True - + True True True - 0 - + True 0 0 - + True 2 - + True gtk-media-play - + False False - + True Play True - + False False 1 - + - + - + - + True True True - 0 - + True 0 0 - + True 2 - + True gtk-media-stop - + False False - + True Stop True - + False False 1 - + - + - + 1 - + True True True - 0 - + True 0 0 - + True 2 - + True gtk-ok - + False False - + True Keep True - + False False 1 - + - + - + 2 - + True True True - 0 - + True 0 0 - + True 2 - + True gtk-cancel - + False False - + True Delete True - + False False 1 - + - + - + 3 - + 2 2 3 - + - + True 0 Name - + 3 4 @@ -2897,11 +4037,11 @@ Oldest - + True 0 Name Seed - + 4 5 @@ -2910,11 +4050,11 @@ Oldest - + True 0 Input - + 5 6 @@ -2923,11 +4063,11 @@ Oldest - + True 0 Mode - + 6 7 @@ -2936,11 +4076,11 @@ Oldest - + True 0 Rec Time in Seconds, 0 for Manual - + 7 8 @@ -2949,11 +4089,11 @@ Oldest - + True 0 Original Pitch - + 8 9 @@ -2962,11 +4102,11 @@ Oldest - + True 0 Threshold - + 9 10 @@ -2975,11 +4115,11 @@ Oldest - + True 0 Trigger Source - + 10 11 @@ -2988,11 +4128,11 @@ Oldest - + True 0 Bit Depth - + 11 12 @@ -3001,11 +4141,11 @@ Oldest - + True 0 Pre-record time in Milliseconds - + 12 13 @@ -3014,11 +4154,11 @@ Oldest - + True 0 Maximum Record Time - + 15 16 @@ -3027,13 +4167,18 @@ Oldest - + True False - 16-Bit -24-Bit - + model21 + + + + 0 + + + 1 2 @@ -3043,13 +4188,17 @@ Oldest - + True - OFF -AUDIO -MIDI - + model22 + + + + 0 + + + 1 2 @@ -3060,14 +4209,17 @@ MIDI - + True - STEREO -MONO L -MONO R -MONO L+R MIX - + model23 + + + + 0 + + + 1 2 @@ -3078,17 +4230,17 @@ MONO L+R MIX - + True - ANALOGUE -DIGITAL -MAIN OUT -ADAT 1/2 -ADAT 3/4 -ADAT 5/6 -ADAT 7/8 - + model24 + + + + 0 + + + 1 2 @@ -3099,13 +4251,12 @@ ADAT 7/8 - + True True Auto-record True - 0 - + 1 2 @@ -3116,13 +4267,12 @@ ADAT 7/8 - + True True Auto-normalize True - 0 - + 1 2 @@ -3133,10 +4283,10 @@ ADAT 7/8 - + True True - + 1 2 @@ -3146,13 +4296,12 @@ ADAT 7/8 - + True True Monitoring True - 0 - + 1 2 @@ -3161,239 +4310,62 @@ ADAT 7/8 - + True 0.0099999997764825821 Recording Status... - + GTK_FILL GTK_FILL - + - + True - + False False 1 - + - - + + True Aksui - + 300 600 True - + True - - - True - _File - True - - - - - True - New _Program... - True - - - - True - gtk-new - 1 - - - - - - - True - New _Multi... - True - - - - True - gtk-new - 1 - - - - - - - True - _Upload... - True - - - - True - gtk-open - 1 - - - - - - - True - _Save All... - True - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK - gtk-save - - - - - - - True - - - - - True - gtk-quit - True - True - - - - - - - - - - True - _Edit - True - - - - - True - gtk-cut - True - True - - - - - - True - gtk-copy - True - True - - - - - - True - gtk-paste - True - True - - - - - - True - gtk-delete - True - True - - - - - - - - - - True - _View - True - - - - - True - _LCD (Test) - True - - - - - - True - _Recording (Test)... - True - - - - - - - - - - True - _Help - True - - - - - True - _About - True - - - - - - - - + False False - + True - + True gtk-refresh - + False - + False False @@ -3401,114 +4373,105 @@ ADAT 7/8 - + True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC - + True GTK_SHADOW_NONE - + True True False - + True True GTK_POLICY_NEVER GTK_POLICY_AUTOMATIC - + True True - + - + - - + + True Multis - + - tab False - + True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC - + True True - + - - - 1 - + - - + + True Programs - + - tab 1 False - + True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC - + True True - + - - - 2 - + - - + + True Samples - + - tab 2 False - + - + - + 2 - + 100 True False @@ -3516,33 +4479,33 @@ ADAT 7/8 GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC - + True 2 2 False GTK_WRAP_WORD False - + - + False 3 - + - - + + True MPC Pad Editor - + True True - + True 4 4 @@ -3594,20 +4557,19 @@ ADAT 7/8 - + - - + + True A - + - tab False - + True 4 4 @@ -3659,24 +4621,20 @@ ADAT 7/8 - - - 1 - + - - + + True B - + - tab 1 False - + True 4 4 @@ -3728,24 +4686,20 @@ ADAT 7/8 - - - 2 - + - - + + True C - + - tab 2 False - + True 4 4 @@ -3797,48 +4751,43 @@ ADAT 7/8 - - - 3 - + - - + + True D - + - tab 3 False - + - - + + True window3 - + True - + True - + - + True True - 0 - + True gtk-open - + - + False False @@ -3846,350 +4795,272 @@ ADAT 7/8 - + True True - 0 - + True gtk-media-play - + - + False False 2 - - - - - - - True - New _Program... - True - - - - True - gtk-new - 1 - - - - - - - True - Duplicate - True - - - - gtk-copy - - - - - - - True - Download - True - - - gtk-go-down - - - - - - - True - gtk-delete - True - True - - - - - - Dump Modulation Matrix (Debug) - True - - - - - - Fix Recycled - True - - - - - - True - Properties... - True - - - - - - S_et as Current Program - True - - - - - - True - Keygroup Editor v2 - True - - - - - - True - Add _Keygroup(s)... - True - - - - - - True - New Multi... - True - - - - True - gtk-new - 1 - - - + - - + + + + + + + + + + + + + + + Create Keygroups True GDK_WINDOW_TYPE_HINT_DIALOG - + True - + True - + True Create Keygroups on "%s" - + False False - + True - + True How Many? - + False False - + True True - 1 0 100 1 10 10 + adjustment32 1 - + 1 - + 1 - + True - Chromatic -Drum - + model25 + + + + 0 + + + False 2 - + 2 - + True GTK_BUTTONBOX_END - + True True True gtk-cancel True - -6 - + - + True True True gtk-ok True - -5 - + 1 - + False GTK_PACK_END - + - - + + cancelbutton1 + okbutton1 + + + Create Program GDK_WINDOW_TYPE_HINT_DIALOG - + True - + True 6 2 - + True 0 Samples - + 1 2 - - + + - + True 0 Program Type - + 2 3 - - + + - + True - Keygroup -Drum - + model26 + + + + 0 + + + 1 2 2 3 - + - + True 0 Assignment Method - + 3 4 - - + + - + True - Chromatic -GM Drum Map -Span Keyboard (0-127) - + model27 + + + + 0 + + + 1 2 3 4 - - + + - + True 0 Starting Note - + 4 5 - - + + - + True - - - + model28 + + + + 0 + + + 1 2 4 5 - - + + - + True True GTK_POLICY_AUTOMATIC @@ -4197,14 +5068,14 @@ Span Keyboard (0-127) True GTK_SHADOW_IN - + True True False 0 - + - + 1 2 @@ -4214,381 +5085,279 @@ Span Keyboard (0-127) - + True 0 Name - + - - + + - + True True 25 Program 1000 - + 1 2 - + - + True 0 Create Mute Groups - + 5 6 - - + + - + True True - 0 True - + 1 2 5 6 - - + + - + 2 - + True GTK_BUTTONBOX_END - + True True True gtk-cancel True - -6 - + - + True True True gtk-ok True - -5 - + 1 - + False GTK_PACK_END - + - - - - - True - New Program... - True - - - - True - gtk-new - 1 - - - - - - - True - gtk-delete - True - True - - - - - - True - Download - True - - - - True - gtk-go-down - 1 - - - - - - - True - _Slice - True - - - - - + + checkbutton_create_mute_groups + cancelbutton2 + okbutton2 + + + + + + + + + 4 - + True True - - + + True Modulation : "Program 1 / KG 1" - - - label_item - + - + - - + + Keygroup Editor GTK_WIN_POS_CENTER - + True - + True - + True - + - + False False - + True 550 - + True False GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC - + True - + - + False True - + True False GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC - + True - + - + True True - + 1 - + True - + True True - + 1 - + False 2 - + - - + + Keygroup Editor GTK_WIN_POS_CENTER - + True - + True False GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC - + True - + - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - gtk-delete - True - True - - - - - - True - Download - True - - - - gtk-go-down - - - - - - - True - Duplicate - True - - - - gtk-copy - - - - - - - True - FX Editor - True - - - - - - True - New _Multi... - True - - - - True - gtk-new - 1 - - - - - - + + Create Multi GDK_WINDOW_TYPE_HINT_DIALOG - + True - + True 2 2 - + True 0 Programs - + 1 2 - - + + - + True True GTK_POLICY_AUTOMATIC @@ -4596,14 +5365,14 @@ Span Keyboard (0-127) True GTK_SHADOW_IN - + True True False 0 - + - + 1 2 @@ -4613,70 +5382,72 @@ Span Keyboard (0-127) - + True 0 Name - + - - + + - + True True 25 New Multi - + 1 2 - + - + 2 - + True GTK_BUTTONBOX_END - + True True True gtk-cancel True - -6 - + - + True True True gtk-ok True - -5 - + 1 - + False GTK_PACK_END - + - - + + cancelbutton4 + okbutton4 + + + From 0d108d09e9066cbd36948244aaa6a21a5bda6f58 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 23:31:33 +0200 Subject: [PATCH 37/66] #6 fix GtkBuilder validation errors --- src/aksui/ak.py.glade | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/aksui/ak.py.glade b/src/aksui/ak.py.glade index 1046224..322d95a 100644 --- a/src/aksui/ak.py.glade +++ b/src/aksui/ak.py.glade @@ -1106,10 +1106,10 @@ - + gtk-new New _Program... - new_program2 + new_program3 @@ -1178,7 +1178,7 @@ - + gtk-new New Multi... new_multi @@ -1207,10 +1207,10 @@ - + gtk-new New Program... - new_program + new_program4 @@ -2393,7 +2393,7 @@ - + True True adjustment15 @@ -2412,7 +2412,7 @@ - + True True adjustment16 @@ -3168,7 +3168,7 @@ - + True True adjustment26 @@ -3318,7 +3318,7 @@ - + True True @@ -3343,7 +3343,7 @@ - + True True adjustment27 @@ -3374,7 +3374,7 @@ - + True True adjustment28 @@ -3611,7 +3611,7 @@ - + True True @@ -5283,7 +5283,7 @@ - + True From dae3ca1c453ba26f74308a0d90a986f57ead0918 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 23:49:56 +0200 Subject: [PATCH 38/66] #6 fix most glaring runtime errors - windows are shown --- src/aksui/UI/base.py | 25 +++++++++++++------------ src/aksui/UI/recorddialog.py | 4 ++-- src/aksui/main.py | 20 +++++++++++++------- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/aksui/UI/base.py b/src/aksui/UI/base.py index 3b3dcae..5ceff32 100644 --- a/src/aksui/UI/base.py +++ b/src/aksui/UI/base.py @@ -7,7 +7,7 @@ glade_str = resource_string('aksui', 'ak.py.glade').decode('utf-8') def get_glade_xml(root): - return builder.add_from_string(glade_str) + return builder.new_from_string(glade_str, -1) class Base(object): def __init__(self, samplerobject, editor_root): @@ -22,11 +22,12 @@ def __init__(self, samplerobject, editor_root): self.updating = False #print editor_root self.xml = get_glade_xml(editor_root) - self.editor = self.xml.get_widget(editor_root) + self.editor = self.xml.get_object(editor_root) self.finish_editors() def finish_editors(self): - self.xml.signal_autoconnect(self) + pass + #self.xml.signal_autoconnect(self) def update(self): if self.samplerobject: @@ -37,11 +38,11 @@ def update(self): xml = self.xml for attr in samplerobject.attrs: - combo = xml.get_widget("combo_" + attr) - entry = xml.get_widget("entry_" + attr) - spin = xml.get_widget("spin_" + attr) - toggle = xml.get_widget("toggle_" + attr) - hscale = xml.get_widget("hscale_" + attr) + combo = xml.get_object("combo_" + attr) + entry = xml.get_object("entry_" + attr) + spin = xml.get_object("spin_" + attr) + toggle = xml.get_object("toggle_" + attr) + hscale = xml.get_object("hscale_" + attr) val = getattr(samplerobject,attr) @@ -82,8 +83,8 @@ def on_param_changed(self, widget): self.samplerobject.set(attrname, int(attrval)) def pop_in(self, container_widget_name, child_widget_name): - setattr(self,container_widget_name,self.xml.get_widget(container_widget_name)) - setattr(self,child_widget_name,self.xml.get_widget(child_widget_name)) + setattr(self,container_widget_name,self.xml.get_object(container_widget_name)) + setattr(self,child_widget_name,self.xml.get_object(child_widget_name)) w = getattr(self,container_widget_name) ch = getattr(self,child_widget_name) @@ -96,7 +97,7 @@ def pop_in(self, container_widget_name, child_widget_name): w.add(ch) def get_widget(self, name): - return self.xml.get_widget(name) + return self.xml.get_object(name) def show_all(self): self.editor.show_all() @@ -107,7 +108,7 @@ def set_samplerobject(self, so): def __getattribute__(self, name): if name.startswith('w_') and not name in self.widgets: - setattr(self, name, self.xml.get_widget(name[2:])) + setattr(self, name, self.xml.get_object(name[2:])) self.widgets[name] = object.__getattribute__(self, name) return object.__getattribute__(self, name) diff --git a/src/aksui/UI/recorddialog.py b/src/aksui/UI/recorddialog.py index 2fa3aea..038ec03 100644 --- a/src/aksui/UI/recorddialog.py +++ b/src/aksui/UI/recorddialog.py @@ -13,8 +13,8 @@ class RecordDialog(base.Base): def __init__(self, record): base.Base.__init__(self, record, "windowRecording") - self.progressbar = self.xml.get_widget('progressbar_recording') - self.name = self.xml.get_widget('entry_name') + self.progressbar = self.xml.get_object('progressbar_recording') + self.name = self.xml.get_object('entry_name') self.record = record self.update() diff --git a/src/aksui/main.py b/src/aksui/main.py index 85e03c7..6088126 100644 --- a/src/aksui/main.py +++ b/src/aksui/main.py @@ -422,7 +422,8 @@ def configure_treeview(self, tv, context_menu): tv.append_column(gtk.TreeViewColumn("Name", text, text=0)) tv.get_selection().set_mode(gtk.SELECTION_MULTIPLE) tv.connect("drag_data_received", self.on_drag_data_received) - tv.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.dnd_list, gtk.gdk.ACTION_COPY) + # TODO use target item + # tv.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.dnd_list, gtk.gdk.ACTION_COPY) tv.add_events(gtk.gdk.KEY_PRESS) tv.connect("key_press_event", context_menu.handle_keyboard_event) @@ -459,14 +460,17 @@ def set_window(self, window): self.window.set_title("aksui %s" % (__version__)) self.window.connect('configure_event', self.on_configure_event) self.window.connect("drag_data_received", self.on_drag_data_received) - self.window.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.dnd_list, gtk.gdk.ACTION_COPY) + # TODO fix target + # self.window.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.dnd_list, gtk.gdk.ACTION_COPY) def log(self, text): self.w_console.get_buffer().insert_at_cursor(text + "\r\n") def rescroll(self, vadj, scroll): - vadj.set_value(vadj.upper-vadj.page_size) - scroll.set_vadjustment(vadj) + pass + # TODO: 'Adjustment' object has no attribute 'upper' + #vadj.set_value(vadj.upper-vadj.page_size) + #scroll.set_vadjustment(vadj) def move_properties_window(self): position = self.window.get_position() @@ -665,8 +669,9 @@ def on_treeview_event(self, widget, event): def add_keybinding(accel_group, widget, accel_str, signal="activate"): keyval, mods = gtk.accelerator_parse(accel_str) - widget.add_accelerator(signal, accel_group, - keyval, mods, gtk.ACCEL_VISIBLE) + # TODO fix method call + # widget.add_accelerator(signal, accel_group, + # keyval, mods, gtk.ACCEL_VISIBLE) def setup_keybindings(m, accel_group): @@ -692,7 +697,8 @@ def main(): m.set_window(win) win.show_all() # TODO: make edit menu functional - m.w_edit_menu.hide() + # TODO replace hide call + # m.w_edit_menu.hide() win.connect("delete-event", gtk.main_quit) gtk.main() From 96c84c5fd5e90b8ba67165ae6154ed0535c29d53 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 25 Jun 2022 23:56:38 +0200 Subject: [PATCH 39/66] #6 fix API incompatibility --- src/aksui/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/aksui/main.py b/src/aksui/main.py index 6088126..8503e23 100644 --- a/src/aksui/main.py +++ b/src/aksui/main.py @@ -467,10 +467,8 @@ def log(self, text): self.w_console.get_buffer().insert_at_cursor(text + "\r\n") def rescroll(self, vadj, scroll): - pass - # TODO: 'Adjustment' object has no attribute 'upper' - #vadj.set_value(vadj.upper-vadj.page_size) - #scroll.set_vadjustment(vadj) + vadj.set_value(vadj.get_upper() - vadj.get_page_size()) + scroll.set_vadjustment(vadj) def move_properties_window(self): position = self.window.get_position() From ffd2fda11e328cfcfc77da9327d52e42a18413f8 Mon Sep 17 00:00:00 2001 From: watzo Date: Thu, 30 Jun 2022 19:31:06 +0200 Subject: [PATCH 40/66] #6 first attempt at Windows build --- .circleci/config.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index db86160..675ff8d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,8 @@ orbs: # Orb commands and jobs help you with common scripting around a language/tool # so you dont have to copy and paste it everywhere. # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python - python: circleci/python@1.2 + python: circleci/python@2.0.3 + win: circleci/windows@4.1.1 # Define a job to be invoked later in a workflow. # See: https://circleci.com/docs/2.0/configuration-reference/#jobs @@ -42,10 +43,27 @@ jobs: # This assumes pytest is installed via the install-package step above command: ./scripts/runtests.py -# Invoke jobs via workflows -# See: https://circleci.com/docs/2.0/configuration-reference/#workflows + build-and-test-windows: + executor: + name: python-win/default + steps: + - checkout + - run: + name: Build and install + command: python setup.py install + - run: + name: Run tests + command: ./scripts/runtests.py + - run: + name: Download libusb + command: Invoke-WebRequest https://github.com/pbatard/libwdi/releases/download/v1.4.1/zadig-2.7.exe -OutFile zadig.exe + - run: + name: Install libusb + command: zadix.exe + + workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. + build-all: jobs: - build-and-test + - build-and-test-windows From 50fd9ada1f3f931068af2d1c71f5c2ae2d3dc45a Mon Sep 17 00:00:00 2001 From: watzo Date: Thu, 30 Jun 2022 19:33:44 +0200 Subject: [PATCH 41/66] #6 first attempt at Windows build - fix naming --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 675ff8d..1d41d7b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ orbs: # so you dont have to copy and paste it everywhere. # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python python: circleci/python@2.0.3 - win: circleci/windows@4.1.1 + python-win: circleci/windows@4.1.1 # Define a job to be invoked later in a workflow. # See: https://circleci.com/docs/2.0/configuration-reference/#jobs @@ -50,7 +50,7 @@ jobs: - checkout - run: name: Build and install - command: python setup.py install + command: python.exe setup.py install - run: name: Run tests command: ./scripts/runtests.py From a8b422d2d098bfe7b18878daaa41106fe63eb61b Mon Sep 17 00:00:00 2001 From: watzo Date: Thu, 30 Jun 2022 19:51:25 +0200 Subject: [PATCH 42/66] #6 next attempt to install libusb --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d41d7b..4c7ca47 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,18 +48,18 @@ jobs: name: python-win/default steps: - checkout + - run: + name: Get conan package manager + command: pip install conan + - run: + name: Install libusb + command: conan install libusb-compat/0.1.7@#ab6a3c9ec4ddf4ca47e0960f694498c3 -g markdown --remote conancenter. - run: name: Build and install command: python.exe setup.py install - run: name: Run tests command: ./scripts/runtests.py - - run: - name: Download libusb - command: Invoke-WebRequest https://github.com/pbatard/libwdi/releases/download/v1.4.1/zadig-2.7.exe -OutFile zadig.exe - - run: - name: Install libusb - command: zadix.exe workflows: From b4420fc91262f989196e789eb4bcc6f01f0025dc Mon Sep 17 00:00:00 2001 From: watzo Date: Thu, 30 Jun 2022 19:59:40 +0200 Subject: [PATCH 43/66] #6 next attempt to install libusb - fix conancenter reference --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c7ca47..9443ece 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,7 @@ jobs: command: pip install conan - run: name: Install libusb - command: conan install libusb-compat/0.1.7@#ab6a3c9ec4ddf4ca47e0960f694498c3 -g markdown --remote conancenter. + command: conan install libusb-compat/0.1.7@#ab6a3c9ec4ddf4ca47e0960f694498c3 -g markdown --remote conancenter - run: name: Build and install command: python.exe setup.py install From 7d73391be55073fa8b2ababe6f9714c8cf37f94f Mon Sep 17 00:00:00 2001 From: watzo Date: Thu, 30 Jun 2022 20:05:38 +0200 Subject: [PATCH 44/66] #6 next attempt to install libusb - retry with revisions --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9443ece..c61ca71 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,7 @@ jobs: command: pip install conan - run: name: Install libusb - command: conan install libusb-compat/0.1.7@#ab6a3c9ec4ddf4ca47e0960f694498c3 -g markdown --remote conancenter + command: set CONAN_REVISIONS_ENABLED=1 && conan install libusb-compat/0.1.7@#ab6a3c9ec4ddf4ca47e0960f694498c3 -g markdown --remote conancenter - run: name: Build and install command: python.exe setup.py install From 7cb034df50175132b85ffd2bb7c77302531c8f9e Mon Sep 17 00:00:00 2001 From: watzo Date: Thu, 30 Jun 2022 20:08:22 +0200 Subject: [PATCH 45/66] #6 next attempt to install libusb - retry with revisions --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c61ca71..5b95d68 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,9 @@ jobs: command: pip install conan - run: name: Install libusb - command: set CONAN_REVISIONS_ENABLED=1 && conan install libusb-compat/0.1.7@#ab6a3c9ec4ddf4ca47e0960f694498c3 -g markdown --remote conancenter + command: | + set CONAN_REVISIONS_ENABLED=1 + conan install libusb-compat/0.1.7@#ab6a3c9ec4ddf4ca47e0960f694498c3 -g markdown --remote conancenter - run: name: Build and install command: python.exe setup.py install From d2480d6bffc3167ca2e0eaf50d6a4af50839e267 Mon Sep 17 00:00:00 2001 From: watzo Date: Thu, 30 Jun 2022 20:12:34 +0200 Subject: [PATCH 46/66] #6 more attempts to install libusb - retry with revisions --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b95d68..3f44ec4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,7 +54,7 @@ jobs: - run: name: Install libusb command: | - set CONAN_REVISIONS_ENABLED=1 + $Env:CONAN_REVISIONS_ENABLED=1 conan install libusb-compat/0.1.7@#ab6a3c9ec4ddf4ca47e0960f694498c3 -g markdown --remote conancenter - run: name: Build and install From 40fd9a35c1f67ff9ad714dc57c4e58cda7211734 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 1 Jul 2022 00:09:59 +0200 Subject: [PATCH 47/66] #6 attempt to copy libraries/includes into workspace and adjust setup.py to resolve them --- .circleci/config.yml | 6 ++++-- conanfile.txt | 5 +++++ setup.py | 24 ++++++++++++------------ 3 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 conanfile.txt diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f44ec4..c50c76b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,8 +54,10 @@ jobs: - run: name: Install libusb command: | - $Env:CONAN_REVISIONS_ENABLED=1 - conan install libusb-compat/0.1.7@#ab6a3c9ec4ddf4ca47e0960f694498c3 -g markdown --remote conancenter + $Env:CONAN_REVISIONS_ENABLED=1 + + conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter + dir build/nativelibs - run: name: Build and install command: python.exe setup.py install diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..568e0bb --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,5 @@ +[requires] +libusb-compat/0.1.7@#ab6a3c9ec4ddf4ca47e0960f694498c3 + +[generators] +deploy diff --git a/setup.py b/setup.py index e3bf6e3..45abf3d 100755 --- a/setup.py +++ b/setup.py @@ -6,10 +6,11 @@ from distutils.command.build_ext import build_ext import platform, os.path, sys -version = "0.4" +version = "0.5" # macros= [("_DEBUG", 0), ("AKSY_DEBUG", "1")] -macros= [("AKSY_DEBUG", 0)] +macros= [("AKSY_DEBUG", 0), ("LIBUSB_COMPAT_EXPORT", "1")] + def install_requires(): deps = ["pyftpdlib == 1.5.6"] @@ -17,22 +18,21 @@ def install_requires(): deps.append("fuse-python >= 0.2pre3") return deps + def customize_for_platform(ext, compiler_type): ext.libraries = ["usb"] # Windows if platform.system() == "Windows": - libusb_base_dir = "C:\Program Files\LibUSB-Win32" + lib_basedir = "build/nativelibs" + libusb_base_dir = f"{lib_basedir}/libusb-compat" + libusb1_base_dir = f"{lib_basedir}/libusb" + dirent_base_dir = f"{lib_basedir}/dirent" - if compiler_type == "msvc": - ext.libraries = ["libusb"] + ext.libraries += "libusb-1.0" ext.extra_compile_args = ["/O2"] - ext.library_dirs = [os.path.join(libusb_base_dir, "lib", "msvc")] + ext.library_dirs = [os.path.join(lib_dir, "lib") for lib_dir in [libusb1_base_dir, dirent_base_dir]] - if compiler_type == "mingw32": - ext.libraries.append("mingw32") - ext.library_dirs =[os.path.join(libusb_base_dir, "lib", "gcc")] - # Unix flavours if compiler_type == "unix": libusb_base_dir = "/usr/local/libusb-1.0" @@ -41,8 +41,8 @@ def customize_for_platform(ext, compiler_type): libusb_base_dir = "/usr/local/Cellar/libusb-compat/0.1.5_1/" # ext.extra_link_args = ["-framework CoreFoundation IOKit"] - ext.library_dirs = [os.path.join(libusb_base_dir, "lib")] - ext.include_dirs = [os.path.join(libusb_base_dir, "include")] + ext.library_dirs += [os.path.join(libusb_base_dir, "lib")] + ext.include_dirs += [os.path.join(libusb_base_dir, "include")] class build_akyx(build_ext): def build_extension(self, ext): From c54547a882ef73e1abed68b68d0d9d7410a5bd81 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 1 Jul 2022 00:14:34 +0200 Subject: [PATCH 48/66] #6 include dirent headers; remove debug log --- .circleci/config.yml | 1 - setup.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c50c76b..0b43284 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,6 @@ jobs: $Env:CONAN_REVISIONS_ENABLED=1 conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter - dir build/nativelibs - run: name: Build and install command: python.exe setup.py install diff --git a/setup.py b/setup.py index 45abf3d..f5549f0 100755 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ def customize_for_platform(ext, compiler_type): ext.libraries += "libusb-1.0" ext.extra_compile_args = ["/O2"] + ext.include_dirs = [os.path.join(dirent_base_dir, "include")] ext.library_dirs = [os.path.join(lib_dir, "lib") for lib_dir in [libusb1_base_dir, dirent_base_dir]] # Unix flavours From f9f404cf27e72f5535552ceba53773a4e966e158 Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 1 Jul 2022 00:16:58 +0200 Subject: [PATCH 49/66] #6 fix windows path names --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index f5549f0..0cad163 100755 --- a/setup.py +++ b/setup.py @@ -24,10 +24,10 @@ def customize_for_platform(ext, compiler_type): # Windows if platform.system() == "Windows": - lib_basedir = "build/nativelibs" - libusb_base_dir = f"{lib_basedir}/libusb-compat" - libusb1_base_dir = f"{lib_basedir}/libusb" - dirent_base_dir = f"{lib_basedir}/dirent" + lib_basedir = "build\nativelibs" + libusb_base_dir = f"{lib_basedir}\libusb-compat" + libusb1_base_dir = f"{lib_basedir}\libusb" + dirent_base_dir = f"{lib_basedir}\dirent" ext.libraries += "libusb-1.0" ext.extra_compile_args = ["/O2"] From 469fe82cdf75c5b17c7e8c4713e367259f40eead Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 1 Jul 2022 00:22:30 +0200 Subject: [PATCH 50/66] #6 fix windows path name escapes --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 0cad163..23ddbe8 100755 --- a/setup.py +++ b/setup.py @@ -24,10 +24,10 @@ def customize_for_platform(ext, compiler_type): # Windows if platform.system() == "Windows": - lib_basedir = "build\nativelibs" - libusb_base_dir = f"{lib_basedir}\libusb-compat" - libusb1_base_dir = f"{lib_basedir}\libusb" - dirent_base_dir = f"{lib_basedir}\dirent" + lib_basedir = "build\\nativelibs" + libusb_base_dir = f"{lib_basedir}\\libusb-compat" + libusb1_base_dir = f"{lib_basedir}\\libusb" + dirent_base_dir = f"{lib_basedir}\\dirent" ext.libraries += "libusb-1.0" ext.extra_compile_args = ["/O2"] From ec2477aa408e5d80eaf89ed727817104aaefd84d Mon Sep 17 00:00:00 2001 From: watzo Date: Fri, 1 Jul 2022 00:25:57 +0200 Subject: [PATCH 51/66] #6 fix library name inclusion --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 23ddbe8..f0e3f95 100755 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ def customize_for_platform(ext, compiler_type): libusb1_base_dir = f"{lib_basedir}\\libusb" dirent_base_dir = f"{lib_basedir}\\dirent" - ext.libraries += "libusb-1.0" + ext.libraries += ["libusb-1.0"] ext.extra_compile_args = ["/O2"] ext.include_dirs = [os.path.join(dirent_base_dir, "include")] ext.library_dirs = [os.path.join(lib_dir, "lib") for lib_dir in [libusb1_base_dir, dirent_base_dir]] From 2147fc0ca6a698e92f2cf9e9ceecb7e58a688fc3 Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 2 Jul 2022 23:52:02 +0200 Subject: [PATCH 52/66] #6 build binaries for aksy-fs utility on mac and windows --- .circleci/config.yml | 53 +++++++++++++++++++++++++++++++++++------- src/aksyfs/aksyfuse.py | 2 +- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0b43284..6c17f22 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ orbs: # Define a job to be invoked later in a workflow. # See: https://circleci.com/docs/2.0/configuration-reference/#jobs jobs: - build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do! + build-and-test-linux: # These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/ # You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub # A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python @@ -49,24 +49,59 @@ jobs: steps: - checkout - run: - name: Get conan package manager - command: pip install conan + name: Get conan package manager and nuitka python compiler + command: pip install conan nuitka - run: - name: Install libusb - command: | - $Env:CONAN_REVISIONS_ENABLED=1 - - conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter + name: Install libusb + command: | + $Env:CONAN_REVISIONS_ENABLED=1 + + conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter - run: name: Build and install command: python.exe setup.py install - run: name: Run tests command: ./scripts/runtests.py + - run: + name: Package + command: python -m nuitka --standalone --onefile src/aksyfs/aksyfuse.py -output-dir build/binaries/ + - store_artifacts: + path: build/binaries + + + build-and-test-macosx: + macos: + xcode: 13.4.1 + executor: + name: python/default + steps: + - checkout + - run: + name: Get conan package manager and nuitka python compiler + command: pip install conan nuitka + - run: + name: Install libusb + command: | + export CONAN_REVISIONS_ENABLED=1 + + conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter + - run: + name: Build and install + command: python setup.py install + - run: + name: Run tests + command: ./scripts/runtests.py + - run: + name: Package + command: python -m nuitka --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir build/binaries + - store_artifacts: + path: build/binaries workflows: build-all: jobs: - - build-and-test + - build-and-test-linux - build-and-test-windows + - build-and-test-macosx diff --git a/src/aksyfs/aksyfuse.py b/src/aksyfs/aksyfuse.py index b35ca11..d12d93c 100644 --- a/src/aksyfs/aksyfuse.py +++ b/src/aksyfs/aksyfuse.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +# #!/usr/bin/python import fuse From c7db4d3751e6c8b3e33eb9989a92f925ccbe657c Mon Sep 17 00:00:00 2001 From: watzo Date: Sat, 2 Jul 2022 23:53:14 +0200 Subject: [PATCH 53/66] #6 build binaries for aksy-fs utility on mac and windows --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c17f22..d7b2d0c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,7 +74,7 @@ jobs: macos: xcode: 13.4.1 executor: - name: python/default + name: python/default steps: - checkout - run: From c5f86e20f98732f359b30f70113e8008632bbb33 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 00:02:50 +0200 Subject: [PATCH 54/66] #6 build binaries for aksy-fs utility on mac and windows - fix yaml --- .circleci/config.yml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d7b2d0c..c1fcd5d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,7 +65,7 @@ jobs: command: ./scripts/runtests.py - run: name: Package - command: python -m nuitka --standalone --onefile src/aksyfs/aksyfuse.py -output-dir build/binaries/ + command: python -m nuitka --standalone --onefile src/aksyfs/aksyfuse.py --output-dir build/binaries/ - store_artifacts: path: build/binaries @@ -76,27 +76,27 @@ jobs: executor: name: python/default steps: - - checkout - - run: - name: Get conan package manager and nuitka python compiler - command: pip install conan nuitka - - run: - name: Install libusb - command: | - export CONAN_REVISIONS_ENABLED=1 - - conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter - - run: - name: Build and install - command: python setup.py install - - run: - name: Run tests - command: ./scripts/runtests.py - - run: - name: Package - command: python -m nuitka --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir build/binaries - - store_artifacts: - path: build/binaries + - checkout + - run: + name: Get conan package manager and nuitka python compiler + command: pip install conan nuitka + - run: + name: Install libusb + command: | + export CONAN_REVISIONS_ENABLED=1 + + conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter + - run: + name: Build and install + command: python setup.py install + - run: + name: Run tests + command: ./scripts/runtests.py + - run: + name: Package + command: python -m nuitka --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir build/binaries + - store_artifacts: + path: build/binaries workflows: From 2dee291385c43199409343463307ba7174996ed1 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 00:07:26 +0200 Subject: [PATCH 55/66] #6 build binaries for aksy-fs utility on mac and windows - attempt fix schema --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c1fcd5d..0ba0ec5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,8 +73,6 @@ jobs: build-and-test-macosx: macos: xcode: 13.4.1 - executor: - name: python/default steps: - checkout - run: From 68e4570e220ee5e9a6f7fca51443870d7ec4d25e Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 00:14:54 +0200 Subject: [PATCH 56/66] #6 build binaries for aksy-fs utility on mac and windows - attempt fix schema --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0ba0ec5..eb37a1c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,6 +75,9 @@ jobs: xcode: 13.4.1 steps: - checkout + - run: + name: Install python + command: brew install python@3.9 macfuse - run: name: Get conan package manager and nuitka python compiler command: pip install conan nuitka From 6856b8029531912d86d83a2b3cc95f98f9e8cac8 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 00:16:35 +0200 Subject: [PATCH 57/66] #6 build binaries for aksy-fs utility on mac and windows - fix nuitka invocation --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eb37a1c..518b80e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,7 +65,7 @@ jobs: command: ./scripts/runtests.py - run: name: Package - command: python -m nuitka --standalone --onefile src/aksyfs/aksyfuse.py --output-dir build/binaries/ + command: python -m nuitka --standalone --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries/ - store_artifacts: path: build/binaries @@ -95,7 +95,7 @@ jobs: command: ./scripts/runtests.py - run: name: Package - command: python -m nuitka --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir build/binaries + command: python -m nuitka --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries - store_artifacts: path: build/binaries From 1cd195f43a3af962582b0b2f815bc03e7dbd4303 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 00:19:28 +0200 Subject: [PATCH 58/66] #6 build binaries for aksy-fs utility on mac and windows - fix pip/python invocation --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 518b80e..26c6eba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,11 +76,11 @@ jobs: steps: - checkout - run: - name: Install python + name: Install python and fuse dependency command: brew install python@3.9 macfuse - run: name: Get conan package manager and nuitka python compiler - command: pip install conan nuitka + command: pip3.9 install conan nuitka - run: name: Install libusb command: | @@ -89,13 +89,13 @@ jobs: conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter - run: name: Build and install - command: python setup.py install + command: python3.9 setup.py install - run: name: Run tests command: ./scripts/runtests.py - run: name: Package - command: python -m nuitka --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries + command: python3.9 -m nuitka --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries - store_artifacts: path: build/binaries From bfa6d1dfb0743a5cd824e74774769278934dd950 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 00:25:15 +0200 Subject: [PATCH 59/66] #6 build binaries for aksy-fs utility on mac and windows - fix conan --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 26c6eba..e9285da 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,8 +76,8 @@ jobs: steps: - checkout - run: - name: Install python and fuse dependency - command: brew install python@3.9 macfuse + name: Install python and libusb, fuse dependencies + command: brew install python@3.9 macfuse libusb-compat - run: name: Get conan package manager and nuitka python compiler command: pip3.9 install conan nuitka @@ -86,7 +86,7 @@ jobs: command: | export CONAN_REVISIONS_ENABLED=1 - conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter + conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter --build=libusb --build=libusb-compat - run: name: Build and install command: python3.9 setup.py install From 28463acc62dfe38ac20b55593ee440403b1342d8 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 00:28:22 +0200 Subject: [PATCH 60/66] #6 build binaries for aksy-fs utility on mac and windows - fix nuitka --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e9285da..6710773 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,7 +65,7 @@ jobs: command: ./scripts/runtests.py - run: name: Package - command: python -m nuitka --standalone --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries/ + command: python -m nuitka --assume-yes-for-downloads --standalone --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries/ - store_artifacts: path: build/binaries @@ -95,7 +95,7 @@ jobs: command: ./scripts/runtests.py - run: name: Package - command: python3.9 -m nuitka --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries + command: python3.9 -m nuitka --assume-yes-for-downloads --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries - store_artifacts: path: build/binaries From a6ba251ddece48fcc83932a47465489ff3c6ff8c Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 00:36:36 +0200 Subject: [PATCH 61/66] #6 build binaries for aksy-fs utility on mac and windows - fix fuse-python; disable conan (slow build) --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6710773..347ca5f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -77,7 +77,7 @@ jobs: - checkout - run: name: Install python and libusb, fuse dependencies - command: brew install python@3.9 macfuse libusb-compat + command: brew install python@3.9 macfuse libusb-compat pkg-config - run: name: Get conan package manager and nuitka python compiler command: pip3.9 install conan nuitka @@ -86,7 +86,7 @@ jobs: command: | export CONAN_REVISIONS_ENABLED=1 - conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter --build=libusb --build=libusb-compat + echo conan install . -g deploy --install-folder build/nativelibs/ --remote conancenter --build=libusb --build=libusb-compat - run: name: Build and install command: python3.9 setup.py install From 60ef9beed82b4d7fa90024e8d1d2349a43109df0 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 08:45:27 +0200 Subject: [PATCH 62/66] #6 fix test run on macosx --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 347ca5f..07ddef5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,7 +92,7 @@ jobs: command: python3.9 setup.py install - run: name: Run tests - command: ./scripts/runtests.py + command: python3.9 scripts/runtests.py - run: name: Package command: python3.9 -m nuitka --assume-yes-for-downloads --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries From beba035496b43433065091a405bc1921a285de43 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 18:18:53 +0200 Subject: [PATCH 63/66] #6 attempt to fix nuitka compilation on macosx; install zstandard for bundle compression --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07ddef5..86c18cd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,7 +80,7 @@ jobs: command: brew install python@3.9 macfuse libusb-compat pkg-config - run: name: Get conan package manager and nuitka python compiler - command: pip3.9 install conan nuitka + command: pip3.9 install conan nuitka zstandard - run: name: Install libusb command: | @@ -95,7 +95,7 @@ jobs: command: python3.9 scripts/runtests.py - run: name: Package - command: python3.9 -m nuitka --assume-yes-for-downloads --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries + command: python3.9 -m nuitka --no-progressbar --assume-yes-for-downloads --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries - store_artifacts: path: build/binaries From c913d5f70d96c1447d9e5b54a273ff588f87fb23 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 18:37:06 +0200 Subject: [PATCH 64/66] #6 attempt to fix nuitka compilation logging on macosx --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 86c18cd..6328c75 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,7 +95,7 @@ jobs: command: python3.9 scripts/runtests.py - run: name: Package - command: python3.9 -m nuitka --no-progressbar --assume-yes-for-downloads --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries + command: python3.9 -m nuitka --quiet --no-progressbar --assume-yes-for-downloads --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries - store_artifacts: path: build/binaries From 3b39fed5e2a9ba6054d61f3869dbf22a29fd2a79 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 22:55:37 +0200 Subject: [PATCH 65/66] #6 attempt to fix nuitka compilation logging on macosx (now an educated guess) --- .circleci/config.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6328c75..d477814 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,7 +80,7 @@ jobs: command: brew install python@3.9 macfuse libusb-compat pkg-config - run: name: Get conan package manager and nuitka python compiler - command: pip3.9 install conan nuitka zstandard + command: pip3.9 install conan nuitka zstandard ordered-set - run: name: Install libusb command: | @@ -95,10 +95,21 @@ jobs: command: python3.9 scripts/runtests.py - run: name: Package - command: python3.9 -m nuitka --quiet --no-progressbar --assume-yes-for-downloads --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries + command: python3.9 -m nuitka --no-progressbar --assume-yes-for-downloads --standalone --macos-create-app-bundle --onefile src/aksyfs/aksyfuse.py --output-dir=build/binaries - store_artifacts: path: build/binaries + publish-github-release: + require: + filters: + branches: + ignore: /.*/ + tags: + only: /^\d+\.\d+\.\d+$/ + steps: + - attach_workspace: + at: ./artifacts + workflows: build-all: From d1b6ce783ece596989a9fa5cc5758577a3117382 Mon Sep 17 00:00:00 2001 From: watzo Date: Sun, 3 Jul 2022 22:57:44 +0200 Subject: [PATCH 66/66] #6 attempt to fix nuitka compilation logging on macosx (now an educated guess) * remove inadvertent addition of release job --- .circleci/config.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d477814..d25004f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,17 +99,6 @@ jobs: - store_artifacts: path: build/binaries - publish-github-release: - require: - filters: - branches: - ignore: /.*/ - tags: - only: /^\d+\.\d+\.\d+$/ - steps: - - attach_workspace: - at: ./artifacts - workflows: build-all: