#! /usr/local/bin/python
# takes one argument: an integer representing the position in
# the set of keys (beginning with 'A')
# takes one argument: an integer representing the position in
# the set of keys (beginning with 'A')
# key number
# A 0
# Bb 1
# B 2
# C 3
# C# 4
# D 5
# Eb 6
# E 7
# F 8
# F# 9
# G 10
# Ab 11
import sys
# the key the user requested on the command line
requested_key = int(sys.argv[1])
# the set of keys (equivalent to the chromatic scale)
# (two octaves used to make the script simpler)
key_set = ('A', 'Bb', 'B', 'C', 'C#', 'D', 'Eb', 'E', 'F', 'F#', 'G', 'Ab', 'A', 'Bb', 'B', 'C', 'C#', 'D', 'Eb', 'E', 'F', 'F#', 'G', 'Ab')
# the intervals (the spacing) in the diatonic scale
# (interval = number of steps in the chromatic scale from one step to another step)
diatonic_scale_intervals_set = (2, 2, 1, 2, 2, 2, 1)
cur_key_set_position = requested_key
print key_set[cur_key_set_position],
for interval in diatonic_scale_intervals_set:
cur_key_set_position = cur_key_set_position + interval
print '%s ' % key_set[cur_key_set_position],