-
Notifications
You must be signed in to change notification settings - Fork 51
/
06.ex-walk.py
executable file
·35 lines (29 loc) · 1.13 KB
/
06.ex-walk.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
#!/usr/bin/env python3
#------------------------------------------------------------------------
# isobar: ex-walk
#
# Brownian walk around a scale.
#------------------------------------------------------------------------
from isobar import *
import logging
def main():
#------------------------------------------------------------------------
# walk up and down a minor scale
#------------------------------------------------------------------------
scale = Scale([0, 2, 3, 7, 9, 11])
degree = PBrown(0, 2, -8, 16)
notes = PDegree(degree, scale) + 60
#------------------------------------------------------------------------
# add a slight 4/4 emphasis and moderate variation in velocity
#------------------------------------------------------------------------
amp = PSequence([40, 30, 20, 25]) + PBrown(0, 2, -10, 10)
timeline = Timeline(170)
timeline.schedule({
"note": notes,
"duration": 0.25,
"gate": 0.9,
"amplitude": amp})
timeline.run()
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, format="[%(asctime)s] %(message)s")
main()