OSDN Git Service

Fixed bugs, and others
[timewavesynth/Timewave_Synthesizer.git] / tools / step_ratio_calculator.scd
1 (
2 //To find out the ratio per step for note increments in the inlcine/decline of the King Wen sequence.
3 //For example, I want the note increment ratio for a KW sequence that has 64 steps(numsteps) and a starting(n1) and ending(n2)
4 //note ratio difference of 1.6180339887499.
5
6 //Press "ctrl/cmd - enter" within the parenthesis to evaluate
7
8 y = Routine({var a = 1, n1 = 1, n2 = 1.6180339887499, numsteps = 64;
9         x=1000.do({n = n1;
10                 numsteps.do({n = n*a});
11                 if(n <= n2,
12                         {a=a+0.01},{x.stop});
13         });
14         x=1000.do({n = n1;
15                 numsteps.do({n = n*a});
16                 if(n >= n2,
17                         {a=a-0.001},{x.stop});
18         });
19         x=1000.do({n = n1;
20                 numsteps.do({n = n*a});
21                 if(n <= n2,
22                         {a=a+0.0001},{x.stop});
23         });
24         x=1000.do({n = n1;
25                 numsteps.do({n = n*a});
26                 if(n >= n2,
27                         {a=a-0.00001},{x.stop});
28         });
29         x=1000.do({n = n1;
30                 numsteps.do({n = n*a});
31                 if(n <= n2,
32                         {a=a+0.000001},{x.stop});
33         });
34         x=1000.do({n = n1;
35                 numsteps.do({n = n*a});
36                 if(n >= n2,
37                         {a=a-0.0000001},{x.stop});
38         });
39         x=1000.do({n = n1;
40                 numsteps.do({n = n*a});
41                 if(n <= n2,
42                         {a=a+0.00000001},{x.stop});
43         });
44         x=1000.do({n = n1;
45                 numsteps.do({n = n*a});
46                 if(n >= n2,
47                         {a=a-0.000000001},{x.stop});
48         });
49         x=1000.do({n = n1;
50                 numsteps.do({n = n*a});
51                 if(n <= n2,
52                         {a=a+0.0000000001},{x.stop});
53         });
54         x=1000.do({n = n1;
55                 numsteps.do({n = n*a});
56                 if(n >= n2,
57                         {a=a-0.00000000001},{x.stop});
58         });
59         x=1000.do({n = n1;
60                 numsteps.do({n = n*a});
61                 if(n <= n2,
62                         {a=a+0.000000000001},{x.stop});
63         });
64         x=1000.do({n = n1;
65                 numsteps.do({n = n*a});
66                 if(n >= n2,
67                         {a=a-0.0000000000001},{x.stop});
68         });
69         x=1000.do({n = n1;
70                 numsteps.do({n = n*a});
71                 if(n <= n2,
72                         {a=a+0.00000000000001},{x.stop});
73         });
74         x=1000.do({n = n1;
75                 numsteps.do({n = n*a});
76                 if(n >= n2,
77                         {a=a-0.000000000000001},{x.stop});
78         });
79         x=1000.do({n = n1;
80                 numsteps.do({n = n*a});
81                 if(n <= n2,
82                         {a=a+0.0000000000000001},{x.stop});
83         });
84         x=1000.do({n = n1;
85                 numsteps.do({n = n*a});
86                 if(n >= n2,
87                         {a=a-0.00000000000000001},{x.stop});
88         });
89         x=1000.do({n = n1;
90                 numsteps.do({n = n*a});
91                 if(n <= n2,
92                         {a=a+0.000000000000000001},{x.stop});
93         });
94         x=1000.do({n = n1;
95                 numsteps.do({n = n*a});
96                 if(n >= n2,
97                         {a=a-0.0000000000000000001},{x.stop});
98         });
99         x=1000.do({n = n1;
100                 numsteps.do({n = n*a});
101                 if(n <= n2,
102                         {a=a+0.00000000000000000001},{x.stop; y.stop;});
103         });
104         a.postln;
105 }).play;
106 );
107
108 /* e-mail: ken_brant@ymail.com */