«Underwater» by Muse Score

on 24 Jan'23 12:50 in

This is my first piece of music in the world of supercollider.

https://www.youtube.com/watch?v=lpAUKkNgqhU

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
(
~divisors = {
	arg n;
	~divs = List.newClear(0);
	for( 1, floor(sqrt(n)), {arg i; if(n%i==0,{
			i.postln;
			~divs.add(i);
			(i==n.div(i)).postln;
			if(i==n.div(i),{},{~divs.add(n.div(i))});
		   },{});
		});
	~divs.sort;
	~divs;
};

SynthDef(\divsynth, { |out=0,divs = #[1],amp=1,sustain=1|
    var l,sig,env,n,sortedDivs;
    l = divs;
	n = divs.at(divs.size-1);
	sig = SinOsc.ar(1, 0, 0);
	l.do({ arg item, i;
        d = item;
		sig = sig+SinOsc.ar(d, 0, amp );
	});
	sig = sig*EnvGen.kr(Env.linen(0.001, sustain, 0.1), doneAction: Done.freeSelf);
    Out.ar(out, sig ! 2)
}).add;

r =Ppar([
	     Pbind(\instrument,\divsynth,
	      \amp,0.065,
	      \dur,Pseq(all{:1/log(x),x<-(1000..1002)},inf),
	     \divs,Pseq(all{:~divisors.value(x),x<-(1000..1002)},3*5),
			\sustain,Pseq(all{:log(x)/sqrt(x),x<-(1000..1002)},3*5)
         ),
	   Pbind(\instrument,\divsynth,
	      \amp,0.065,
	      \dur,Pseq(all{:1/log(x),x<-(1000..1003)},inf),
	     \divs,Pseq(all{:~divisors.value(x),x<-(1000..1003)},2*5),
	    \sustain,Pseq(all{:log(x)/sqrt(x),x<-(1000..1003)},2*5)
         ),
	   Pbind(\instrument,\divsynth,
	      \amp,0.065,
	      \dur,Pseq(all{:1/log(x),x<-(1000..1005)},inf),
	     \divs,Pseq(all{:~divisors.value(x),x<-(1000..1005)},2*3),
			\sustain,Pseq(all{:log(x)/sqrt(x),x<-(1000..1005)},2*3)
	)],1);

s =Ppar([
	     Pbind(\instrument,\divsynth,
	      \amp,0.065,
			\dur,Pseq(all{:1/(2*log(x)),x<-(500..502)},inf),
	     \divs,Pseq(all{:~divisors.value(x),x<-(500..502)},3*5)
         ),
	   Pbind(\instrument,\divsynth,
	      \amp,0.065,
	      \dur,Pseq(all{:1/(2*log(x)),x<-(500..503)},inf),
	     \divs,Pseq(all{:~divisors.value(x),x<-(500..503)},2*5)
         ),
	   Pbind(\instrument,\divsynth,
	      \amp,0.065,
	      \dur,Pseq(all{:1/(2*log(x)),x<-(500..505)},inf),
	     \divs,Pseq(all{:~divisors.value(x),x<-(500..505)},2*3)
	)],1);


t =Ppar([
	     Pbind(\instrument,\divsynth,
	      \amp,0.065,
			\dur,Pseq(all{:1/(3*log(x)),x<-(1000..1002)},inf),
	     \divs,Pseq(all{:~divisors.value(x),x<-(1000..1002)},3*5),
		\sustain,Pseq(all{:log(x)/sqrt(x),x<-(1000..1002)},3*5)
         ),
	   Pbind(\instrument,\divsynth,
	      \amp,0.065,
	      \dur,Pseq(all{:1/(3*log(x)),x<-(1000..1003)},inf),
	     \divs,Pseq(all{:~divisors.value(x),x<-(1000..1003)},2*5),
		 \sustain,Pseq(all{:log(x)/sqrt(x),x<-(1000..1003)},2*5)
         ),
	   Pbind(\instrument,\divsynth,
	      \amp,0.065,
	      \dur,Pseq(all{:1/(3*log(x)),x<-(1000..1005)},inf),
	     \divs,Pseq(all{:~divisors.value(x),x<-(1000..1005)},2*3),
		\sustain,Pseq(all{:log(x)/sqrt(x),x<-(1000..1005)},2*3)
	)],1);

m = Pseq([Pseq([s],1),
	Pseq([t],1),
	Ppar([t,s],2),
	Pseq([r],3),
	  Ppar([r,s],1),
	  Ppar([t,r],2),
	Ppar([r,s,t],3),
	Ppar([t,r],2),
	Ppar([r,s],1),
	Pseq([r],1)
],inf);

x= m.play(TempoClock(40/60));

);
raw 2920 chars (focus & ctrl+a+c to copy)
reception
comments