diff --git a/README.md b/README.md index 0130980..b1cd8c8 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ python3 miredis.py -link - Added verbose mode -v - Added redis subscribe events - Added Clitools program selection mode for Launchpads -- Added custom redis key event with Configuration file : miredis.json ## OSC diff --git a/libs/__pycache__/midix.cpython-38.pyc b/libs/__pycache__/midix.cpython-38.pyc index ca1a92f..0b452fc 100644 Binary files a/libs/__pycache__/midix.cpython-38.pyc and b/libs/__pycache__/midix.cpython-38.pyc differ diff --git a/libs/midix.py b/libs/midix.py index d231558..b7f1c5b 100644 --- a/libs/midix.py +++ b/libs/midix.py @@ -36,7 +36,7 @@ import os import re from collections import deque from libs import log -import json + oscIP = "127.0.0.1" oscPORT = 8000 @@ -388,14 +388,7 @@ def MidinProcess(inqueue, portname): # OSC : /midi/cc midichannel ccnumber value SendOSC("/midi/cc",[msg[0]-175-1, msg[1], msg[2]]) - #print("osc :","/midi/cc",[msg[0]-175-1, msg[1], msg[2]] ) - - - for param in conf['params']: - - if MidiChannel == param["chanIN"] and param["CC"] == msg[1]: - #print(param["name"]+"/"+ str(msg[1])+"/"+str(msg[2])) - toKeyevent(param["name"]+"/"+ str(msg[1])+"/"+str(msg[2])) + print("osc :","/midi/cc",[msg[0]-175-1, msg[1], msg[2]] ) if msg[0] == TIMING_CLOCK: @@ -1016,21 +1009,7 @@ def listdevice(number): return midiname[number] -def loadConf(): - global conf, nbparam - try: - ConFile = 'miredis.json' - f = open(ConFile,"r") - s = f.read() - conf = json.loads(s) - print("params", len(conf['params'])) - nbparam = len(conf['params']) - - print(conf) - return True - except Exception as e: - print("_loadPlaylist error when loading '{}':{}".format(ConFile,e)) def check(): diff --git a/miredis.json b/miredis.json deleted file mode 100644 index 915a4f9..0000000 --- a/miredis.json +++ /dev/null @@ -1,27 +0,0 @@ -{ -"params": [ - { - "_comment": "Laser CC, Music CC OUT ", - "name": "/velocity", - "chanIN" : 1, - "CC" : 1 - }, - { - "name": "/strength", - "chanIN" : 1, - "CC" : 3 - }, - { - "name": "/decay", - "chanIN" : 1, - "CC" : 5 - }, - { - "name": "/feedback ", - "chanIN" : 1, - "CC" : 114 - } -] - - -} \ No newline at end of file diff --git a/miredis.py b/miredis.py index fc592ea..6b7a4ca 100644 --- a/miredis.py +++ b/miredis.py @@ -75,8 +75,6 @@ import argparse import redis from libs import midix import traceback -from pathlib import Path - #myHostName = socket.gethostname() @@ -124,6 +122,8 @@ r = redis.StrictRedis(host=redisIP , port=redisPORT, db=0) midix.r = r + + def Osc(): p = r.pubsub() @@ -160,9 +160,7 @@ if __name__ == '__main__': import time midix.check() - midix.loadConf() - midix.toKey("/beats","0.0") midix.toKey("/bpm",120) @@ -177,5 +175,4 @@ if __name__ == '__main__': traceback.print_exc() #finally: -