Link protocol bugfixs

This commit is contained in:
sam 2020-10-06 20:07:12 +02:00
parent cc93d13e22
commit ede9b2731d
5 changed files with 93 additions and 13 deletions

View file

@ -24,7 +24,7 @@ cmake ..
cmake --build .
'''
import midix
#import midix
import sys
prevphase = 0
@ -61,7 +61,7 @@ def BeatEvent():
#print("LINK BPM:",bpm)
sys.stdout.write("Beat "+str(beats_str) + ' \r')
sys.stdout.flush()
midix.SendUI('/beats', [beats_str])
#midix.SendUI('/beats', [beats_str])
#alink.SendOSCUI('/states/cc/'+str(ccnumber), [value])
currentbeat = float(beats_str)
@ -84,7 +84,7 @@ def newtempo(tempo):
lnk.startStopSyncEnabled = True
bpm = tempo
print(("New BPM", bpm))
midix.SendUI('/bpm', [bpm])
#midix.SendUI('/bpm', [bpm])
else:
print("Link is disabled")

View file

@ -196,7 +196,7 @@ def NoteOn(note):
gstt.Laser = note -24
print("Current Laser switched to", gstt.Laser)
plugins.sendWSall("/status Laser " + str(gstt.Laser))
plugins.SendAll(["/scim", str(gstt.Laser), "1"])
plugins.SendAll(["/scim", str(gstt.Laser), 1])
def Scim(path, tags, args, source):
@ -268,9 +268,18 @@ def handler(oscpath, args):
if oscpath[1] == "pl":
print("new pl for", "/"+oscpath[1]+"/"+oscpath[2]+"/"+oscpath[3], ":", args[0])
# was r.set(oscpath, args[0])
r.set("/"+oscpath[1]+"/"+oscpath[2]+"/"+oscpath[3], args[0])
if oscpath[0] == "pl" :
r.set(oscpath, args[0])
#/scene/scenenumber/start 0 or 1
if oscpath[1] == "scene":

View file

@ -40,6 +40,9 @@ Laser objects (name and convenient group of parameters for one or several point
"Destinations" : Tell for given Layer a scene/Laser ("destination").
Each Layer can have different destination (i.e to display same stuff on different laser)
Redis :
- fromKey(keyname) Ask redis for a given key
- toKey(keyname,keyvalue) Write to redis key
OSC and plugins functions :
@ -325,6 +328,18 @@ def toRedis(n,a):
# Store encoded data in Redis
return r.set(n,encoded)
# Ask redis for a given key
def fromKey(keyname):
return r.get(keyname)
#
# Write to redis key
def toKey(keyname,keyvalue):
# Store encoded data in Redis
return r.set(keyname,keyvalue)
#
# OSC functions