-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlive001inspectorNorse.ck
executable file
·103 lines (86 loc) · 1.83 KB
/
live001inspectorNorse.ck
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
102
103
500::ms => dur bit;
29 => int root;
Impulse kick =>TwoPole kp => dac;
50.0 => kp.freq; 0.99 => kp.radius; 1 => kp.gain;
Noise n => ADSR snare => TwoPole sp => dac;
800.0 => sp.freq; 0.9 => sp.radius; 0.1 => sp.gain;
snare.set(0.001,0.1,0.0,0.1);
Noise h => ADSR hihat => TwoPole hsp => dac;
5000.0 => hsp.freq; 0.9 => hsp.radius; 0.1 => hsp.gain;
hihat.set(0.001,0.1,0.0,0.1);
SawOsc bass => Envelope e => dac;
0.3 => bass.gain;
TriOsc mel => Envelope eMel => NRev rMel => dac;
0.3 => mel.gain;
0.1 => rMel.mix;
fun void kk()
{
while(true)
{
1.0 => kick.next;
1*bit => now;
}
}
fun void sn()
{
while(true)
{
bit => now;
snare.keyOn();
bit => now;
snare.keyOff();
}
}
fun void hh()
{
while(true)
{
bit/2 => now;
hihat.keyOn();
bit/2 => now;
hihat.keyOff();
}
}
fun void bs()
{
while(true)
{
Std.mtof( root -2) => bass.freq;e.keyOn(); bit/2 => now; e.keyOff();
Std.mtof( root + 10 ) => bass.freq; e.keyOn(); bit/2 => now; e.keyOff();
Std.mtof( root -2) => bass.freq; e.keyOn(); bit/2 => now; e.keyOff();
Std.mtof( root + 10 ) => bass.freq; e.keyOn(); bit/2 => now; e.keyOff();
0 => int i;
until ( i == 6 )
{
Std.mtof( root ) => bass.freq;e.keyOn(); bit/2 => now; e.keyOff();
Std.mtof( root + 12 ) => bass.freq; e.keyOn(); bit/2 => now; e.keyOff();
i++;
}
}
}
// melody
fun void ml()
{
0=> int iter;
// opciones de distancias de la nota raiz en semitonos
[67,62,0, 60,62,0,65, 0,62,0, 60,62,0, 57,0,62,0, 57,0,62,0, 57,0,62,0,60,62,0] @=> int opt[];
[ 2, 4,4, 4, 4,4, 2, 4, 4,4, 4, 4,2, 4,4, 4,4, 4,4, 2,4, 4,4, 4,4, 4, 4,4] @=> int optBit[];
while(true)
{
iter%opt.cap() => int i;
Std.mtof(opt[i]) => mel.freq;
eMel.keyOn();
bit/optBit[i] => now;
eMel.keyOff();
iter++;
}
}
spork~ kk();
spork~ sn();
spork~ hh();
spork~ bs();
spork~ ml();
while(true)
{
8*bit => now;
}