Skip to content

Instantly share code, notes, and snippets.

View TheWispy's full-sized avatar

Will Humphreys TheWispy

View GitHub Profile
@TheWispy
TheWispy / some_colours.js
Created March 15, 2020 22:04
Some colours - a hydra one-liner
osc(30).pixelate(20,30).colorama(1.2).diff(noise(3,0.1).colorama(0.1)).diff(o0).hue(()=>Math.sin(0.6*time)).mult(o0,0.01).scale(0.99).modulate(o0,0.01).scale(1.02).out()
@TheWispy
TheWispy / hydra_apc20.js
Last active April 30, 2020 14:56
APC20 MIDI controller Hydra script
navigator.requestMIDIAccess()
.then(onMIDISuccess, onMIDIFailure);
function onMIDISuccess(midiAccess) {
console.log(midiAccess);
var inputs = midiAccess.inputs;
var outputs = midiAccess.outputs;
for (var input of midiAccess.inputs.values()){
input.onmidimessage = getMIDIMessage;
}
@TheWispy
TheWispy / vornoi_pit.hydra
Created September 10, 2018 22:05
A swirly colourful hydra patch utilising the new voronoi texture.
base = () => voronoi(5,0.6,2)
base().color(1,0.6,0.8)
.add(o0).modulate(noise(3), 0.02)
.shift(-0.1,()=>0.5*(1+Math.sin(0.45*time)),0)
.scale(()=>0.91+(0.1*Math.abs(Math.sin(0.1*time))))
.luma(0.1)
.color(()=>1+Math.sin(time*0.12)+Math.sin(time*0.042), 0.1+Math.sin(time*0.04), 0.5)
.out(o0)
osc(100,0.01).rotate(1,0.2).luma(0.5).kaleid(6).kaleid(2).mult(base()).blend(o0, 1).contrast(1.1).out(o1)
render(o1)
@TheWispy
TheWispy / mountains_of_madness.hydra
Created August 26, 2018 23:41
colourful fractured hydra patch
osc(18, 0.1, 0.6).color(2, 0.8, 1).rotate(0.1).modulateScale(noise(20,0.2).pixelate(4,6).rotate(1,-0.2)).diff(o0).scale(0.99).scrollX(0.2).modulateScale(noise(20,0.2).pixelate(4,6).rotate(1,0.01))
.out(o0)
@TheWispy
TheWispy / crumbled_kaleidoscope.hydra
Created August 26, 2018 23:28
A checkered descending spiral of ahydra patch.
osc(20, 1, 2).color(0.71,0,0.2).rotate(0,1).kaleid(6).diff(noise(2,2)).mult(shape(2,0.6).rotate(1,1)).repeat(2,2).modulate(noise(20,1)).kaleid(6).rotate(1,1).add(o0).scale(0.98).modulate(o0, 0.01).scrollX(()=>Math.sin(0.2*time)*0.01).scrollY(()=>Math.cos(0.2*time)*0.01).mult(noise(20,0.1).pixelate(20,20).contrast(2).rotate(1,-2)).add(o0).scrollY(0.01).scale(0.9).out(o0)
@TheWispy
TheWispy / poisoned_perlin.hydra
Last active August 26, 2018 22:20
Noisy rainbow tunnel hydra patch
// Poisoned Perlin by Will Humphreys
// @wispeh_
osc(2,1,2).diff(o0, 0.14).rotate(0.01).scale(0.99).posterize(10,2)
//.kaleid(2)
.add(noise(2,1).rotate(0.1,0.1), 0.2)
.shift(0, 0, 0)
.out(o0)
@TheWispy
TheWispy / line_func.hydra
Created August 4, 2018 20:15
General purpose line-like oscillator function - pre-posterized
line = (a, b, c) =>osc(a, b, c).rotate(Math.PI/2).brightness(-0.4).contrast(6).posterize(1)
line(2, 1, 0.5).scale(0.1).rotate(1,1).modulateScale(o0.scale(0.4), 2).kaleid(3).modulate(noise(10,2).pixelate(20,2).scrollX(2,0.2)).out(o0)
render(o0)
@TheWispy
TheWispy / cube_func.hydra
Created August 4, 2018 19:56
Cubish hydra function
pattern = (a, b, c, d) => shape(6,0.3,c).posterize(3).mult(osc(a, d,()=>Math.sin(b*time)).kaleid(3))
pattern(200,2,0.3, 0).rotate(1,1).out(o0)
render(o0)
@TheWispy
TheWispy / porthole_to_daves_house.hydra
Created June 23, 2018 23:02
A hydra patch involving masking
noise(5).color(1,1,1).add(noise(10)).add(noise(20),0.5).add(noise(40),0.1).shift(0,0.1,0.1).rotate(0.03).modulateRotate(osc(10)).out(o0)
osc(25,-0.1,1.5).color(1,0.7,0).rotate(1.125).modulate(shape(6).rotate(1,1).scale(2).repeatX(3).repeatY(2)).out(o1)
shape(3).rotate(1,1).scale(1.3).repeatX(8).repeatY(5).scrollY(1,0.2).out(o2)
shape(6).color(1,0,0).rotate(-1,1).add(o2, 0.5).add(shape(6).color(1,0,0).rotate(-1,1).scale(2).kaleid(6),1).add(noise(50,2).pixelate(20,20), 0.8).mult(shape(6).rotate(1,1).scale(2).repeatX(3).repeatY(2).invert(),1).add(shape(0).color(0,0,0).add(o1,1).diff(o0).posterize(2).brightness(0.3).contrast(2).mult(shape(6).rotate(1,1).scale(2).repeatX(3).repeatY(2)), 1).add(noise(5).color(1,0,1).add(noise(10)).add(noise(20),0.5).add(noise(40),0.1).shift(0,0.1,0.1).rotate(0.03).modulateRotate(osc(10)).mult(osc(60,0.2).posterize(4).contrast(4).kaleid(6), 0.5)).out(o3)
render()
@TheWispy
TheWispy / acid_bus_seat.hydra
Created June 6, 2018 23:45
Acid bus seat hydra patch
osc(105).color(0.5,0.1,0.8).rotate(0.11, 1).modulate(osc(10).rotate(0.3).add(o0, 0.1)).add(osc(20,1,1).color(0,0.8,1)).out(o0)
osc(50,0.5, 0.7).color(1,0.7,0.5).diff(o0).modulate(o1,0.05).out(o1)
render(o1)