From 07f5cfff73efffbff41f36cbf30acafa792e34c8 Mon Sep 17 00:00:00 2001 From: Sam Neurohack Date: Sun, 4 Oct 2020 19:46:45 +0200 Subject: [PATCH 1/4] New aurora defaults FXs --- LJ.conf | 42 ++++++++++++++++++++-------------------- libs3/commands.py | 28 ++++++++++++++++++++++++++- libs3/gstt.py | 4 ++-- libs3/lj23layers.py | 2 +- libs3/plugins.py | 5 ++--- plugins/aurora/anim.py | 7 ++++--- plugins/aurora/aurora.py | 16 ++++++++++----- www/LJ.js | 2 +- www/align.html | 2 +- www/auralls.html | 2 +- www/index.html | 2 +- www/simu.html | 2 +- www/trckr/trckr.html | 2 +- www/trckr/trckrcam1.html | 2 +- 14 files changed, 75 insertions(+), 43 deletions(-) diff --git a/LJ.conf b/LJ.conf index 406ea9c..0b8d797 100644 --- a/LJ.conf +++ b/LJ.conf @@ -2,7 +2,7 @@ lasernumber = 4 debug = 0 ljayserverip = 0.0.0.0 -wwwip = 192.168.2.43 +wwwip = 0.0.0.0 nozoscip = 127.0.0.1 bhoroscip = 127.0.0.1 autostart = artnet @@ -10,7 +10,7 @@ autostart = artnet [laser0] color = -1 type = DS1000 -ip = 192.168.2.44 +ip = 127.0.0.1 kpps = 25000 centerx = -393 centery = 390 @@ -23,9 +23,9 @@ swapx = -1 swapy = -1 lsteps = [ (1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)] warpdest = [[-1500., 1500.], - [ 1500., 1500.], - [ 1500.,-1500.], - [-1500.,-1500.]] + [ 1500., 1500.], + [ 1500.,-1500.], + [-1500.,-1500.]] [laser1] color = -1 @@ -43,9 +43,9 @@ swapx = -1 swapy = -1 lsteps = [ (1.0, 2),(0.25, 1), (0.75, 1), (1.0, 5)] warpdest = [[-1500., 1500.], - [ 1500., 1500.], - [ 1500.,-1500.], - [-1500.,-1500.]] + [ 1500., 1500.], + [ 1500.,-1500.], + [-1500.,-1500.]] [laser2] color = -1 @@ -54,8 +54,8 @@ ip = 192.168.2.6 kpps = 25000 centerx = 0 centery = 0 -zoomx = 79 -zoomy = 82 +zoomx = 79.0 +zoomy = 82.0 sizex = 32000 sizey = 32000 finangle = 0.2792526803190927 @@ -63,29 +63,29 @@ swapx = -1 swapy = -1 lsteps = [(1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)] warpdest = [[-1500., 1500.], - [ 1500., 1500.], - [ 1500.,-1500.], - [-1500.,-1500.]] + [ 1500., 1500.], + [ 1500.,-1500.], + [-1500.,-1500.]] [laser3] color = -1 type = LUKE400 ip = 192.168.2.4 kpps = 25000 -centerx = -3797 +centerx = 2531 centery = -1 -zoomx = 51.0 -zoomy = 48.0 +zoomx = 90.0 +zoomy = 75.0 sizex = 32000 sizey = 32000 finangle = 0.0 -swapx = -1 -swapy = -1 +swapx = 1 +swapy = 1 lsteps = [(1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)] warpdest = [[-1500., 1500.], - [ 1500., 1500.], - [ 1500.,-1500.], - [-1500.,-1500.]] + [ 1500., 1500.], + [ 1500.,-1500.], + [-1500.,-1500.]] [plugins] plugins = { diff --git a/libs3/commands.py b/libs3/commands.py index f0380d7..e551b7f 100644 --- a/libs3/commands.py +++ b/libs3/commands.py @@ -65,6 +65,8 @@ lsteps is a string like "[ (1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)]" /regen : regen webui index html page. +/plugins/start pluginame +/plugins/stop pluginame /pl/clientnumber/lasernumber value : value is the pointlist to draw as string type. For string format see code in clients directory. @@ -99,7 +101,7 @@ r = redis.StrictRedis(host=gstt.LjayServerIP , port=6379, db=0) #r = redis.StrictRedis(host=gstt.LjayServerIP , port=6379, db=0, password='-+F816Y+-') -GenericCommands = ["start","align","ljclient","scene","addest","deldest","dest","clientnumber","vcvrack","fft","mitraille","faceosc","midigen","viewgen","audiogen","noteon","cc","ljpong","ljwars","mouse","emergency","simu","status","run","nozoid","planet","live","words","ai","bank0","pose","lj","cycl","glyph","pong","maxw","custom1","square","regen","trckr","aurora","line1","ForwardUI","settings","debug","pl"] +GenericCommands = ["start","align","ljclient","scene","addest","deldest","dest","clientnumber","vcvrack","fft","mitraille","faceosc","midigen","viewgen","audiogen","noteon","cc","ljpong","ljwars","mouse","emergency","simu","status","run","nozoid","planet","live","words","ai","bank0","pose","lj","cycl","glyph","pong","maxw","custom1","square","regen","trckr","aurora","line1","ForwardUI","settings","debug","pl","plugins"] def UserOn(laser): @@ -326,6 +328,30 @@ def handler(oscpath, args): for laser in range(gstt.lasernumber): print("Back to normal for laser ", laser) UserOn(laser) + + # Plugins commands : + elif oscpath[1] == "plugins": + # /plugins/start pluginame + if oscpath[2] == "start": + print() + print("Starting plugin :",args[0]) + print() + plugins.Start(args[0]) + + # /plugins/stop pluginame + if oscpath[2] == "stop": + print() + print("Stopping plugin :",args[0]) + print() + plugins.Kill(args[0]) + + # /plugins/restart pluginame + if oscpath[2] == "restart": + print() + print("Restarting plugin :",args[0]) + print() + plugins.Restart(args[0]) + # Settings commands : elif oscpath[1] == "settings": diff --git a/libs3/gstt.py b/libs3/gstt.py index 193098d..78ec2e2 100644 --- a/libs3/gstt.py +++ b/libs3/gstt.py @@ -1,6 +1,6 @@ # coding=UTF-8 ''' - +nozoscip LJ Global state v0.8.0 @@ -34,7 +34,7 @@ xy_center = [screen_size[0]/2,screen_size[1]/2] LjayServerIP = '192.168.1.13' oscIPin = '192.168.1.15' -nozoscip = '192.168.1.15' +nozoscIP = '192.168.1.15' wwwIP = '192.168.1.15' # gstt.Laser select to what laser modifcation will occur. diff --git a/libs3/lj23layers.py b/libs3/lj23layers.py index b15570e..6c1bdff 100644 --- a/libs3/lj23layers.py +++ b/libs3/lj23layers.py @@ -987,7 +987,7 @@ def Text(message, c, layer, xpos, ypos, resize, rotx, roty, rotz): for xy in char_layer_list: char_draw.append((xy[0] + x_offset,xy[1],c)) i +=1 - #print ch,char_layer_list,char_draw + print(ch, c, xpos, ypos, resize, char_draw) rPolyLineOneColor(char_draw, c, layer , False, xpos, ypos, resize, rotx, roty, rotz) #dots.append(char_draw) diff --git a/libs3/plugins.py b/libs3/plugins.py index 4627d19..7ef4dfa 100644 --- a/libs3/plugins.py +++ b/libs3/plugins.py @@ -182,12 +182,11 @@ def OSCsend(name, oscaddress, oscargs =''): # for each plugin will automatically add /pluginame before oscpath to send like /aurora/scim 1, if oscpath = "/scim 1" def SendAll(oscpath): - if gstt.debug > 0: - print("Sending to all plugins ", oscpath) + print("Sending to all plugins ", "/pluginame"+oscpath) for plugin in list(gstt.plugins.keys()): if gstt.debug > 0: - print("sending ",oscpath,"to", plugin) + print("sending ","/"+plugin+oscpath,"to", plugin) #sendWSall("/"+ plugin + "/start 0") Send(plugin, "/"+plugin+oscpath) diff --git a/plugins/aurora/anim.py b/plugins/aurora/anim.py index e027b41..69989d5 100644 --- a/plugins/aurora/anim.py +++ b/plugins/aurora/anim.py @@ -321,9 +321,10 @@ def Circle(LAY): def Word(LAY): - - lj.Text(LAY['word'], c = LAY['color'], layer = LAY['number'], xpos = LAY['Xcoord']+LAY['lineSize']/2, ypos = LAY['Ycoord'], resize = LAY['scale']*10, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec']) + lj.Text(LAY['word'], c = LAY['color'], layer = LAY['number'], xpos = 300, ypos = 300, resize = LAY['scale']*20, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec']) + #lj.Text(LAY['word'], c = LAY['color'], layer = LAY['number'], xpos = LAY['Xcoord'], ypos = LAY['Ycoord'], resize = LAY['scale']*10, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec']) #lj.rPolyLineOneColor([(x/2,y/2),((x+1)/2,(y+1)/2)], c = LAY['color'], layer = l, xpos = 0, ypos = 0, resize = LAY['scale'], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec']) + #lj.rPolyLineOneColor([(x/2,y/2,0),((x+1)/2,(y+1)/2,0)], c = z2color(Field['stars'][starnumber][2], LAY['color']), layer = LAY['number'], closed = False, xpos = -200, ypos = 0, resize = LAY['scale'], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec']) def Dot00(LAY): @@ -590,7 +591,7 @@ for lifes in range(0,lifenb,1): entities.append([randint(100,width-100), randint(100,height-100), random(), randint(45,16700000), randint(-2,2)]) -print("entities", entities) +#print("Butterlfy entities :", entities) wingpos = random() diff --git a/plugins/aurora/aurora.py b/plugins/aurora/aurora.py index 77cbb17..08ba000 100644 --- a/plugins/aurora/aurora.py +++ b/plugins/aurora/aurora.py @@ -179,9 +179,10 @@ print() log.infog("Aurora v0.1b") OSCinPort = 8090 - ljscene = 0 +StartFXs = ["anim.Trckr", "anim.Word","anim.Starfield","anim.Starfield"] + # Useful variables init. white = lj.rgb2int(255,255,255) red = lj.rgb2int(255,0,0) @@ -190,6 +191,8 @@ green = lj.rgb2int(0,255,0) cyan = lj.rgb2int(255,0,255) yellow = lj.rgb2int(255,255,0) +StartColors = [white, blue, green, red] + screen_size = [700,700] xy_center = [screen_size[0]/2,screen_size[1]/2] @@ -285,10 +288,10 @@ for l in range(lasernumber): Layer.append({'number': 0, 'FX': "user.User4", 'Xcoord': 45, 'Ycoord': 45, 'Zcoord': 0, - 'scandots': 64, 'scale': 45, 'color': red, "run": False, + 'scandots': 64, 'scale': 45, 'color': white, "run": False, 'intensity': 255, 'closed': False, 'lineSize': 64, 'radius': 45, 'wavefreq': 3, - 'word': "hello", + 'word': "Sonoptik", 'step': 0, 'steps': 60, 'stepmax': 60, 'stepvals': [], 'Xtransamt': 0, 'Ytransamt': 0, 'Ztransamt': 0, 'Xtranspeed': 0, 'Ytranspeed': 0, 'Ztranspeed': 0, @@ -298,10 +301,13 @@ for l in range(lasernumber): }) Layer[l]['number']= l + Layer[l]['FX'] = StartFXs[l] + Layer[l]['color'] = StartColors[l] multi = {"radius": 300 } + # # Destination : name, number, active, layer , scene, laser) # @@ -492,7 +498,7 @@ def OSChandler(path, tags, args, source): # /aurora/scim if path.find('/aurora/scim') == 0: - print("OScim sending to LJ2 /scim",int(args[0])+24) + print("OScim sending to LJ /scim",int(args[0])+24) lj.SendLJ("/scim", [int(args[0])+24]) ''' @@ -514,7 +520,7 @@ def OSCim(path, tags, args, source): newarg = path.split(" ") newlaser = args[0]+24 - print("OSim sending to LJ2 /scim",str(newlaser)) + print("OSim sending to LJ /scim",str(newlaser)) lj.SendLJ("/scim", [newlaser]) print("sending knobs value for new layer") UpdateKnobs(newlaser) diff --git a/www/LJ.js b/www/LJ.js index 6d6dee4..3720eb0 100644 --- a/www/LJ.js +++ b/www/LJ.js @@ -4,7 +4,7 @@ // LJ websocket address. IP will be updated at LJ startup according to LJ.conf wwwIP - var LJ = 'ws://192.168.2.43:9001/' + var LJ = 'ws://0.0.0.0:9001/' // diff --git a/www/align.html b/www/align.html index 3441aed..d19caff 100644 --- a/www/align.html +++ b/www/align.html @@ -658,7 +658,7 @@