missing www

This commit is contained in:
Sam 2023-06-03 14:43:53 +02:00
parent 5f7c61f616
commit cfc7c70d16
131 changed files with 11126 additions and 661 deletions

View file

@ -9,7 +9,7 @@ Aurora Animations points generators
LICENCE : CC
Sam Neurohack
"ScanH", "ScanV", "Wave", "Circle", "Dot00", "Zero", "Maxwell", "Starfield", "Trckr", "Word"
"ScanH", "ScanV", "Wave", "Circle", "Dot00", "Zero", "Maxwell", "Starfield", "Trckr", "Word", "Poses"
'''
@ -29,7 +29,7 @@ sys.path.append(ljpath +'/../libs3/')
sys.path.append(ljpath +'/libs3/')
sys.path.append('../libs3')
import lj23layers as lj
import lj
import gstt
# link
@ -175,6 +175,9 @@ def ssquare(samples, freq, phase, scale = 1):
samparray[ww] = signal.square(2 * np.pi * freq * t[ww]) * scale
return samparray
def ssine(samples, freq, phase, scale = 1):
samparray = [0] * samples
@ -182,6 +185,7 @@ def ssine(samples, freq, phase, scale = 1):
for ww in range(samples):
samparray[ww] = np.sin(2 * np.pi * freq * t[ww]) * scale
return samparray
#xsteps = ssine(LAY['scandots'], Cux['freq'], Cux['phaseoffset'] + Cux['inv'], Cux['amp'])
def scos(samples, freq, phase, scale = 1):
@ -625,6 +629,124 @@ def Trckr(LAY, TrckrPts):
lj.rPolyLineOneColor(mouthfull(TrckrPts), c = LAY['color'], layer = LAY['number'], closed = False, xpos = -200 +LAY['Xcoord'], ypos = LAY['Ycoord'], resize = LAY['scale']*0.8, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
#
# Poses
#
# 0.25 : each frame will be repeated 4 times.
animspeed = 0.1
anims =[[]]*19
def preparePoses(currentPose):
lj.WebStatus("Checking anims...")
print("Init Poses...")
print("Reading available Poses anims...")
# anim format (name, xpos, ypos, resize, currentframe, totalframe, count, speed)
# 0 1 2 3 4 5 6 7
# total frames is fetched from directory by lengthPOSE()
anims[0] = ['boredhh' , -100, 30, 550, 0, 0, 0, animspeed]
anims[1] = ['belka4' , -70, 380, 680, 0, 0, 0, animspeed]
anims[2] = ['belka3' , -100, 360, 700, 0, 0, 0, animspeed]
anims[3] = ['hhhead' , -100, 300, 600, 0, 0, 0, animspeed]
anims[4] = ['hhhead2', -100, 300, 600, 0, 0, 0, animspeed]
anims[5] = ['hhhead4', -100, 280, 600, 0, 0, 0, animspeed]
anims[6] = ['hhred' , -250, 220, 550, 0, 0, 0, animspeed]
anims[7] = ['hhred2' , -200, 200, 550, 0, 0, 0, animspeed]
anims[8] = ['lady1' , -100, 300, 600, 0, 0, 0, animspeed]
anims[9] = ['lady1' , -100, 280, 600, 0, 0, 0, animspeed]
anims[10] = ['lady2' , -100, 280, 600, 0, 0, 0, animspeed]
anims[11] = ['lady3' , -100, 300, 600, 0, 0, 0, animspeed]
anims[12] = ['lady4' , -100, 300, 600, 0, 0, 0, animspeed]
anims[13] = ['mila6' , -100, 280, 600, 0, 0, 0, animspeed]
anims[14] = ['mila5' , -100, 280, 600, 0, 0, 0, animspeed]
anims[15] = ['idiotia1', -100, 300, 600, 0, 0, 0, animspeed]
anims[16] = ['idiotia1', -100, 300, 600, 0, 0, 0, animspeed]
anims[17] = ['belka4', -100, 280, 600, 0, 0, 0, animspeed]
anims[18] = ['belka3', -100, 280, 600, 0, 0, 0, animspeed]
#for laseranims in anims:
for anim in anims:
#print(anim)
anim[5] = lengthPOSE(anim[0])
lj.WebStatus("Checking "+ anim[0] +"...")
if debug > 0:
print('plugins/aurora/poses/' + anim[0], "length :", anim[5], "frames")
print("Current Poses anim is",anims[currentPose][0],"("+str(currentPose)+")")
#lj.RelativeObject('anim', True, 255, [], white, red, green, blue, 0 ,False, centerX, centerY, 1, Xrot, Yrot, Zrot)
def Poses(LAY):
anim = anims[currentPose]
#anim = anims[LAY['poses']]
#print(anim)
#dots = []
# increase current frame [4] of speed [7] frames
# print(anim[4],anim[7],anim[4]+anim[7])
# print("frame", anim[4])
anim[4] = anim[4]+anim[7]
# print("animspeed",anim[7], "newframe", anim[4], "maximum frame", anim[5] )
# compare to total frame [5]
if anim[4] >= anim[5]:
anim[4] = 0
posename = 'plugins/aurora/poses/' + anim[0] + '/' + anim[0] +'-'+str("%05d"%int(anim[4]))+'.json'
# print(posename)
posefile = open(posename , 'r')
posedatas = posefile.read()
pose_json = json.loads(posedatas)
#WebStatus("Frame : "+str("%05d"%int(anim[4])))
# Draw Face
for people in range(len(pose_json['people'])):
'''
#lj.rPolyLineOneColor(face(pose_json, people), c = white, PL = laser closed = False, xpos = anim[1], ypos = anim[2], resize = anim[3])
lj.rPolyLineOneColor(browL(pose_json, people), c = white, PL = laser, closed = False, xpos = anim[1], ypos = anim[2], resize = anim[3])
lj.rPolyLineOneColor(browR(pose_json, people), c = white, PL = laser, closed = False, xpos = anim[1], ypos = anim[2], resize = anim[3])
lj.rPolyLineOneColor(eyeR(pose_json, people), c = white, PL = laser, closed = False, xpos = anim[1], ypos = anim[2], resize = anim[3])
#lj.rPolyLineOneColor(pupR(pose_json, people), c = white, PL = laser, closed = False, xpos = anim[1], ypos = anim[2], resize = anim[3])
lj.rPolyLineOneColor(eyeL(pose_json, people), c = white, PL = laser, closed = False, xpos = anim[1], ypos = anim[2], resize = anim[3])
#lj.rPolyLineOneColor(pupL(pose_json, people), c = white, PL = laser, closed = False, xpos = anim[1], ypos = anim[2], resize = anim[3])
lj.rPolyLineOneColor(nose(pose_json, people), c = white, PL = laser, closed = False, xpos = anim[1], ypos = anim[2], resize = anim[3])
lj.rPolyLineOneColor(mouth(pose_json, people), c = white, PL = laser, closed = False, xpos = anim[1], ypos = anim[2], resize = anim[3])
'''
lj.rPolyLineOneColor(browL(pose_json, people), c = LAY['color'], layer = LAY['number'], closed = False, xpos = anim[1] +LAY['Xcoord'], ypos = LAY['Ycoord'] + anim[2], resize = anim[3], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
lj.rPolyLineOneColor(eyeL(pose_json, people), c = LAY['color'], layer = LAY['number'], closed = False, xpos = anim[1] +LAY['Xcoord'], ypos = LAY['Ycoord'] + anim[2], resize = anim[3], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
lj.rPolyLineOneColor(browR(pose_json, people), c = LAY['color'], layer = LAY['number'], closed = False, xpos = anim[1] +LAY['Xcoord'], ypos = LAY['Ycoord'] + anim[2], resize = anim[3], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
lj.rPolyLineOneColor(eyeR(pose_json, people), c = LAY['color'], layer = LAY['number'], closed = False, xpos = anim[1] +LAY['Xcoord'], ypos = LAY['Ycoord'] + anim[2], resize = anim[3], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
#lj.rPolyLineOneColor(pupL(pose_json, people), c = LAY['color'], layer = LAY['number'], closed = False, xpos = anim[1] +LAY['Xcoord'], ypos = LAY['Ycoord'] + anim[2], resize = LAY['scale']*0.8, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
#lj.rPolyLineOneColor(pupR(pose_json, people), c = LAY['color'], layer = LAY['number'], closed = False, xpos = anim[1] +LAY['Xcoord'], ypos = LAY['Ycoord'] + anim[2], resize = LAY['scale']*0.8, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
lj.rPolyLineOneColor(nose1(pose_json, people), c = LAY['color'], layer = LAY['number'], closed = False, xpos = anim[1] +LAY['Xcoord'], ypos = LAY['Ycoord'] + anim[2], resize = anim[3], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
lj.rPolyLineOneColor(nose2(pose_json, people), c = LAY['color'], layer = LAY['number'], closed = False, xpos = anim[1] +LAY['Xcoord'], ypos = LAY['Ycoord'] + anim[2], resize = anim[3], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
lj.rPolyLineOneColor(mouthfull(pose_json, people), c = LAY['color'], layer = LAY['number'], closed = False, xpos = anim[1] +LAY['Xcoord'], ypos = LAY['Ycoord'] + anim[2], resize = anim[3], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
import json
#CurrentPose = 1
# Get frame number for pose path describe in PoseDir
def lengthPOSE(pose_dir):
if debug > 0:
print("Checking directory",'plugins/aurora/poses/' + pose_dir)
if os.path.exists('plugins/aurora/poses/' + pose_dir):
numfiles = sum(1 for f in os.listdir('plugins/aurora/poses/' + pose_dir) if os.path.isfile(os.path.join('plugins/VJing/poses/' + pose_dir + '/', f)) and f[0] != '.')
if debug > 0:
print(numfiles, 'frames')
return numfiles
else:
if debug > 0:
print("but it doesn't even exist!")
return 0
#

View file

@ -172,7 +172,7 @@ if is_py2:
else:
from OSC3 import OSCServer, OSCClient, OSCMessage
import lj23layers as lj
import lj
import argparse
print()
@ -275,11 +275,12 @@ else:
lj.Config(redisIP, ljscene, "aurora")
import anim, user
#anim.
ccs =[[0] * 140] *4
# Layer FXs
FXs = ["ScanH", "ScanV", "Wave", "Circle", "Dot00", "Zero", "Maxwell", "Starfield", "Trckr", "Word"]
FXs = ["ScanH", "ScanV", "Wave", "Circle", "Dot00", "Zero", "Maxwell", "Starfield", "Trckr", "Word", "Poses"]
AllFXDisplay = [True, True, True, True]
@ -374,6 +375,14 @@ def OSChandler(path, tags, args, source):
if len(args) > 0:
pass
# OSC ui connection
if path.find("/connect") :
print("OSCUI asked by", source)
gstt.TouchOSCUI = True
gstt.TouchOSCIP= source[0]
beatstepUI()
return
#Convert from TouchOSC full text OSC style (no args)
if path.find(" ") != -1:
@ -507,6 +516,19 @@ def OSChandler(path, tags, args, source):
print("OSC default got /scim",int(args[0]))
#lj.SendLJ("/scim", [int(args[0])+24])
# /aurora/poses layer number
if path.find('/aurora/poses') == 0:
layer = int(args[0])
number = int(args[1])
#print(anim, state)
if state == 1:
print("/aurora/poses switch to",number)
Layer[layer]['poses'] = number
'''
# /aurora/color/layernumber color
def OSCcolor(path, tags, args, source):
@ -970,7 +992,7 @@ def OSCaudioL(path, tags, args, source):
# OSC Beatstep
#
beatstepfxs = ["anim.ScanH", "anim.ScanV", "anim.Wave", "anim.Circle", "anim.Starfield", "anim.Word", "anim.Trckr", "anim.ScanH"]
beatstepfxs = ["anim.ScanH", "anim.ScanV", "anim.Wave", "anim.Circle", "anim.Starfield", "anim.Word", "anim.Trckr", "anim.Poses"]
beatstepcols = ["red", "yellow", "green", "blue", "cyan", "white", "white", "white"]
def beatstepUI():
@ -1099,6 +1121,9 @@ def AllFX():
elif LAY['FX'] == "anim.Word":
anim.Word(LAY)
elif LAY['FX'] == "anim.Poses":
anim.Poses(LAY)
elif LAY['FX'] == "anim.User1":
user.User1(LAY)
@ -1187,6 +1212,9 @@ def UpdateKnobs(layernumber):
prepareStarfield()
prepareTrckr()
currentPose = 0
lj.WebStatus("Init Poses...")
anim.preparePoses(currentPose)
log.info("Starting OSC server at " + str(gstt.myIP)+ " port "+ str(OSCinPort)+ " ...")
#print("TouchOSC", gstt.TouchOSCIP)
@ -1230,7 +1258,6 @@ lj.addOSCdefaults(oscserver)
oscserver.addMsgHandler( "default", OSChandler )
#anim.prepareSTARFIELD()
beatstepUI()
#beatstep.UpdatePatch(beatstep.patchnumber)

View file

@ -145,7 +145,7 @@ if is_py2:
else:
from OSC3 import OSCServer, OSCClient, OSCMessage
import lj23layers as lj
import lj
import argparse
print ("")

View file

@ -140,22 +140,24 @@ def SendAU(oscaddress,oscargs=''):
def SendUI(oscaddress,oscargs=''):
oscmsg = OSCMessage()
oscmsg.setAddress(oscaddress)
oscmsg.append(oscargs)
if gstt.TouchOSCUI == True:
oscmsg = OSCMessage()
oscmsg.setAddress(oscaddress)
oscmsg.append(oscargs)
osclientlj = OSCClient()
osclientlj.connect((gstt.TouchOSCIP, gstt.TouchOSCPort))
#print("MIDI Aurora sending UI :", oscmsg, "to",gstt.TouchOSCIP,":",gstt.TouchOSCPort)
try:
osclientlj.sendto(oscmsg, (gstt.TouchOSCIP, gstt.TouchOSCPort))
oscmsg.clearData()
except:
log.err('Connection to Aurora UI refused : died ?')
pass
#time.sleep(0.001
osclientlj = OSCClient()
osclientlj.connect((gstt.TouchOSCIP, gstt.TouchOSCPort))
#print("MIDI Aurora sending UI :", oscmsg, "to",gstt.TouchOSCIP,":",gstt.TouchOSCPort)
try:
osclientlj.sendto(oscmsg, (gstt.TouchOSCIP, gstt.TouchOSCPort))
oscmsg.clearData()
except:
log.err('Connection to Aurora UI refused : died ?')
pass
#time.sleep(0.001)
else:
print(oscaddress,": No remote OSC connected yet")
def GetTime():
return time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())
@ -730,15 +732,15 @@ def NoteOn(note, velocity, mididest):
def listdevice(number):
return midiname[number]
return midiname[number]
def check():
OutConfig()
InConfig()

View file

@ -111,7 +111,7 @@ ljpath = r'%s' % os.getcwd().replace('\\','/')
sys.path.append('../libs3')
#sys.path.append(ljpath +'/../../libs')
import lj23layers as lj
import lj
width = 800
height = 600

View file

@ -31,7 +31,7 @@ sys.path.append(ljpath +'/../libs3/')
sys.path.append(ljpath +'/libs3/')
print(ljpath+'/../libs3/')
import lj23layers as lj
import lj
sys.path.append('../libs3')
from OSC3 import OSCServer, OSCClient, OSCMessage

View file

@ -31,7 +31,7 @@ sys.path.append(ljpath +'/../libs3/')
sys.path.append(ljpath +'/libs3/')
print(ljpath+'/../libs3/')
import lj23layers as lj
import lj
sys.path.append('../libs3')
from OSC3 import OSCServer, OSCClient, OSCMessage

View file

@ -48,7 +48,7 @@ sys.path.append('../libs3')
sys.path.append(ljpath +'/../../libs3')
from OSC3 import OSCServer, OSCClient, OSCMessage
import lj23layers as lj
import lj
import redis
import math
import time