-
Notifications
You must be signed in to change notification settings - Fork 51
/
03.ex-euclidean.py
executable file
·41 lines (34 loc) · 1017 Bytes
/
03.ex-euclidean.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
#!/usr/bin/env python3
#------------------------------------------------------------------------
# isobar: ex-euclidean
#
# Uses Euclidean rhythms to generate multiple polyrhythmic voices.
#------------------------------------------------------------------------
from isobar import *
import logging
def main():
timeline = Timeline(100)
timeline.schedule({
"note": 60 * PEuclidean(5, 8),
"duration": 0.25
}, delay=0.0)
timeline.schedule({
"note": 62 * PEuclidean(5, 13),
"duration": 0.5
}, delay=0.25)
timeline.schedule({
"note": 64 * PEuclidean(7, 15),
"duration": 0.5
}, delay=0.5)
timeline.schedule({
"note": 67 * PEuclidean(6, 19),
"duration": 0.25
}, delay=0.75)
timeline.schedule({
"note": 71 * PEuclidean(7, 23),
"duration": 0.5
}, delay=1.0)
timeline.run()
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, format="[%(asctime)s] %(message)s")
main()