// title: I need you // author: 56228375 // 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. // code: ( 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]); }); )