Skip to content

Commit

Permalink
three blind mice example from talk
Browse files Browse the repository at this point in the history
  • Loading branch information
jtauber committed Mar 18, 2013
1 parent 1059931 commit e05d3cd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions projects/three_blind_mice/.gitignore
@@ -0,0 +1 @@
*.mid
19 changes: 19 additions & 0 deletions projects/three_blind_mice/three_blind_mice.py
@@ -0,0 +1,19 @@
#!/usr/bin/env python

from sebastian.lilypond.interp import parse
from sebastian.midi import write_midi

# construct sequences using lilypond syntax
seq1 = parse("e4. d c r")
seq2 = parse("g4. f4 f8 e4.")
seq2a = parse("r4.")
seq2b = parse("r4 g8")
seq3 = parse("c'4 c'8 b a b c'4 g8 g4")
seq3a = parse("g8")
seq3b = parse("f8")

# concatenate
mice = (seq1 * 2) + (seq2 + seq2a) + (seq2 + seq2b) + ((seq3 + seq3a) * 2) + (seq3 + seq3b) + seq1

# write to MIDI
write_midi.write("mice.mid", [mice])

0 comments on commit e05d3cd

Please sign in to comment.