-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
49 lines (41 loc) · 1.12 KB
/
test.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
from scamp import *
# Here's the basic test:
test_run.play(show_lilypond=True)
# Ok, now let's spice it up a bit...
s = Session(tempo=50)
guitar = s.new_part("Guitar")
s.start_transcribing()
melody = [
(60, 1.0),
(72, 1.0)
]
for pitch_duration in melody:
guitar.play()
s.stop_transcribing().to_score().show()
melody = [ # This is really just a C chromatic scale
(60, 0.25), # C, quarter note
(64, 0.25), # E, quarter note
(67, 0.5), # G, half note
(72, 0.25), # C, quarter note
(76, 1.0), # E, whole note
(79, 0.25), # G, quarter note
(84, 0.25), # C, quarter note
(None, 0.25), # Quarter rest
(81, 0.5), # A, half note
(79, 0.25), # C, quarter note
(76, 0.5), # E, half note
(72, 0.125), # C, eighth note
(69, 0.125), # A, eighth note
(67, 0.125), # G, eighth note
(64, 0.125), # E, eighth note
(60, 0.5), # C, half note
(55, 0.25), # G, quarter note
(62, 0.25), # D, quarter note
(67, 0.5), # G, half note
(72, 0.25), # C, quarter note
(76, 0.25), # E, quarter note
(60, 1.0) # C, whole note
]
for pitch_duration in melody:
guitar.play()
s.stop_transcribing().to_score().show()