Skip to content

Instantly share code, notes, and snippets.

@Softwave
Created September 24, 2015 02:46
Show Gist options
  • Save Softwave/8a31823f51555bca3908 to your computer and use it in GitHub Desktop.
Save Softwave/8a31823f51555bca3908 to your computer and use it in GitHub Desktop.
require 'osc-ruby'
@client ||= OSC::Client.new('localhost', 9177)
@client.send(OSC::Message.new("/shader-string", "
uniform float shiggle;
void main( void ) {
vec2 uv = ( gl_FragCoord.xy / iResolution.xy ) * 2.0 - 1.0;
float t = abs( 1.0 / (sin( uv.y + sin( iGlobalTime + uv.x * 10.0 ) * uv.x ) * shiggle) );
vec3 finalColor = vec3( t * 0.2, t * iVolume, t * 0.9 );
gl_FragColor = vec4( finalColor, 95.0 );
}"))
live_loop :mainloop do
with_fx :reverb, room: 1, reps: 4 do
use_synth :prophet
ns = (scale :c2, :minor_pentatonic, num_octaves: 4).take(4)
16.times do
play ns.choose, detune: 12, release: 8, amp: 2, amp: rand + 0.5, cutoff: rrand(70, 120), amp: 2
@client.send(OSC::Message.new("/decaying-uniform", "shiggle", 7.0, 2.0))
sleep 4
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment