author Ken Brant Thu, 8 Jun 2017 21:48:39 +0000 (17:48 -0400) committer GitHub Thu, 8 Jun 2017 21:48:39 +0000 (17:48 -0400)

index 7c99634..6289ec0 100644 (file)
//For example, I want the note increment ratio for a KW sequence that has 64 steps(numsteps) and a starting(n1) and ending(n2)
//note ratio difference of 1.6180339887499.

-a=1;
-Routine({var n1 = 1, n2 = 1.6180339887499, numsteps = 64;
-        x=1000.do({n = n1; (numsteps.do({(n = n*a)}));
+y = Routine({var a = 1, n1 = 1, n2 = 1.6180339887499, numsteps = 64;
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n <= n2,
{a=a+0.01},{x.stop});
-
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n >= n2,
{a=a-0.001},{x.stop});
-
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n <= n2,
{a=a+0.0001},{x.stop});
-
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n >= n2,
-                       {a=a-0.000001},{x.stop});
-
+                       {a=a-0.00001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n <= n2,
-                       {a=a+0.0000001},{x.stop});
-
+                       {a=a+0.000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n >= n2,
-                       {a=a-0.00000001},{x.stop});
-
+                       {a=a-0.0000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n <= n2,
-                       {a=a+0.000000001},{x.stop});
-
+                       {a=a+0.00000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n >= n2,
-                       {a=a-0.0000000001},{x.stop});
-
+                       {a=a-0.000000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n <= n2,
-                       {a=a+0.00000000001},{x.stop});
-
+                       {a=a+0.0000000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n >= n2,
-                       {a=a-0.000000000001},{x.stop});
-
+                       {a=a-0.00000000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n <= n2,
-                       {a=a+0.0000000000001},{x.stop});
-
+                       {a=a+0.000000000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n >= n2,
-                       {a=a-0.00000000000001},{x.stop});
-
+                       {a=a-0.0000000000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n <= n2,
-                       {a=a+0.000000000000001},{x.stop});
-
+                       {a=a+0.00000000000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n >= n2,
-                       {a=a-0.0000000000000001},{x.stop});
-
+                       {a=a-0.000000000000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n <= n2,
-                       {a=a+0.00000000000000001},{x.stop});
-
+                       {a=a+0.0000000000000001},{x.stop});
});
-        x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
if(n >= n2,
-                       {a=a-0.000000000000000001},{x.stop});
-
+                       {a=a-0.00000000000000001},{x.stop});
});
x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
-               if(n >= n2,
-                       {a=a+0.0000000000000000001},{x.stop});
-
+               numsteps.do({n = n*a});
+               if(n <= n2,
+                       {a=a+0.000000000000000001},{x.stop});
});
x=1000.do({n = n1;
-               (numsteps.do({(n = n*a)}));
+               numsteps.do({n = n*a});
if(n >= n2,
-                       {a=a-0.00000000000000000001},{x.stop});
+                       {a=a-0.0000000000000000001},{x.stop});
+       });
+       x=1000.do({n = n1;
+               numsteps.do({n = n*a});
+               if(n <= n2,
+                       {a=a+0.00000000000000000001},{x.stop; y.stop;});
});
a.postln;
}).play;