diff --git a/mapping/midiPageHandler.py b/mapping/midiPageHandler.py index d17f9b5..0d33a88 100644 --- a/mapping/midiPageHandler.py +++ b/mapping/midiPageHandler.py @@ -488,9 +488,9 @@ class AkaiAPCMini(midiPageHandler): } self.listModules=[[None]*8] # Only one page and 8x8 for now - # self.pulse1=pulseController(self,IOInterface) + ########### - # For debug purposes + # For debug purposes coloring all neutral to be able to skip initialisation for j in range(5): for i in range(8): self.addStatus((j,i),"Inactive") @@ -534,10 +534,11 @@ class AkaiAPCMini(midiPageHandler): def lightnote(self,note,val=1): self.output.send(mido.Message("note_on",note=note,velocity=val)) - def receiveAction(self,action,*args,**kwargs): "Receive an action from the pulse and transmit it to the handler" dprint("ACTION TO BE HANDLED",action,args,kwargs) + # Do the changing of the light if layer press etc. + # Only hard part is knowing where _TEST=True if __name__ == '__main__': diff --git a/midiRebind.py b/midiRebind.py index f04e69d..dfa9f66 100755 --- a/midiRebind.py +++ b/midiRebind.py @@ -1,19 +1,14 @@ -#!/bin/python3 -import mido, argparse, sys +import mido, argparse, sys,os import configparser,importlib,mapping import traceback +import platform -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Listen to a midi interface for incomming messages and send messages to different midi interfaces according to a patch file') - - parser.add_argument('patch', type=str,help='The patch file, this file is mandatory') - parser.add_argument('--verbose', action='store_true',default=False,help='Make the program verbose)') - - args = parser.parse_args() - +def launchWithArgs(args): try: - path="patch/{}.ini".format(args.patch) + local=os.path.dirname(__file__) + path=os.path.join(local,"patch","{}.ini".format(args.patch)) + print(path) conf=configparser.ConfigParser() conf.read(path) interpath="mapping.{}".format(conf["interface"]["mapping"]) @@ -65,4 +60,20 @@ if __name__ == '__main__': print("[Error] Can't iterate over an empty list, check the list of inputs for an available input") print(e) traceback.print_exc() - # except: + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Listen to a midi interface for incomming messages and send messages to different midi interfaces according to a patch file') + + parser.add_argument('patch', type=str,help='The patch file, this file is mandatory') + parser.add_argument('--verbose', action='store_true',default=False,help='Make the program verbose)') + + + + if len(sys.argv)==1: + agv=[__file__,"panapulsewin"] + else: + agv=sys.argv + + args = parser.parse_args(agv[1:]) + + launchWithArgs(args) \ No newline at end of file