1
2// from SC2
3
4// Fibonacci and Overtone scale (see e.g. Jay Kappraff, "Connections - the
5// Geometric Bridge between Art and Science"). I keep returning to this for
6// some reason. Maybe I should stop listening to Bela B? Anyway it is about
7// Fibonacci numbers, ie
8// 		f(0) = 1, f(1) = 1, f(n) = f(n-1)+f(n-2)
9// 		which gives the series 1,1,2,3,5,8,13, 21...
10// It approximates the Golden Ratio if You divide f(n)/f(n-1)
11// Bela Bartok used this and constructed a (fibonacci) scale from this,
12// with C as fundamental (0), skipping 1's and going upto 13:
13//		C, D, Eb, F, Ab, C#.
14// He also used the overtone scale, built on fundamental plus harmonics and
15// made into a scale with frequency ratios 1:1, 2:1, 3:1 etc. This gives fundamental,
16// octave, fifth+octave etc. Starting on C, we get (a well-tempered approximation) :
17// 		C, D, E, F#, G, A, Bb, B, C.
18// These scales decomposes the chromatic scale into to two complementary in terms
19// of emotion and this duality can be used to create great contrast, ie Fibonacci
20// "inferno" and overtone "paradisio".
21// Staffan Liljegren, 990712, staffan@medialab.ericsson.se
22
23// First both in contrasting sequence:
24
25(
26var ot, fib, p;
27fib = #[60, 62, 63, 65, 68, 73];
28ot =  #[60, 62, 64, 66, 67, 69, 70, 71];
29Pbind(
30	\dur, 0.25,
31	\midinote, Pseq([ Pseq(fib), Pseq([\rest],2), Pseq(ot)], 2)
32	// play message supplies the Event.protoEvent as default
33	).play
34)
35
36// Let us use the Fibonacci series for duration and legato values also and
37// uses these values for duration and legato:
38//		1,1, 1/2, 1/3, 1/5, ...
39// This is a series 1/fib(n).
40// In this particular example, which is only here to demonstrate the components,
41// we just play the fib scale up with random legato and a rythm which goes:
42//		 1,1, 1/2, 1/2, 1/3, 1/3, 1/3, 1/5, 1/5, 1/5, 1/5,1/5
43//		 1 2  3         4              5
44// Or "taa-taa-tantan-tateti-dallapicola" in  5/4. Don't ask me about these
45// rythm mnemonics! The fib scale contains 6 notes and this rythm pattern has
46// 12 events, so we play the fib scale twice over the rythm. Finally we add
47// a random fib bass on each beat and then play a sequence of
48//		bass only, 2*bass+mel, 2*bass+mel transposed up and then down a 5th and
49// 		finally the melody alone and a simple ending
50(
51var fib, bass, mel, ending,tune;
52
53fib = #[60, 62, 63, 65, 68, 73];
54
55bass = Pbind(
56	\tempo, 1.3,
57	\legato, 0.1,
58	\dur, Pseq([1], 5),
59	\midinote, Pxrand(fib - 24, 5)
60);
61mel = Pbind(
62	\tempo, 1.3,
63	\legato, Prand([1,1,1/2,1/3, 1/5, 1/8], inf),
64	\dur, Pseq([1,1,Pseq([1/2],2),Pseq([1/3],3), Pseq([1/5], 5)], 1),
65	\midinote, Pseq( fib , 2)
66);
67ending = Pbind( \dur, Pgeom(0.05, 1.1, 20), \midinote,Pseq([68,72],10) );
68tune = Pseq([
69			bass,
70			Ppar([ bass, mel ],2),
71			Padd(\ctranspose, 7,  Ppar([ bass, mel ],2)),
72			Padd(\ctranspose, -7, Ppar([ bass, mel ],2)),
73			mel,
74			ending
75		], 1);
76
77tune.play
78
79)
80
81// Let us now shuffle notes and durations a bit in the melody. We also
82// add some rests to the melody line and play two separate melody lines
83
84(
85var fib, bass, mel, ending,tune;
86
87fib = #[60, 62, 63, 65, 68, 73];
88
89bass = Pbind(
90	\tempo, 1.4,
91	\legato, 0.1,
92	\dur, Pseq([1], 5),
93	\midinote, Pxrand(fib - 24, 5)
94);
95mel = Pbind(
96	\tempo, 1.4,
97	\legato, Prand([1,1,1/2,1/3, 1/5, 1/8], inf),
98	\dur, Pshuf([1,1,Pseq([1/2],2),Pseq([1/3],3), Pseq([1/5], 5)], 1),
99	\midinote, Prand( fib ++ [\rest, \rest] , 10)
100);
101
102tune = Pseq([
103			Ppar([ bass, mel, mel ],2),
104			Padd(\ctranspose, 7,  Ppar([ bass, mel, mel ],2)),
105			Padd(\ctranspose, -7, Ppar([ bass, mel, mel ],2))
106		], 2);
107
108tune.play
109
110)
111
112// Back to the overtone scale now. Here is a simple example, using
113// a randomly "pulsating" ot scale and shuffled long bass notes with even
114// durations in 5/4. This is then chromatically transposed upto a 5th and
115// in steps following the ot scale
116
117(
118var ot,c, b, m;
119
120ot = #[60, 62, 64, 66, 67, 69, 70, 71];
121
122c = Pbind(\dur, 0.1,
123		\amp, Pseq([ Pgeom(0.2,0.95,50)],2),
124		\midinote, Prand( ot-12, inf),
125		\legato, 0.2,
126		\pan, Pfunc({1.0.rand2})
127	);
128
129b = Pbind( \dur, Prand([5,Pseq([1,1,1,1,1]), Pseq([3,2]) ], 2),
130		\amp, Pfunc( {XLine.kr(0.001,0.1, 0.5)} ),
131		\midinote, Pshuf( ot-24)
132	);
133
134Paddp(\ctranspose,
135	Pseq([0,2,4,6,7], inf), Ppar([b,c])).play
136
137)
138
139
140// You might also consider removing the 1/5 in the melody duration
141// if fast "dallapiccolas" upset You! Here I changed it to 3 1/3 notes
142(
143var fib, bass, mel, ending,tune;
144
145fib = #[60, 62, 63, 65, 68, 73];
146
147bass = Pbind(
148 \tempo, 1.5,
149 \legato, 0.1,
150 \dur, Pseq([1], 5),
151 \midinote, Pxrand(fib - 24, 5)
152);
153mel = Pbind(
154 \tempo, 1.5,
155 \legato, Prand([1,1,1/2,1/3, 1/5, 1/8], inf),
156 \dur, Pshuf([1,1,Pseq([1/2],2),Pseq([1/3],3), Pseq([1/3], 3)], 1),
157 \midinote, Prand( fib ++ [\rest, \rest] , 10)
158);
159
160tune = Pseq([
161   Ppar([ bass, mel, mel ],2),
162   Padd(\ctranspose, 7,  Ppar([ bass, mel, mel ],2)),
163   Padd(\ctranspose, -7, Ppar([ bass, mel, mel ],2))
164  ], inf);
165
166tune.play
167
168)
169
170// Now write Your own piece with the fib and ot scales!
171// Or just play around with these simple ones
172