Compare commits
	
		
			2 Commits
		
	
	
		
			fc318aa5c2
			...
			eb4e3ae519
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					eb4e3ae519 | ||
| 
						 | 
					23d4ce6e21 | 
@ -23,6 +23,7 @@ python3 miredis.py -link
 | 
				
			|||||||
- Added verbose mode -v
 | 
					- Added verbose mode -v
 | 
				
			||||||
- Added redis subscribe events
 | 
					- Added redis subscribe events
 | 
				
			||||||
- Added Clitools program selection mode for Launchpads
 | 
					- Added Clitools program selection mode for Launchpads
 | 
				
			||||||
 | 
					- Added custom redis key event with Configuration file : miredis.json
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## OSC
 | 
					## OSC
 | 
				
			||||||
 | 
				
			|||||||
										
											Binary file not shown.
										
									
								
							@ -36,7 +36,7 @@ import os
 | 
				
			|||||||
import re
 | 
					import re
 | 
				
			||||||
from collections import deque
 | 
					from collections import deque
 | 
				
			||||||
from libs import log
 | 
					from libs import log
 | 
				
			||||||
 | 
					import json
 | 
				
			||||||
 | 
					
 | 
				
			||||||
oscIP       = "127.0.0.1"
 | 
					oscIP       = "127.0.0.1"
 | 
				
			||||||
oscPORT     = 8000
 | 
					oscPORT     = 8000
 | 
				
			||||||
@ -388,7 +388,14 @@ def MidinProcess(inqueue, portname):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            # OSC : /midi/cc midichannel ccnumber value
 | 
					            # OSC : /midi/cc midichannel ccnumber value
 | 
				
			||||||
            SendOSC("/midi/cc",[msg[0]-175-1, msg[1], msg[2]])
 | 
					            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:
 | 
					        if msg[0] == TIMING_CLOCK:
 | 
				
			||||||
@ -1009,7 +1016,21 @@ def listdevice(number):
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	return midiname[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():
 | 
					def check():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										27
									
								
								miredis.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								miredis.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					"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
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -75,6 +75,8 @@ import argparse
 | 
				
			|||||||
import redis
 | 
					import redis
 | 
				
			||||||
from libs import midix
 | 
					from libs import midix
 | 
				
			||||||
import traceback
 | 
					import traceback
 | 
				
			||||||
 | 
					from pathlib import Path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#myHostName = socket.gethostname()
 | 
					#myHostName = socket.gethostname()
 | 
				
			||||||
@ -122,8 +124,6 @@ r = redis.StrictRedis(host=redisIP , port=redisPORT, db=0)
 | 
				
			|||||||
midix.r = r
 | 
					midix.r = r
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def Osc():
 | 
					def Osc():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    p = r.pubsub()
 | 
					    p = r.pubsub()
 | 
				
			||||||
@ -160,7 +160,9 @@ if __name__ == '__main__':
 | 
				
			|||||||
    import time
 | 
					    import time
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    midix.check()
 | 
					    midix.check()
 | 
				
			||||||
 | 
					    midix.loadConf()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    midix.toKey("/beats","0.0") 
 | 
					    midix.toKey("/beats","0.0") 
 | 
				
			||||||
    midix.toKey("/bpm",120)
 | 
					    midix.toKey("/bpm",120)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -175,4 +177,5 @@ if __name__ == '__main__':
 | 
				
			|||||||
        traceback.print_exc()
 | 
					        traceback.print_exc()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #finally:
 | 
					    #finally:
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user