-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathball_test.go
More file actions
42 lines (38 loc) · 786 Bytes
/
ball_test.go
File metadata and controls
42 lines (38 loc) · 786 Bytes
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
package sc
import (
"testing"
)
func TestBall(t *testing.T) {
const defName = "BallTest"
// var sf = LFNoise0.ar(MouseX.kr(1, 100, 1));
// var g = MouseY.kr(0.1, 10, 1);
// var f = Ball.ar(sf, g, 0.01, 0.01);
// f = f * 140 + 500;
// SinOsc.ar(f, 0, 0.2)
compareAndWriteStructure(t, defName, NewSynthdef(defName, func(p Params) Ugen {
sf := A(LFNoise{
Interpolation: NoiseStep,
Freq: K(MouseX{
Min: C(1),
Max: C(100),
Warp: WarpExp,
}),
})
g := K(MouseY{
Min: C(0.1),
Max: C(10),
Warp: WarpExp,
})
f := A(Ball{
In: sf,
Gravity: g,
Damp: C(0.01),
Friction: C(0.01),
})
f = f.MulAdd(C(140), C(500))
return Out{
Bus: C(0),
Channels: SinOsc{Freq: f}.Rate(AR).Mul(C(0.2)),
}.Rate(AR)
}))
}