-
Notifications
You must be signed in to change notification settings - Fork 0
/
tdfw.py
45 lines (41 loc) · 1.21 KB
/
tdfw.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
from ds import *
from ds.instruments import Marimba, Piano, Trumpet
def tdfw_mel(player, volume=127):
melody = [
Marimba('E6', 0.5, volume, 0),
Marimba('E6', 0.25, volume, 0.5),
Marimba('C6', 0.5, volume, 0.75),
Marimba('B5', 0.75, volume, 1.5),
Marimba('B5', 0.25, volume, 2.5),
Marimba('C6', 0.5, volume, 2.75),
Marimba('E5', 0.5, volume, 3.5),
]
notes = []
for note in melody:
notes.append(player.loop(note, 4))
return notes
def tdfw_bass(player, volume=127):
bassline = [
Piano('E2', 1, volume, 0),
Piano('E2', 2, volume, 1.5)
]
notes = []
for note in bassline:
notes.append(player.loop(note, 4))
return notes
def tdfw_alt(player, volume=127):
alt_mel = [
Trumpet('E4', 0.5, volume, 0),
Trumpet('E4', 0.5, volume, 0.75),
Trumpet('F4', 0.25, volume, 1.5),
Trumpet('E4', 0.25, volume, 2),
Trumpet('E4', 0.25, volume, 2.5),
Trumpet('E4', 0.25, volume, 3),
Trumpet('F4', 0.25, volume, 3.5),
]
notes = []
for note in alt_mel:
notes.append(player.loop(note, 4))
return notes
if __name__ == '__main__':
player = connect()