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

@ -27,13 +27,15 @@ sys.path.append(ljpath +'/../libs3/')
#import from LJ
sys.path.append(ljpath +'/libs3/')
sys.path.append('../libs3')
import lj23layers as lj
import gstt
# link
currentBeat = 0.0
currentBPM = 0
screen_size = [700,700]
xy_center = [screen_size[0]/2,screen_size[1]/2]
@ -261,6 +263,17 @@ def sbilinear(samples, min, max):
#print ('linear',samparray)
return samparray
'''
lj.fromKey("/midi/cc/1/0")
Linkbeat = lj.fromKey("/beat")
if Linkbeat != currentbeat:
currentbeat = Linkbeat
Linkbpm = lj.fromKey("/bpm")
if Linkbpm != currentbpm:
currentbpm = Linkbpm
'''
#
# FXs
@ -268,9 +281,24 @@ def sbilinear(samples, min, max):
'''
Beatstep memory 2 Aurora simplex
'''
def ScanV(LAY):
ccmidi0= int(lj.fromKey("/midi/cc/1/0"))
dots = []
arr = randlinear2(LAY['scandots'],0, LAY['lineSize']*ccmidi0/100)
#arr = slinear(LAY['scandots'], LAY['lineSize'], 0)
#print(arr)
for y in arr:
#print(y, LAY['lineSize'] )
dots.append((0 + LAY['lineSize']/2, y - LAY['lineSize']/2, 0))
return dots
''' Original
def ScanV(LAY):
dots = []
@ -282,7 +310,7 @@ def ScanV(LAY):
dots.append((0 + LAY['lineSize']/2, y - LAY['lineSize']/2, 0))
return dots
'''
def ScanH(LAY):
@ -293,7 +321,27 @@ def ScanH(LAY):
#print(dots)
return dots
def Wave(LAY):
global currentBeat
currentBPM =lj.fromKey("/bpm")
LinkBeat = lj.fromKey("/beat")
# New Beat ?
if LinkBeat != currentBeat:
currentBeat = LinkBeat
dots = []
x = slinear(round(LAY['lineSize']), 0, LAY['lineSize'])
y = ssine(round(LAY['lineSize']), LAY['wavefreq'], 0)
for ww in range(round(LAY['lineSize'])):
dots.append((50+x[ww], 50+y[ww] * LAY['radius'], 0))
return dots
''' Original
def Wave(LAY):
dots = []
@ -304,7 +352,7 @@ def Wave(LAY):
dots.append((50+x[ww], 50+y[ww] * LAY['radius'], 0))
return dots
'''
def Circle(LAY):

View file

@ -149,7 +149,7 @@ import sys
import ast
import os
import time,traceback
import midix, anim, user
import midix
import log
ljpath = r'%s' % os.getcwd().replace('\\','/')
@ -207,6 +207,8 @@ viewer_distance = 2.2
inv = math.pi/2
ccmidi =[0]*15
print()
log.info('Startup...')
# print("Arguments parsing if needed...")
@ -272,6 +274,7 @@ else:
lj.Config(redisIP, ljscene, "aurora")
import anim, user
ccs =[[0] * 140] *4
@ -1118,12 +1121,17 @@ def AllFX():
# Generic generators : return dots list
else:
dots = eval(LAY['FX']+"(LAY)")
if LAY['FX'] != "Zero" or lent(dots) != 0:
#print(dots, LAY['color'])
lj.rPolyLineOneColor(dots, c = LAY['color'], layer = l, closed = LAY['closed'], xpos = LAY['Xcoord'] + LAY['stepvals'][LAY['step']] - (LAY['lineSize']/2), ypos = Layer[l]['Ycoord'], resize = LAY['scale'] * audioR, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
#print(dots, LAY['color'])
for cc in range(15):
ccmidi[cc] = int(lj.fromKey("/midi/cc/1/"+str(cc)))
#print(ccmidi)
lj.rPolyLineOneColor(dots, c = LAY['color'], layer = l, closed = LAY['closed'], xpos = LAY['Xcoord'] + LAY['stepvals'][LAY['step']] - (LAY['lineSize']/2), ypos = Layer[l]['Ycoord'], resize = LAY['scale'] * audioR, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
#lj.rPolyLineOneColor(dots, c = LAY['color'], layer = l, closed = LAY['closed'], xpos = LAY['Xcoord'] - (ccmidi[0]-64)*4 - (LAY['lineSize']/2), ypos = Layer[l]['Ycoord'] + (ccmidi[1]-64)*4, resize = LAY['scale'] * audioR * (ccmidi[2])/50, rotx = LAY['Xrotdirec']+(ccmidi[3]*3), roty = LAY['Yrotdirec']+(ccmidi[3]*3), rotz = LAY['Zrotdirec']+(ccmidi[3]*3))
else:
lj.rPolyLineOneColor((0,0,0), c = 0, layer = l, closed = LAY['closed'], xpos = LAY['Xcoord'] + LAY['stepvals'][LAY['step']] - (LAY['lineSize']/2), ypos = Layer[l]['Ycoord'], resize = LAY['scale'] * audioR, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
lj.rPolyLineOneColor((0,0,0), c = 0, layer = l, closed = LAY['closed'], xpos = LAY['Xcoord'] + LAY['stepvals'][LAY['step']] - (LAY['lineSize']/2), ypos = Layer[l]['Ycoord'], resize = LAY['scale'] * audioR, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
# OSC cc Audio reactive audioR -> size
# Animation