Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 078283e467
Fetching contributors…

Cannot retrieve contributors at this time

46 lines (38 sloc) 1.084 kb
#!/usr/bin/env python
FLAT = '\342\231\255'
SHARP = '\342\231\257'
def get_key_name(scale, key):
if 'Minor' in scale:
# transpose key to its relative minor
key = minorkeys[keys.index(key)]
return key.replace('es', FLAT).replace('is', SHARP).upper()
keys = [ 'c', 'g', 'd', 'a', 'e', 'f', 'bes', 'ees', 'aes' ]
minorkeys = [ 'a', 'e', 'b', 'fis', 'cis', 'd', 'g', 'c', 'f' ]
scales = [
'Major',
'HarMinor',
'MelMinor',
'Dorian',
'Lydian',
'Mixolydian',
'Blues',
'Pentatonic',
]
time = {
'Pentatonic': r'\time 6/4',
'Blues': r'\time 7/4',
}
scalenames = {
'HarMinor': 'har. minor',
'MelMinor': 'mel. minor asc.',
'Pentatonic' : 'Pent.',
}
for scale in scales:
print '{'
print "\override Score.RehearsalMark #'self-alignment-X = #LEFT"
print time.get(scale, r'\time 8/4')
for key in keys:
print r'\mark \markup { %s %s }' % (
get_key_name(scale, key), scalenames.get(scale, scale))
print r'\key %s \major \transpose c %s \%s' % (key, key, scale)
print '}'
Jump to Line
Something went wrong with that request. Please try again.