Skip to content

Commit

Permalink
start of Game of Thrones Main Title
Browse files Browse the repository at this point in the history
  • Loading branch information
jtauber committed Mar 31, 2013
1 parent e8a7de8 commit 5398b44
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions projects/game_of_thrones/game_of_thrones.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
The main title theme to HBO's Game of Thrones by Ramin Djawadi
"""

from sebastian.core import Point, HSeq, OSequence
from sebastian.core.transforms import midi_pitch, degree_in_key, add
from sebastian.core.notes import Key, major_scale, minor_scale
from sebastian.midi import write_midi

C_Major = Key("C", major_scale)
C_minor = Key("C", minor_scale)

motive_degrees = HSeq(Point(degree=n) for n in [5, 1, 3, 4])

motive_rhythm_1 = HSeq(Point(duration_64=n) for n in [16, 16, 8, 8])
motive_rhythm_2 = HSeq(Point(duration_64=n) for n in [48, 48, 8, 8, 32, 32, 8, 8])

motive_1 = motive_degrees & motive_rhythm_1
motive_2 = (motive_degrees * 2) & motive_rhythm_2

# add key and octave
seq1 = (motive_1 * 4) | add({"octave": 5}) | degree_in_key(C_minor)
seq2 = (motive_1 * 4) | add({"octave": 5}) | degree_in_key(C_Major)
seq3 = motive_2 | add({"octave": 4}) | degree_in_key(C_minor)

seq = (seq1 + seq2 + seq3) | midi_pitch() | OSequence

write_midi.write("game_of_thrones.mid", [seq], instruments=[49], tempo=350000)

0 comments on commit 5398b44

Please sign in to comment.