Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: fractal tweets
name
code content
// I was looking some fractal structures, with a friend who studies the maths, and we found a // simple algorithm. So i made some tweets with the formula. r{inf.do{|i|a=i.asInteger.rand2;if(a.even){a=a/2}{a=a*3+1};play{SinOsc.ar(a,0,0.1)!2*EnvGen.ar(Env.perc,1,1,0,1,2)};0.07.wait;}}.play // r{inf.do{|i|a=i.asInteger;if(a.even){a=a/2}{a=a*3+1};play{SinOsc.ar(a,0,0.1)!2*EnvGen.ar(Env.perc,1,1,0,1,2)};0.01.wait;}}.play // a=(-23);r{inf.do{a=a.asInteger;a.postln;if(a.even){a=a/2}{a=a*3+1};play{SinOsc.ar(a,0,0.1)!2*EnvGen.ar(Env.perc,1,1,0,1,2)};0.1.wait}}.play // a=(-917);r{inf.do{a=a.asInteger.postln;if(a.even){a=a/2}{a=a*3+1};play{SinOsc.ar(a,0,0.1)!2*EnvGen.ar(Env.perc,1,1,0,1,2)};0.1.wait}}.play // the funny thing is that when you have a negative input this folds into a loop! // the correct formula is this below a=73;r=r{inf.do{a=a.asInteger;if(a==1){r.stop};if(a.even){a=a/2}{a=a*3+1};play{Blip.ar(a)!2*EnvGen.ar(Env.perc,1,1,0,1,2)};0.1.wait}}.play
code description
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change