Commit 9e837a69 by PLN (Algolia)

update: Broken

parent 368c9392
s0.initImage("file:///home/pln/Work/Hydra/AMS/img/swing.jpg")
src(s0)
// .scale(() => 0.95 + 0.05 * Math.sin(time/5))
.out(o0)
//
src(o0)
// .scale(() => 1 - Math.sin(time) / 100)
.blend(o1,0.5)
.blend(o1,0.45)
.blend(o1,0.35)
.blend(o1,0.25)
.out(o1)
//
src(o1)
.modulate(
osc(0.94,-0.05).rotate(-20)
)
// .scale(1.15)
.scrollX(-0.02)
.brightness(0.15).contrast(1.35)
.out(o2)
src(o2)
.scale(1.25)
.out(o3)
//
render(o3)
osc(() => 0.2 + 20 * Math.sin(time / 100), 0.1, 0.8)
.color(1.04,0, -1.1)
.rotate(0.30, 0.2)
.pixelate(2, 20)
.modulate(noise(2.5), () => 1.5 * Math.sin(0.08 * time))
.out(o0)
s0.initCam(1)
src(s0)
.pixelate(256)
.scale(() => 0.72 + Math.cos(time / 10))
.modulateRotate(voronoi(10))
.out(o1)
src(o1)
.blend(o0, 0.23)
.out(o2)
render(o2)
s0.initImage("file:///home/pln/Work/Hydra/Neige/img/mer.jpg") s0.initImage("file:///home/pln/Work/Hydra/Neige/img/mer.jpg")
s1.initImage("file:///home/pln/Work/Hydra/Neige/img/fonds.jpg") s1.initImage("file:///home/pln/Work/Hydra/Neige/img/fonds.jpg")
a.show()
a.setCutoff(0.1)
a.setBins(4)
src(s0) src(s0)
.scale(() => 1.5 + 0.5 * Math.sin(time/100)) .scale(() => 1.5 + 0.5 * Math.sin(a.fft[0] + time/10))
// .scale(() => 1.05 + 0.05 * Math.sin(time/5)) // .scale(() => 1.05 + 0.05 * Math.sin(time/5))
.out(o0) .out(o0)
// //
......
// From a picture of Galaxy Nasa 724203 // From a picture of Galaxy Nasa 724203
// Private share: https://nech.pl/nights-galactic // Private share: https://nech.pl/nights-galactic
s0.initImage("https://git.plnech.fr/pln/Hydra/raw/7ab247cae7f562ecc0f1c13a6646e5a71f6c0f1f/StarryNights/img/724203.jpg") s0.initImage("file:///home/pln/Work/Hydra/StarryNights/img/724203.jpg")
src(s0).out() src(s0).out()
src(o0) src(o0)
.blend(o0) .blend(o0)
.blend(src(o1).scale(0.5,0.9).rotate(() => Math.sin(time/900) * 360), 0.25) .blend(src(o1).scale(0.5,0.9).rotate(() => Math.sin(time/900) * 360), 0.25)
.out(o2) .out(o2)
src(o2) src(o2)
.modulate(o0,() => Math.sin(time/20) % 2) .modulate(o0,() => Math.sin(time/20) % 2)
.out(o1) .out(o1)
......
This image diff could not be displayed because it is too large. You can view the blob instead.
// Forwarding tidal messages from supercollider to hydra.
// based on code by atsushi tadokoro: https://vimeo.com/265074689
// To run examples, open file tidal-forward.sc in SuperCollider. This file forwards all messages
// received from tidal in SuperCollider to an additional port (3333)
//
// Note:
// to show developer console in atom, use the following commands:
// windows - Ctrl+Alt+I
// osx - Cmd+Opt+I
// linux - Ctrl + Shift + I
// set port to listen to osc messages. default port is 57101
msg.setPort(3333)
//
// function to convert tidal messages from an array to an object
// run this code once
parseTidal = (args) => {
obj = {}
for(var i = 0; i < args.length; i+=2){
obj[args[i]] = args[i+1]
}
return obj
}
// receive messages from supercollider in hydra. '/play2' corresponds to the
// address of the OSC message, defined in the file tidal-forward.sc
// open the console to see the messages, using Ctrl+Alt+I (windows), Cmd+Opt+I (mac), or Ctrl + Shift + I(linux)
//
msg.on('/play2', (args) => {
// log osc results to console
//log(args)
tidal = parseTidal(args)
console.log(tidal)
})
// EXAMPLE USING TIDAL "sd" and "bd" to control hydra
// define a variable to contain a blend value
blend = 0
//
// receive args from supercollider in hydra. Tidal sends OSC messages
// ahead of the time the sound is plays, so it is necessary to use setTimeout
// in order to wait to change the visuals
msg.on('/play2', (args) => {
// parse the values from tidal
var tidal = parseTidal(args)
//
setTimeout(() => {
//
// If the tidal sample is "sd", set blend to 0, if it is bd, set blend to 1
//
if(tidal.s === "sd"){
blend = 0
} else if (tidal.s === "bd"){
blend = 1
}
//
}, tidal.delta * 1000)
})
// use the variable "blend" in a hydra function
osc(20, 0.1, 0.8)
.rotate(0.2)
.mult(osc(100), () => blend)
.out()
//
//
// EXAMPLE 2. increment values when a certain sample is received
//
// define variables for frequency and number of sides in kaleidoscope
freq = 10
numSides = 0
//
msg.on('/play2', (args) => {
// parse the values from tidal
var tidal = parseTidal(args)
//
setTimeout(() => {
//
// increment values of freq and kaliedoscope based on tidal messages received
//
if(tidal.s === "sd"){
// add 10 to frequency when "bd" message received
freq = freq + 10
} else if (tidal.s === "bd"){
// add 1 to num
numSides = numSides + 1
}
}, (tidal.delta - tidal.latency) * 1000)
})
// use the variables freq and numSides in hydra
osc(() => freq, 0.0, 0.8)
.kaleid(() => numSides)
.out()
s0.initCam()
src(s0).out()
render()
a.show()
a.setBins(4)
a.setScale(2)
a.setCutoff(4)
a.setSmooth(0.84)
osc(30,() => 0.085, Math.PI/(1 + Math.sin(time)))
.luma()
.hue(() => Math.cos(time/10))
.out(o0)
src(o0)
.scale(() => 0.5 + (a.fft[0] % 10) / 10)
.rotate(() => Math.sin(time/12))
.out(o1)
src(o1)
.modulateScale(
noise(() => 100 * a.fft[3] + 80
,() => 10 * a.fft[2] + 5 * a.fft[3]))
.out(o2)
src(o2)
.add(
shape(5)
.scale(() => 1.9 + Math.cos(time/3 + time/19 + time / 100))
.colorama(0.1)
.rotate(() => Math.sin(time/4 + (0.01 + 0.1 * a.fft[1]) * Math.random() / 2) % 360)
.modulateHue(src(o2))
.modulate(src(o2))
)
.out(o3)
render(o3)
noise().out(o0)
render(o0)
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