-
Notifications
You must be signed in to change notification settings - Fork 0
/
sound.py
54 lines (52 loc) · 1.14 KB
/
sound.py
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
from symrep import *
import sys
n = sum(
product(
const(0.3),
product(
audio.sine(const(440), name="tuner"),
audio.sine(const(0.5)),
)
),
product(
const(0.2),
audio.sine(
product(
const(400),
piecewise(
audio.sawtooth(const(1)),
const(1),
const(1),
),
),
name="riser",
)
),
product(
const(0.3),
audio.sine(const(220), name="thing"),
),
product(
audio.sine(const(140), name="kick1"),
audio.square(const(2), const(0.05)),
),
product(
const(0.5),
audio.sine(const(100), name="kick2"),
shift(
audio.square(const(2), const(0.05)),
const(0.25),
)
),
product(
const(0.2),
audio.sine(const(523), name="duty"),
audio.square(
const(2),
audio.sawtooth(const(1. / 60.)),
),
)
)
with open("sound.dot", "w") as f:
to_dot(n, f)
audio.stream_pcm(n, 44100, sys.stdout)