blob: 35e1a600581f220bd0b70e98930364fd183eb7d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/usr/bin/python
import aud, math, time
length = 0.5
fadelength = 0.05
runtime = 10
distance = 100
velocity = 2 * distance / runtime
device = aud.Device()
high = aud.Sound.sine(880).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length)
low = aud.Sound.sine(700).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length).volume(0.6)
sound = high.join(low)
handle = device.play(sound)
handle.loop_count = -1
handle.velocity = [velocity, 0, 0]
start = time.time()
while time.time() - start < runtime:
location = -distance + velocity * (time.time() - start)
handle.location = [location, 10, 0]
|