Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: I need you
name
code content
( s.waitForBoot({ var squiggleBus; squiggleBus = Bus.control(s, 6); SynthDef(\generateINeedYouSquiggle, { | controlOutBus | var time, speed, rotations, commonpart, xy, sc; // a nice squiggle in polar coordinates: r = sin(6*phi) + 2 // convert to parametric equations: // commonpart = sin(6*t)+2 // x(t) = commonpart*sin(t) // y(t) = commonpart*cos(t) // where t is provided by a low frequency sawtooth wave speed = 1; rotations = 1; time = LFSaw.kr(freq:speed, iphase:1).range(0, speed*rotations); commonpart = SinOsc.kr(5*time) + 2; // flower shape xy = [commonpart*SinOsc.kr(time), commonpart*SinOsc.kr(time, pi/2), -3, 3, -3, 3]; // x and y vary between -3 and 3 sc = (xy*0.2).scope; // for visualization only Out.kr(controlOutBus, xy); }).add; SynthDef(\squiggleTestAutomatic, { | out = 0, controlInBus | var sig, xy; // read the xy control values in the form [ x, y, minx, maxx, miny, maxy] xy = In.kr(controlInBus, 6); // and use them in the synth sig = Pan2.ar(CombN.ar(Resonz.ar(Gendy5.ar(2,3,minfreq:1,maxfreq:xy[0].linlin(xy[2],xy[3],10,700), durscale:0.1, initCps:10), xy[1].linlin(xy[4],xy[5],50,1000), 0.1), 0.1, 0.1, 5, 0.6), 0.0); Out.ar(out, sig); }).add; s.sync; x = Synth(\generateINeedYouSquiggle, [controlOutBus: squiggleBus]); Synth.after(x, \squiggleTestAutomatic, [controlInBus: squiggleBus]); }); )
code description
Iannis Xenakis begging us from the grave: "I need you! I need you! I need you!...". This code is based on an example from the Help documents that uses MouseX.kr and MouseY.kr, but I've replaced the MouseX and MouseY with a "2d squiggle". I wrote a blog post that explains how to generate "2d squiggles" like these (as well as completely different ones) - see http://technogems.blogspot.be/2017/08/automating-squiggles-in-supercollider.html . If you run the code also a scope will appear. Put it in X/Y mode to see the squiggle as it is being generated and executed.
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