forked from ideoforms/isobar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03.ex-euclidean.py
More file actions
executable file
·37 lines (31 loc) · 897 Bytes
/
03.ex-euclidean.py
File metadata and controls
executable file
·37 lines (31 loc) · 897 Bytes
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
#!/usr/bin/env python3
#------------------------------------------------------------------------
# isobar: ex-euclidean
#
# Uses Euclidean rhythms to generate multiple polyrhythmic voices.
#------------------------------------------------------------------------
import isobar as iso
import logging
logging.basicConfig(level=logging.INFO, format="[%(asctime)s] %(message)s")
timeline = iso.Timeline(100)
timeline.schedule({
"note": 60 * iso.PEuclidean(5, 8),
"duration": 0.25
}, delay=0.0)
timeline.schedule({
"note": 62 * iso.PEuclidean(5, 13),
"duration": 0.5
}, delay=0.25)
timeline.schedule({
"note": 64 * iso.PEuclidean(7, 15),
"duration": 0.5
}, delay=0.5)
timeline.schedule({
"note": 67 * iso.PEuclidean(6, 19),
"duration": 0.25
}, delay=0.75)
timeline.schedule({
"note": 71 * iso.PEuclidean(7, 23),
"duration": 0.5
}, delay=1.0)
timeline.run()