Commit 2b36f111 authored by smsj's avatar smsj

update images and interactive visualization

parent bbea9f53
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
No preview for this file type
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -12,7 +12,6 @@ import fractaL.core as fractal
DirIn = 'sample_data/'
DirOut = 'output/'
FileNameIn = '1880-2019.json'
......@@ -36,5 +35,5 @@ climatefile = pd.DataFrame.from_records(normalized_climate_data, columns=labels)
fractal.export_midi(normalized_climate_data, bpm=12,
fractal.export_midi(normalized_climate_data, bpm=15,
track_type='single')
......@@ -7,7 +7,7 @@ vertices, vertices2 = [[PVector() for e in range(pts+1)] for e in range(2)]
def setup():
global song, fftLin, fftLog, cam
size(1200, 800, P3D)
size(850, 700, P3D)
frameRate(1000)
smooth(8)
......@@ -17,7 +17,7 @@ def setup():
perspective(60 * DEG_TO_RAD, width/float(height), 2, 6000)
minim = Minim(this)
song = minim.loadFile("multi.mp3")
song = minim.loadFile("test_ipcc.mp3")
fftLin, fftLog = [FFT(song.bufferSize(), song.sampleRate()) for e in range(2)]
......
add_library('peasycam')
add_library('sound')
mic = None
amp = None
n_points, radius, step = 100, 250, 2
maximum = 250
minimum = 100
factor = .006
def setup():
global lines, mic, amp, n_cols, n_rows, cam, angle
size(450, 450, P3D)
frameRate(1000)
# Create an audio input and start it
mic = AudioIn(this, 0)
mic.start()
# Create a new amplitude analyzer and patch into input
amp = Amplitude(this)
amp.loadFile("test_ipcc.mp3")
cam = PeasyCam(this, 1400)
n_cols, n_rows = 500, 70
angle = radians(360) / n_cols
def draw():
background(0)
rotateZ(frameCount*PI/560)
diameter = map(amp.analyze(), 0, 1, 5, width)
terrain = [[0 for e in range(n_rows)] for f in range(n_cols+1)]
# Computing noise
for y in range(n_rows):
for x in range(n_cols+1):
terrain[x][y] = map(noise(cos(x * angle) * 3, sin(y * angle) * 3 ), 0, 1, 0, (diameter*exp(factor)))
lines = createShape()
for y in range(n_rows):
lines.beginShape(LINES)
lines.strokeWeight(0.4)
lines.stroke(124,30,155)#try to replace by lines.stroke(random(46,255))
for x in range(n_cols+1):
lx1 = cos(angle * (x-1) ) * (radius + (y*step))
ly1 = sin(angle * (x-1) ) * (radius + (y*step))
lx2 = cos(angle * x ) * (radius + (y*step))
ly2 = sin(angle * x ) * (radius + (y*step))
lines.vertex(lx1, ly1, terrain[x-1][y])
lines.vertex(lx2, ly2, terrain[x][y])
lines.endShape(CLOSE)
shape(lines)
File mode changed from 100644 to 100755
num_lines = 100
points_per_line = 100
window_buffer = 0
# noise params
noise_mag = 200
xoff = random(10000)
yoff = random(10000)
zoff = random(10000)
dxoff = 0.06 # change in xoff between vertices\
dxoff_t = 0.01 # change in xoff over time (produces scrolling)
dyoff = 0.07 # change in yoff between lines
dzoff = 0.01
noiseDetail(2, .4)
def setup():
size(800,800)
noFill()
stroke(255)
strokeWeight(3)
#noLoop()
def draw():
background(0)
y_ = getY_()
x_ = getX_()
drawLines(x_,y_)
def getY_():
inc = ceil(float(height - 2 * window_buffer) / (num_lines + 1))
y_ = []
for l in range(0, num_lines):
y_.append(window_buffer + l * inc)
return y_
def getX_():
inc = ceil(float(width - 2 * window_buffer) / (points_per_line + 1))
x_ = []
for p in range(0, points_per_line):
x_.append(window_buffer + p * inc)
return x_
def drawLines(x_, y_):
global zoff, xoff
zoff += dzoff
xoff += dxoff_t
for i, y in enumerate(y_):
## POINTS
for j, x in enumerate(x_):
n = noise(xoff + j * dxoff, yoff + i * dyoff, zoff) # perlin noise
n_tot = noise_mag * (n - 0.5) # scaled & offset noise
stroke(n*255)
strokeWeight(n*7)
point(x, y - n_tot)
# ## LINES
beginShape()
for j, x in enumerate(x_):
n = noise(xoff + j * dxoff, yoff + i * dyoff, zoff) # perlin noise
n_tot = noise_mag * (n - 0.5) # scaled & offset noise
vertex(x, y - n_tot)
endShape()
add_library('peasycam')
add_library('minim')
isPlaying, isMute = False, False
n_points = 200
radius2 = 200
step = 20
vertices, vertices2 = [[PVector() for e in range(n_points+1)] for e in range(2)]
maximum = 450
minimum = 170
factor = .006
def setup():
global song, fftLin, fftLog, cam, lines
size(900, 750, P3D)
frameRate(1000)
background(0)
smooth(8)
cam = PeasyCam(this, 1400)
cam.rotateX(-PI/2.4)
perspective(60 * DEG_TO_RAD, width/float(height), 2, 6000)
minim = Minim(this)
song = minim.loadFile("multi.mp3")
fftLin, fftLog = [FFT(song.bufferSize(), song.sampleRate()) for e in range(2)]
fftLin.linAverages(30), fftLog.logAverages(22, 3)
n_cols, n_rows = 1000, 80
angle = radians(360) / n_cols
terrain = [[0 for e in range(n_rows)] for f in range(n_cols+1)]
# Computing noise
for y in range(n_rows):
for x in range(n_cols+1):
terrain[x][y] = map(noise(cos(x * angle) * 3, sin(y * angle) * 3 ), 0, 1, 0, maximum)
lines = createShape()
for y in range(n_rows):
lines.beginShape(LINES)
lines.strokeWeight(1)
lines.stroke(250,250,250)#try to replace by lines.stroke(random(46,255))
for x in range(n_cols+1):
lx1 = cos(angle * (x-1) ) * (radius + (y*step))
ly1 = sin(angle * (x-1) ) * (radius + (y*step))
lx2 = cos(angle * x ) * (radius + (y*step))
ly2 = sin(angle * x ) * (radius + (y*step))
lines.vertex(lx1, ly1, terrain[x-1][y])
lines.vertex(lx2, ly2, terrain[x][y])
lines.endShape(CLOSE)
def draw():
background(0)
shape(lines)
noFill()
song.play() if isPlaying else song.pause()
song.mute() if isMute else song.unmute()
fftLin.forward(song.mix)
fftLog.forward(song.mix)
latheAngle = 0
for s in range(step):
angle = 0
beginShape(QUAD_STRIP)
for i, v in enumerate(vertices2):
division = 1 if s%2 == 0 else 6
steps = s*2 # select 1 freq every 2 freq (up to 256 out of 512)
c_step = (s*2)+((s%2)*2) # select 1 freq every 4 freq (up to 256 freq out of 512)
if n_points: sscale = map(fftLin.getBand(c_step)*((s+10)/10), 0, 35, .8, 35)
else: sscale = map(fftLin.getBand(steps)*((s+10)/10), 0, 30, .8, 24)
sscale = constrain(sscale, 0, 50)
vertices[i].x = radius2 + sin(radians(angle)) * radius * sscale
vertices[i].z = cos(radians(angle)) * radius * sscale
angle+=360.0/n_points
vertex(v.x, v.y, v.z)
v.x = cos(radians(latheAngle)) * vertices[i].x
v.y = sin(radians(latheAngle)) * vertices[i].x
v.z = vertices[i].z
vertex(v.x, v.y, v.z)
radius += (360.0+260)/(step*6/division) if lines else 360.0/step
endShape()
cam.beginHUD()
text("'p' = PLAY/PAUSE", 20, 30)
text("'r' = REPLAY", 20, 50)
text("'m' = MUTE", 20, 70)
text("'c' = MODE", 20, 90)
cam.endHUD()
def keyPressed():
global isPlaying, cylindrical, isMute
if key == 'p': isPlaying = not isPlaying
if key == 'm': isMute = not isMute
if key == 'c': cylindrical = not cylindrical
if key == 'r': song.rewind()
No preview for this file type
add_library('peasycam')
add_library('sound')
#add_library('minim')
n_points, radius, step = 100, 250, 2
maximum = 250
minimum = 100
factor = .006
def setup():
global lines, sample, n_cols, n_rows, cam, angle, amp
size(750, 750, P3D)
frameRate(500)
sample = SoundFile(this, "test_ipcc.mp3")
sample.loop()
amp = Amplitude(this)
amp.input(sample)
cam = PeasyCam(this, 1400)
n_cols, n_rows = 300, 70
angle = radians(360) / n_cols
def draw():
background(0)
rotateZ(frameCount*PI/560)
diameter = map(amp.analyze(), 0, 3, 30, width)
dim_2 = float(diameter)
terrain = [[0 for e in range(n_rows)] for f in range(n_cols+1)]
# Computing noise
for y in range(n_rows):
for x in range(n_cols+1):
terrain[x][y] = map(noise(cos(x * angle) * dim_2, sin(y * angle) * dim_2 ), 0, 1, 0, (diameter*exp(factor)))
lines = createShape()
for y in range(n_rows):
lines.beginShape(LINES)
lines.strokeWeight(0.4)
lines.stroke(124,30,155)#try to replace by lines.stroke(random(46,255))
for x in range(n_cols+1):
lx1 = cos(angle * (x-1) ) * (radius + (y*step))
ly1 = sin(angle * (x-1) ) * (radius + (y*step))
lx2 = cos(angle * x ) * (radius + (y*step))
ly2 = sin(angle * x ) * (radius + (y*step))
lines.vertex(lx1, ly1, terrain[x-1][y])
lines.vertex(lx2, ly2, terrain[x][y])
lines.endShape(CLOSE)
shape(lines)
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
mode=Python
mode.id=jycessing.mode.PythonMode
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
add_library('peasycam')
add_library('minim')
add_library('sound')
n_points, radius, step = 200, 350, 2
maximum = 450
minimum = 170
factor = .006
mic = none
amp = none
n_cols, n_rows = 1000, 80
angle = radians(360) / n_cols
terrain = [[0 for e in range(n_rows)] for f in range(n_cols+1)]
def setup():
global lines
global lines, mic, amp
size(900, 750, P3D)
background(0)
smooth(8)
cam = PeasyCam(this, 1400)
n_cols, n_rows = 1000, 80
angle = radians(360) / n_cols
terrain = [[0 for e in range(n_rows)] for f in range(n_cols+1)]
mic = AudioIn(this, 0)
amp = Amplitude(this)
amp.input(mic)
# Computing noise
for y in range(n_rows):
for x in range(n_cols+1):
......@@ -38,9 +46,11 @@ def setup():
lines.vertex(lx1, ly1, terrain[x-1][y])
lines.vertex(lx2, ly2, terrain[x][y])
lines.endShape(CLOSE)
def draw():
background(0)
shape(lines)
shape(lines)
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
todo 100644 → 100755
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment