550 => float x;
440 => float y;
3 => float a1;
0 => float b1;
0 => float a2;
-2 => float b2;
fun void iGen(int i1, int j1) {
while(true) {
Euclid(i1,j1,a1,b1) + Euclid(i1,j1,a2,b2) => float dist;
<<< dist >>>;
SinOsc s => ADSR e => dac;
e.set(35::ms, 8::ms, .1, 200::ms);
Math.pow(0.65,(dist)) => s.gain;
i1*x + j1*y => s.freq;
e.keyOn();
(440)::ms => now;
e.keyOff();
(440*Math.pow(1.2,dist))::ms => now;
}
}
fun float Euclid(float p, float q, float r, float s) {
return Math.sqrt(Math.pow((p-r),2) + Math.pow((q-s),2));
}
for(-3 => int i; i<4; i++) {
for (-3 => int j; j<4; j++) {
if (i != 0 && j != 0) {
spork ~ iGen(i,j);
}
}
}
while (x != y) {
500::ms=>now;
}