OSDN Git Service

Add files via upload
[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 a=1;
7 Routine({var n1 = 1, n2 = 1.6180339887499, numsteps = 64;
8          x=1000.do({n = n1; (numsteps.do({(n = n*a)}));
9                 if(n <= n2,
10                         {a=a+0.01},{x.stop});
11
12         });
13          x=1000.do({n = n1;
14                 (numsteps.do({(n = n*a)}));
15                 if(n >= n2,
16                         {a=a-0.001},{x.stop});
17
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         });
25          x=1000.do({n = n1;
26                 (numsteps.do({(n = n*a)}));
27                 if(n >= n2,
28                         {a=a-0.000001},{x.stop});
29
30         });
31          x=1000.do({n = n1;
32                 (numsteps.do({(n = n*a)}));
33                 if(n <= n2,
34                         {a=a+0.0000001},{x.stop});
35
36         });
37          x=1000.do({n = n1;
38                 (numsteps.do({(n = n*a)}));
39                 if(n >= n2,
40                         {a=a-0.00000001},{x.stop});
41
42         });
43          x=1000.do({n = n1;
44                 (numsteps.do({(n = n*a)}));
45                 if(n <= n2,
46                         {a=a+0.000000001},{x.stop});
47
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         });
55          x=1000.do({n = n1;
56                 (numsteps.do({(n = n*a)}));
57                 if(n <= n2,
58                         {a=a+0.00000000001},{x.stop});
59
60         });
61          x=1000.do({n = n1;
62                 (numsteps.do({(n = n*a)}));
63                 if(n >= n2,
64                         {a=a-0.000000000001},{x.stop});
65
66         });
67          x=1000.do({n = n1;
68                 (numsteps.do({(n = n*a)}));
69                 if(n <= n2,
70                         {a=a+0.0000000000001},{x.stop});
71
72         });
73          x=1000.do({n = n1;
74                 (numsteps.do({(n = n*a)}));
75                 if(n >= n2,
76                         {a=a-0.00000000000001},{x.stop});
77
78         });
79          x=1000.do({n = n1;
80                 (numsteps.do({(n = n*a)}));
81                 if(n <= n2,
82                         {a=a+0.000000000000001},{x.stop});
83
84         });
85          x=1000.do({n = n1;
86                 (numsteps.do({(n = n*a)}));
87                 if(n >= n2,
88                         {a=a-0.0000000000000001},{x.stop});
89
90         });
91          x=1000.do({n = n1;
92                 (numsteps.do({(n = n*a)}));
93                 if(n <= n2,
94                         {a=a+0.00000000000000001},{x.stop});
95
96         });
97          x=1000.do({n = n1;
98                 (numsteps.do({(n = n*a)}));
99                 if(n >= n2,
100                         {a=a-0.000000000000000001},{x.stop});
101
102         });
103         x=1000.do({n = n1;
104                 (numsteps.do({(n = n*a)}));
105                 if(n >= n2,
106                         {a=a+0.0000000000000000001},{x.stop});
107
108         });
109         x=1000.do({n = n1;
110                 (numsteps.do({(n = n*a)}));
111                 if(n >= n2,
112                         {a=a-0.00000000000000000001},{x.stop});
113         });
114         a.postln;
115 }).play;
116 );