Added named CC parameters and miredis.json configuration file

This commit is contained in:
sam 2021-04-09 21:25:37 +02:00
parent fc318aa5c2
commit 23d4ce6e21
4 changed files with 55 additions and 4 deletions

View file

@ -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,7 +388,14 @@ 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]] )
#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]))
if msg[0] == TIMING_CLOCK:
@ -1009,7 +1016,21 @@ 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():