Skip to content

Commit f66db45

Browse files
committed
Revert to simpler syntax for Timeline
1 parent a3fcdc8 commit f66db45

15 files changed

+82
-82
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ timeline = iso.Timeline(120)
4545
# Schedule events, with properties generated by the Pattern objects.
4646
#------------------------------------------------------------------------
4747
timeline.schedule({
48-
iso.EVENT_NOTE: arpeggio,
49-
iso.EVENT_DURATION: 0.25,
50-
iso.EVENT_AMPLITUDE: amplitude
48+
"note": arpeggio,
49+
"duration": 0.25,
50+
"amplitude": amplitude
5151
})
5252
```
5353

examples/00.ex-hello-world.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
timeline = iso.Timeline(120)
1717

1818
timeline.schedule({
19-
iso.EVENT_NOTE: series,
20-
iso.EVENT_DURATION: 1
19+
"note": series,
20+
"duration": 1
2121
})
2222

2323
timeline.run()

examples/01.ex-basics.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@
5454
# Schedule events, with properties generated by the Pattern objects.
5555
#------------------------------------------------------------------------
5656
timeline.schedule({
57-
iso.EVENT_NOTE: arpeggio,
58-
iso.EVENT_DURATION: 0.25,
59-
iso.EVENT_AMPLITUDE: amplitude
57+
"note": arpeggio,
58+
"duration": 0.25,
59+
"amplitude": amplitude
6060
})
6161
timeline.schedule({
62-
iso.EVENT_NOTE: bassline,
63-
iso.EVENT_DURATION: 1
62+
"note": bassline,
63+
"duration": 1
6464
})
6565

6666
timeline.run()

examples/02.ex-subsequence.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@
2424

2525
timeline = iso.Timeline(120)
2626
timeline.schedule({
27-
iso.EVENT_NOTE: sequence.copy(),
28-
iso.EVENT_AMPLITUDE: amp.copy(),
29-
iso.EVENT_DURATION: 0.25,
30-
iso.EVENT_GATE: gate.copy()
27+
"note": sequence.copy(),
28+
"amplitude": amp.copy(),
29+
"duration": 0.25,
30+
"gate": gate.copy()
3131
})
3232
timeline.schedule({
33-
iso.EVENT_NOTE: sequence.copy() + 24,
34-
iso.EVENT_AMPLITUDE: amp.copy(),
35-
iso.EVENT_DURATION: 0.5,
36-
iso.EVENT_GATE: gate.copy()
33+
"note": sequence.copy() + 24,
34+
"amplitude": amp.copy(),
35+
"duration": 0.5,
36+
"gate": gate.copy()
3737
})
3838
timeline.schedule({
39-
iso.EVENT_NOTE: sequence.copy() - 24,
40-
iso.EVENT_AMPLITUDE: 10 + amp.copy() * 0.5,
41-
iso.EVENT_DURATION: iso.PChoice([4, 4, 6, 8]),
42-
iso.EVENT_GATE: gate.copy()
39+
"note": sequence.copy() - 24,
40+
"amplitude": 10 + amp.copy() * 0.5,
41+
"duration": iso.PChoice([4, 4, 6, 8]),
42+
"gate": gate.copy()
4343
})
4444

4545
timeline.run()

examples/03.ex-euclidean.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@
1414
timeline = iso.Timeline(100)
1515

1616
timeline.schedule({
17-
iso.EVENT_NOTE: 60 * iso.PEuclidean(5, 8),
18-
iso.EVENT_DURATION: 0.25
17+
"note": 60 * iso.PEuclidean(5, 8),
18+
"duration": 0.25
1919
}, delay=0.0)
2020
timeline.schedule({
21-
iso.EVENT_NOTE: 62 * iso.PEuclidean(5, 13),
22-
iso.EVENT_DURATION: 0.5
21+
"note": 62 * iso.PEuclidean(5, 13),
22+
"duration": 0.5
2323
}, delay=0.25)
2424
timeline.schedule({
25-
iso.EVENT_NOTE: 64 * iso.PEuclidean(7, 15),
26-
iso.EVENT_DURATION: 0.5
25+
"note": 64 * iso.PEuclidean(7, 15),
26+
"duration": 0.5
2727
}, delay=0.5)
2828
timeline.schedule({
29-
iso.EVENT_NOTE: 67 * iso.PEuclidean(6, 19),
30-
iso.EVENT_DURATION: 0.25
29+
"note": 67 * iso.PEuclidean(6, 19),
30+
"duration": 0.25
3131
}, delay=0.75)
3232
timeline.schedule({
33-
iso.EVENT_NOTE: 71 * iso.PEuclidean(7, 23),
34-
iso.EVENT_DURATION: 0.5
33+
"note": 71 * iso.PEuclidean(7, 23),
34+
"duration": 0.5
3535
}, delay=1.0)
3636

3737
timeline.run()

examples/04.ex-permutations.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@
3737
#------------------------------------------------------------------------
3838
timeline = iso.Timeline(60)
3939
timeline.schedule({
40-
iso.EVENT_NOTE: ppitch + 60,
41-
iso.EVENT_DURATION: pdur,
42-
iso.EVENT_AMPLITUDE: pamp,
43-
iso.EVENT_CHANNEL: 0
40+
"note": ppitch + 60,
41+
"duration": pdur,
42+
"amplitude": pamp,
43+
"channel": 0
4444
})
4545
timeline.schedule({
46-
iso.EVENT_NOTE: ppitch + 24,
47-
iso.EVENT_DURATION: pdur * 4,
48-
iso.EVENT_AMPLITUDE: pamp,
49-
iso.EVENT_CHANNEL: 1,
50-
iso.EVENT_GATE: 2
46+
"note": ppitch + 24,
47+
"duration": pdur * 4,
48+
"amplitude": pamp,
49+
"channel": 1,
50+
"gate": 2
5151
})
5252
timeline.schedule({
53-
iso.EVENT_NOTE: ppitch + 72,
54-
iso.EVENT_DURATION: pdur / 2,
55-
iso.EVENT_CHANNEL: 1,
56-
iso.EVENT_GATE: 1,
57-
iso.EVENT_AMPLITUDE: pamp / 2
53+
"note": ppitch + 72,
54+
"duration": pdur / 2,
55+
"channel": 1,
56+
"gate": 1,
57+
"amplitude": pamp / 2
5858
})
5959

6060
#------------------------------------------------------------------------

examples/05.ex-piano-phase.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
# by two every note... try removing the .copy() and see what happens!
3131
#------------------------------------------------------------------------
3232
timeline.schedule({
33-
iso.EVENT_NOTE: seq.copy() + 60,
34-
iso.EVENT_DURATION: 0.5
33+
"note": seq.copy() + 60,
34+
"duration": 0.5
3535
})
3636
timeline.schedule({
37-
iso.EVENT_NOTE: seq.copy() + 72,
38-
iso.EVENT_DURATION: 0.5 * 1.01
37+
"note": seq.copy() + 72,
38+
"duration": 0.5 * 1.01
3939
})
4040

4141
#------------------------------------------------------------------------

examples/06.ex-walk.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
timeline = iso.Timeline(170)
2222
timeline.schedule({
23-
iso.EVENT_NOTE: notes,
24-
iso.EVENT_DURATION: 0.25,
25-
iso.EVENT_GATE: 0.9,
26-
iso.EVENT_AMPLITUDE: amp})
23+
"note": notes,
24+
"duration": 0.25,
25+
"gate": 0.9,
26+
"amplitude": amp})
2727
timeline.run()

examples/10.ex-lsystem-stochastic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
timeline = iso.Timeline(180)
2020

2121
timeline.schedule({
22-
iso.EVENT_NOTE: notes,
23-
iso.EVENT_DURATION: 0.25
22+
"note": notes,
23+
"duration": 0.25
2424
})
2525
timeline.run()

examples/11.ex-lsystem-rhythm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939

4040
timeline = iso.Timeline(120)
4141
timeline.schedule({
42-
iso.EVENT_NOTE: notes,
43-
iso.EVENT_AMPLITUDE: velocity,
44-
iso.EVENT_DURATION: times
42+
"note": notes,
43+
"amplitude": velocity,
44+
"duration": times
4545
})
4646
timeline.run()

0 commit comments

Comments
 (0)