Skip to content

Instantly share code, notes, and snippets.

@peregrinebalas
Last active April 13, 2023 23:40
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Hydra Codes
a.setScale (10)
a.setBins (6)
a.setSmooth(0.99)
a.settings[0].cutoff = 1
a.settings[1].cutoff = 2
a.settings[2].cutoff = 4
a.settings[3].cutoff = 6
a.settings[4].cutoff = 8
a.settings[5].cutoff = 9
pattern = (amount) => osc(200, 0).kaleid(200).scale(amount, amount).rotate(() => Math.round(time * 0.0001))
//
pattern(() => (Math.floor(time * a.fft[1]) * 0.1 + 0.55 ))
.scrollX(0.1, 0.01).scrollY(0.1, 0.01).rotate(() => Math.floor(Math.random() * 2))
.mult(pattern(() => (Math.floor(time * a.fft[1]) * 0.1 + 0.55 )))
.posterize([18,40,27].fast(0.5).smooth(2))
.modulate(noise(8,5))
.diff(pattern(.55))
.out()
//pattern(() => (Math.floor(time * a.fft[1]) * 0.1 + 0.55 )).blend(o0).modulateScale(o0, () => Math.round(time * a.fft[1] * 0.000000001)).out(o1)
a.setScale (10)
a.setBins (6)
a.setSmooth(0.8)
a.settings[0].cutoff = 1
a.settings[1].cutoff = 2
a.settings[2].cutoff = 4
a.settings[3].cutoff = 6
a.settings[4].cutoff = 8
a.settings[5].cutoff = 9
osc(30,0.01,0.5)
.mult(osc(20,-0.1,1).modulate(noise(3,1)).rotate(() => Math.floor(Math.random() * a.fft[(Math.floor(Math.random() * 5))])))
.posterize([13,10,2].fast(0.5).smooth(1))
.modulateRotate(o0, () => (a.fft[0] * 128 * a.fft[(Math.floor(Math.random() * 5))]) * (128 * a.fft[(Math.floor(Math.random() * 5))]) ).color(.642,.32,1.21)
.out(o0)
noise(1, .2)
.rotate(2,.5)
.layer(src(o0)
.scrollY(() => a.fft[1],() => a.fft[1])).scale(() => a.fft[1] + 0.01).diff(o0).modulateRotate(o0, () => Math.floor(Math.random() * 5))
.out(o1)
render(o1)
a.setScale (10)
a.setBins (6)
a.setSmooth(0.8)
a.settings[0].cutoff = 1
a.settings[1].cutoff = 2
a.settings[2].cutoff = 4
a.settings[3].cutoff = 6
a.settings[4].cutoff = 8
a.settings[5].cutoff = 9
src(o0)
.saturate(1.01)
.scale(.999)
.color(() => (Math.random() * 2),() => (Math.random() * 1),() => (Math.random() * 2))
.hue(.01)
.modulateHue(src(o1).hue(.3).posterize(-1).contrast(.7),2)
.layer(src(o1)
.luma()
.mult(gradient(1)
.saturate(.9))).diff(o2)
.out(o0)
noise(1, .2)
.rotate(2,.5)
.layer(src(o0)
.scrollX(.2))
.out(o1)
osc(30,0.01,0.5)
.mult(osc(20,-0.1,1).modulate(noise(3,1)).rotate(() => Math.floor(Math.random() * a.fft[(Math.floor(Math.random() * 5))])))
.posterize([13,10,2].fast(0.5).smooth(1))
.modulateRotate(o0, () => (a.fft[0] * time * a.fft[(Math.floor(Math.random() * 5))]) * (time * a.fft[(Math.floor(Math.random() * 5))]) ).color(0.052,0,0.2)
.out(o2)
render(o0)
s0.initCam()
osc(660,-0.001,() => (a.fft[0]*4)).diff(osc(60,0.08).rotate(Math.PI/2))
.modulateScale(noise(3.5,0.25).modulateScale(osc(5).rotate(()=>Math.sin(time/2))),1.6)
// .color(1,0.5,0.4).contrast(1.4)
.add(src(o0).modulate(o0,.04),.6)
.invert().brightness(0.1).contrast(0.2)
.modulateScale(osc(() => (a.fft[0]*4)),-0.2)
.diff(s0)
.out(o1)
voronoi(50,1)
.luma(0.5).add(shape(1,1).luma(1))
.modulate(osc(-1000, -1)
.modulate(osc().luma()))
.blend(o0)
.blend(o0)
.blend(o0)
.blend(o0)
.diff(s0)
.diff(o1)
.diff(o1)
.diff(o1)
.out()
a.setBins (6)
//
a.settings[0].cutoff = 1
a.settings[1].cutoff = 2
a.settings[2].cutoff = 4
a.settings[3].cutoff = 6
a.settings[4].cutoff = 8
a.settings[5].cutoff = 9
s0.initCam()
src(s0)
.pixelate(20, 2)
.modulate(noise(7.5), () => 4.9 * a.fft[0] * Math.random())
.out(o1)
src(o1).modulate(o1, () => a.fft[3]).out(o2)
osc(() => a.fft[0] * time, 0.1, 0.1)
.color(0.2, 0.5, 2.5)
.rotate(() => a.fft[2], 0.1)
.pixelate(2, 20)
.modulate(noise(6.3), () => 2.1 * Math.sin(time * a.fft[1]))
.diff(o2)
.out(o0)
a.setScale (10)
a.setBins (6)
//
a.settings[0].cutoff = 1
a.settings[1].cutoff = 2
a.settings[2].cutoff = 4
a.settings[3].cutoff = 6
a.settings[4].cutoff = 8
a.settings[5].cutoff = 9
s0.initCam()
src(s0).modulate(s0, () => (a.fft[0] * Math.random())).out(o1)
shape(3).scale(()=> a.fft[4]*2 +1).kaleid(9).add(osc(12).colorama(1).color(2,3,4)).blend(o0).color(0,1,1)
.blend(o0).rotate(()=> a.fft[1]*0.1 -0.2).scrollY(-0.32,-0.2)
.add(shape(() => (Math.floor(Math.random() * 15) + 5))
.color(2.5,0.5,0.0).repeat(-3,3).add(shape(2).scale(1).kaleid(5).color(0,1,0.5)).scrollY(()=> a.fft[0]*0.7 -0.1,-0.02)).scale(()=> a.fft[2]*0.2 -1).modulate(o0, () => (a.fft[0] * Math.random()))
.scale(()=> a.fft[3]*2 -1).scrollY(-21,-0.2).rotate(-0.1,()=> a.fft[3]*0.02 -0.1).diff(o1).out(o0)
// Based off egg of the phoenix by www.alexandrerangel.art.br/hydra.html
speed=1.2
shape(99,.15,.5).color(0,1,2)
.modulate(osc(25,0.1,0.5)
.scale(({time})=>Math.sin(time*1)*0.5+1)
.modulate(noise(0.6,0.5)),
0.5)
.diff( shape(240,.5,0).scrollX(.05).rotate( ()=>time/10 ).color(1,0,.75) )
.diff( shape(99,.4,.002).scrollX(.10).rotate( ()=>time/20 ).color(1,0,.75) )
.diff( shape(99,.3,.002).scrollX(.15).rotate( ()=>time/30 ).color(1,0,.75) )
.modulate(noise(0.6,0.5))
.diff( shape(99,.2,.002).scrollX(.20).rotate( ()=>time/40 ).color(1,0,.75) )
.kaleid(50)
.diff( shape(99,.1,.002).scrollX(.25).rotate( ()=>time/50 ).color(1,0,.75) )
.modulateScale(
shape(240,.5,0).scrollX(.05).rotate( ()=>time/10 )
, ()=>(Math.sin(time/3)*.2)+.2 )
.modulate(noise(0.1,0.05))
.scale(1.6,.6,1)
.out()
// =====================================================================================================
// warpy noise one
a.setScale (10)
a.setBins (6)
//
a.settings[0].cutoff = 1
a.settings[1].cutoff = 2
a.settings[2].cutoff = 4
a.settings[3].cutoff = 6
a.settings[4].cutoff = 8
a.settings[5].cutoff = 9
s0.initCam()
shape(()=>Math.sin(time / Math.PI)+1*3, () => time * 0.0001,() => Math.random() * .16).color(0.8,0,0.3)
.repeat(5,3, ()=>a.fft[0]*2, ()=>a.fft[1]*2)
.scrollY(.5,0.1)
.layer(
src(o1)
.mask(o0)
.luma(0.1, .1)
.invert(.2)
)
.modulate(o1,.02)
.out(o0)
osc(() => (a.fft[2] * Math.random() + 80), 0.09, 0.1)
.color(1.84,0.12,0.74)
.modulate(osc(8).rotate(1, 0.5))
.rotate(1, 0.2)
.out(o1)
src(s0).color(1.3,0.2,1.1).modulateScale(s0, () => ((a.fft[5] || a.fft[0]) * ((time/64)/(Math.PI+Math.PI)*(a.fft[Math.floor(Math.random())])))).out(o3)
shape(3).scale(()=> a.fft[4]*2 +1).kaleid(9).add(osc(12).colorama(0.5).color(1.1,0.1,0.5)).blend(o0).color(1.25,0.15,0.32)
.blend(o1).rotate(()=> a.fft[1]*0.1 -0.2).scrollY(-0.32,-0.2)
.add(shape(() => (Math.floor(Math.random() * 15) + 5))
.color(0.2,0,0.4).repeat(-5,3).add(shape(2).scale(0.5).kaleid(4).color(0.9,0.1,0.40)).scrollY(()=> a.fft[0]*0.7 -0.1,-0.02)).scale(()=> a.fft[2]*0.2 -1).modulate(o0, () => (a.fft[0] * Math.random()))
.scale(()=> a.fft[3]*2 -1).scrollY(-21,-0.2).rotate(-0.1,()=> a.fft[3]*0.02 -0.1).diff(o3).diff(o0).modulate(noise(() => ((Math.random() * 16) * (a.fft[Math.floor(Math.random() * 5)]))), () => 2.1 * Math.sin(time * a.fft[1])).out(o2)
render(o2)
// ================================================================================================
a.setScale (10)
a.setBins (6)
//
a.settings[0].cutoff = 1
a.settings[1].cutoff = 2
a.settings[2].cutoff = 4
a.settings[3].cutoff = 6
a.settings[4].cutoff = 8
a.settings[5].cutoff = 9
s0.initCam()
shape(()=>Math.sin(time / Math.PI)+1*3, time * 0.0001, Math.random() * .16).color(1.8,0,0.3)
.repeat(5,3, ()=>a.fft[0]*2, ()=>a.fft[1]*2)
.scrollY(.5,0.1)
.layer(
src(o1)
.mask(o0)
.luma(0.01, .1)
.invert(.2)
)
.modulate(o1,.02)
.out(o0)
osc(() => (a.fft[4] * Math.random() + 40), 0.09, 0.1)
.color(0.6,0.2,0.4)
.modulate(osc(8).rotate(1, 0.5))
.rotate(1, 0.2)
.out(o1)
src(s0).modulateScale(s0, () => ((a.fft[1] || a.fft[0]) * ((time/64)/(Math.PI+Math.PI)*(a.fft[Math.floor(Math.random())])))).out(o3)
shape(3).scale(()=> a.fft[4]*2 +1).kaleid(9).add(osc(12).colorama(0).color(0.1,0.1,0.5)).blend(o0).color(0.25,0.5,0.32)
.blend(o1).rotate(()=> a.fft[1]*0.1 -0.2).scrollY(-0.32,-0.2)
.add(shape(() => (Math.floor(Math.random() * 15) + 5))
.color(1,0,0.0).repeat(-5,3).add(shape(2).scale(0.5).kaleid(8).color(0.9,0.1,0.40)).scrollY(()=> a.fft[0]*0.7 -0.1,-0.02)).scale(()=> a.fft[2]*0.2 -1).modulate(o0, () => (a.fft[0] * Math.random()))
.scale(()=> a.fft[3]*2 -1).scrollY(-21,-0.2).rotate(-0.1,()=> a.fft[3]*0.02 -0.1).diff(o0).diff(o3).out(o2)
render(o2)
//======================================================================================
a.setScale (10)
a.setBins (6)
//
a.settings[0].cutoff = 1
a.settings[1].cutoff = 2
a.settings[2].cutoff = 4
a.settings[3].cutoff = 6
a.settings[4].cutoff = 8
a.settings[5].cutoff = 9
s0.initCam()
shape(()=>Math.sin(time / Math.PI)+1*3, time * 0.0001, Math.random() * .2)
.repeat(5,3, ()=>a.fft[0]*2, ()=>a.fft[1]*2)
.scrollY(.5,0.1)
.layer(
src(o1)
.mask(o0)
.luma(.01, .1)
.invert(.2)
)
.modulate(o1,.02)
.out(o0)
osc(() => (a.fft[4] * Math.random() + 40), 0.09, 0.1)
.color(1,0,0)
.modulate(osc(8).rotate(1, 0.5))
.rotate(1, 0.2)
.out(o1)
src(s0).modulateScale(s0, () => ((a.fft[1] || a.fft[0]) * ((time/64)/(Math.PI+Math.PI)*(a.fft[Math.floor(Math.random())])))).out(o3)
shape(3).scale(()=> a.fft[4]*2 +1).kaleid(9).add(osc(12).colorama(0).color(0,0,0)).blend(o0).color(0,0,0)
.blend(o1).rotate(()=> a.fft[1]*0.1 -0.2).scrollY(-0.32,-0.2)
.add(shape(() => (Math.floor(Math.random() * 15) + 5))
.color(0,0,0.0).repeat(-5,3).add(shape(2).scale(0.5).kaleid(5).color(0,0,0.0)).scrollY(()=> a.fft[0]*0.7 -0.1,-0.02)).scale(()=> a.fft[2]*0.2 -1).modulate(o0, () => (a.fft[0] * Math.random()))
.scale(()=> a.fft[3]*2 -1).scrollY(-21,-0.2).rotate(-0.1,()=> a.fft[3]*0.02 -0.1).diff(o3).diff(o0).out(o2)
render(o2)
//========================================================
a.setScale (10)
a.setBins (6)
//
a.settings[0].cutoff = 1
a.settings[1].cutoff = 2
a.settings[2].cutoff = 4
a.settings[3].cutoff = 6
a.settings[4].cutoff = 8
a.settings[5].cutoff = 9
s0.initCam()
shape(()=>Math.sin(time / Math.PI)+1*3, () => time * 0.0001,() => Math.random() * .16).color(1.8,0,0.3)
.repeat(5,3, ()=>a.fft[0]*2, ()=>a.fft[1]*2)
.scrollY(.5,0.1)
.layer(
src(o1)
.mask(o0)
.luma(0.1, .1)
.invert(.2)
)
.modulate(o1,.02)
.out(o0)
osc(() => (a.fft[2] * Math.random() + 80), 0.09, 0.1)
.color(1.84,0.12,0.74)
.modulate(osc(8).rotate(1, 0.5))
.rotate(1, 0.2)
.out(o1)
src(s0).modulateScale(s0, () => ((a.fft[5] || a.fft[0]) * ((time/64)/(Math.PI+Math.PI)*(a.fft[Math.floor(Math.random())])))).out(o3)
shape(3).scale(()=> a.fft[4]*2 +1).kaleid(9).add(osc(12).colorama(0.5).color(0.1,0.1,0.5)).blend(o0).color(0.25,0.5,0.32)
.blend(o1).rotate(()=> a.fft[1]*0.1 -0.2).scrollY(-0.32,-0.2)
.add(shape(() => (Math.floor(Math.random() * 15) + 5))
.color(0,0,0.70).repeat(-5,3).add(shape(2).scale(0.5).kaleid(4).color(0.9,0.1,0.40)).scrollY(()=> a.fft[0]*0.7 -0.1,-0.02)).scale(()=> a.fft[2]*0.2 -1).modulate(o0, () => (a.fft[0] * Math.random()))
.scale(()=> a.fft[3]*2 -1).scrollY(-21,-0.2).rotate(-0.1,()=> a.fft[3]*0.02 -0.1).diff(o3).diff(o0).out(o2)
render(o2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment