-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdelay_test.go
56 lines (52 loc) · 1.48 KB
/
delay_test.go
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
package sc
import (
"testing"
)
func TestDelayC(t *testing.T) {
defName := "DelayCTest"
def := NewSynthdef(defName, func(p Params) Ugen {
bus, dust := C(0), Dust{Density: C(1)}.Rate(AR).Mul(C(0.5))
noise := WhiteNoise{}.Rate(AR)
decay := Decay{In: dust, Decay: C(0.3)}.Rate(AR).Mul(noise)
sig := Delay{
Interpolation: InterpolationCubic,
In: decay,
MaxDelayTime: C(0.2),
DelayTime: C(0.2),
}.Rate(AR).Add(decay)
return Out{bus, sig}.Rate(AR)
})
compareAndWrite(t, defName, def)
}
func TestDelayL(t *testing.T) {
defName := "DelayLTest"
def := NewSynthdef(defName, func(p Params) Ugen {
bus, dust := C(0), Dust{Density: C(1)}.Rate(AR).Mul(C(0.5))
noise := WhiteNoise{}.Rate(AR)
decay := Decay{In: dust, Decay: C(0.3)}.Rate(AR).Mul(noise)
sig := Delay{
Interpolation: InterpolationLinear,
In: decay,
MaxDelayTime: C(0.2),
DelayTime: C(0.2),
}.Rate(AR).Add(decay)
return Out{bus, sig}.Rate(AR)
})
compareAndWrite(t, defName, def)
}
func TestDelayN(t *testing.T) {
defName := "DelayNTest"
def := NewSynthdef(defName, func(p Params) Ugen {
bus, dust := C(0), Dust{Density: C(1)}.Rate(AR).Mul(C(0.5))
noise := WhiteNoise{}.Rate(AR)
decay := Decay{In: dust, Decay: C(0.3)}.Rate(AR).Mul(noise)
sig := Delay{
Interpolation: InterpolationNone,
In: decay,
MaxDelayTime: C(0.2),
DelayTime: C(0.2),
}.Rate(AR).Add(decay)
return Out{bus, sig}.Rate(AR)
})
compareAndWrite(t, defName, def)
}