Skip to content

Instantly share code, notes, and snippets.

@minism
Created March 2, 2012 00:35
Show Gist options
  • Save minism/1954294 to your computer and use it in GitHub Desktop.
Save minism/1954294 to your computer and use it in GitHub Desktop.
modes.py
def rotate(seq, n):
return seq[n:] + seq[:n]
diatonic = [2, 2, 1, 2, 2, 2, 1]
ionian = rotate(diatonic, 0)
dorian = rotate(diatonic, 1)
phrygian = rotate(diatonic, 2)
lydian = rotate(diatonic, 3)
mixolydian = rotate(diatonic, 4)
aeolean = rotate(diatonic, 5)
locrian = rotate(diatonic, 6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment