forked from ideoforms/isobar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex-basics.py
More file actions
executable file
·29 lines (22 loc) · 896 Bytes
/
ex-basics.py
File metadata and controls
executable file
·29 lines (22 loc) · 896 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
#!/usr/bin/python
import isobar as iso
# create a repeating sequence with scalar transposition:
# [ 36, 38, 43, 39, ... ]
a = iso.PSeq([0, 2, 7, 3]) + 36
# apply pattern-wise transposition
# [ 36, 50, 43, 51, ... ]
a = a + iso.PSeq([0, 12])
# create a geometric chromatic series, repeated back and forth
b = iso.PSeries(0, 1, 12) + 72
b = iso.PPingPong(b)
b = iso.PLoop(b)
# create an velocity series, with emphasis every 4th note,
# plus a random walk to create gradual dynamic changes
amp = iso.PSeq([50, 35, 25, 35]) + iso.PBrown(0, 1, -20, 20)
# a Timeline schedules events at a given BPM.
# by default, send these over the first MIDI output.
output_device = iso.io.midi.MidiOut("IAC Driver IAC Bus 1")
timeline = iso.Timeline(120, device=output_device, debug=True)
# assign each of our Patterns to particular properties
timeline.sched({'note': a, 'dur': 1, 'gate': 2})
timeline.run()