Skip to content

Instantly share code, notes, and snippets.

@RemyPorter
Created May 31, 2017 23:50
Show Gist options
  • Save RemyPorter/d9b336b7e81a4dfdfd56b5fcb4a3aa60 to your computer and use it in GitHub Desktop.
Save RemyPorter/d9b336b7e81a4dfdfd56b5fcb4a3aa60 to your computer and use it in GitHub Desktop.
Code for a composition, a Processing Sketch and a Sonic-Pi composition
PVector center;
float ratio = 1.0;
float baseRotate = -0.0001;
void setup() {
fullScreen(P3D);
frameRate(60);
center = new PVector(width/2, height/2);
ellipseMode(CENTER);
noFill();
stroke(#FFFFFF, 250);
background(0);
}
void draw() {
ratio = frameCount + 60 * 0;
clear();
drawRings();
PVector jitter = PVector.random2D();
//jitter.div(3);
center.add(jitter);
baseRotate += (random(1) > 0.5 ? -1 : +1) * 0.00000001;
saveFrame("frame/####.tif");
}
void drawRings() {
float step = 1;
translate(center.x, center.y);
for (float i = 0; i < width * 1.4; i+=step/3) {
PVector jitter = PVector.random2D();
translate(0, 0, -1 * (width-i)/width);
rotateZ(baseRotate * frameCount);
rotateY(baseRotate * frameCount / 100);
stroke(255, i / width * 255);
strokeWeight(7 * i / width);
ellipse(0,0,
i + cos(step) * ratio + jitter.x, i + sin(step) / ratio + jitter.y);
step += 3;
}
}
live_loop :clock do
cue :tick
sleep 1
end
f = 3
notes = range(75,75 - 13,1) + range(75-13,75,1)
use_synth :sine
use_bpm 60
with_fx :reverb, room: 1 do
with_fx :slicer, pulse_width: 0.75, phase: Math.sin(notes[0]).abs, phase_slide: 0.5 do |sl|
with_fx :bpf, centre: notes[0] do |bp|
with_fx :ring_mod, freq: f, freq_slide: 0.5 do |rm|
with_fx :panslicer, wave: 2, phase: 0.1 do
p = play_chord (chord notes.tick, :m7), sustain: 24, release: 2, note_slide: 0.75
26.times do
f += 3
base_note -= 1
control rm, freq: f
control p, notes: (chord notes.tick, :m7)
control bp, centre: notes.tick
control sl, phase: Math.sin(notes.tick).abs
sleep 1
end
end
end
end
end
end
@RemyPorter
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment