-
Notifications
You must be signed in to change notification settings - Fork 2
/
ADSR_test.go
67 lines (64 loc) · 3.07 KB
/
ADSR_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
57
58
59
60
61
62
63
64
65
66
package signals
import (
"fmt"
"strings"
)
func ExampleADSREnvelope() {
s := NewADSREnvelope(unitX, unitX, unitX, unitY/2, unitX)
for t := x(0); t < 5*unitX; t += unitX / 10 {
fmt.Println(s.property(t), strings.Repeat(" ", int(s.property(t)/(unitY/33))+33)+"X")
}
fmt.Println()
/* Output:
0.00% X
10.00% X
20.00% X
30.00% X
40.00% X
50.00% X
60.00% X
70.00% X
80.00% X
90.00% X
100.00% X
95.00% X
90.00% X
85.00% X
80.00% X
75.00% X
70.00% X
65.00% X
60.00% X
55.00% X
50.00% X
50.00% X
50.00% X
50.00% X
50.00% X
50.00% X
50.00% X
50.00% X
50.00% X
50.00% X
50.00% X
45.00% X
40.00% X
35.00% X
30.00% X
25.00% X
20.00% X
15.00% X
10.00% X
5.00% X
0.00% X
0.00% X
0.00% X
0.00% X
0.00% X
0.00% X
0.00% X
0.00% X
0.00% X
0.00% X
*/
}