-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSonifyByDay.scd
73 lines (59 loc) · 1.36 KB
/
SonifyByDay.scd
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
// =====================================================================
// SuperCollider Workspace
// =====================================================================
f = FileReader.read("/Users/Home_KV//Downloads/magnetic_storm_14-20:06:2016/20120714MSTK.F01.txt", true, true); // read the content of the file
//f = FileReader.read("/Users/Home_KV/Dev/CosmoSonics/Data/20100603MSTK_f.txt", true, true);
(
~dataFunc = {|day = 0|
~dayData = f[day].asFloat
}
)
(
Ndef(\daySonifier, {
var sig;
sig = Mix.ar([SinOsc.ar(\freq.kr(180))]);
sig = sig.dup * 0.8;
Pan2.ar(sig.sum);
}).play;
)
(
~counter = 0;
Tdef(\setDayVal, {
f.size.do{
~counter = ~counter + 1 % f.size;
~dayValues = ~dataFunc.value(day: ~counter).postln;
{
Splay.ar(
SinOsc.ar(~dayValues.drop(1))
)
* EnvGen.kr(Env.perc(0.01, 0.01), doneAction:2)
}.play;
0.08.wait;
}
}).play
)
Tdef(\setDayVal).pause;
MKtl.find
j = MKtl('hid_1_logite', "logitech-extreme-3d-pro");
j.postElements
j.gui
j.elAt(\bt, \1).action_({|bt| })
(
~counter = 0;
Spec.add(\day, [0, f.size -1, \lin]);
j.elAt(\bt, \1).action_({|but|
if(but.value == 1){
{
~counter = ~counter + 1 % f.size;
~dayValues = ~dataFunc.value(day: ~counter);
Splay.ar(
SinOsc.ar(
~dayValues.drop(1) / 2, mul:0.3
) * EnvGen.kr(Env.perc(0.01, 0.1), doneAction:2)
)
}.play;
~dayValues.postln
}
})
)
j.gui