The following solution defines a function to transpose each scale taking advantage of the mathematical properties of notes:
def notes_name(numbers):
notes = "C C# D D# E F F# G G# A A# B".split()
return [notes[(number % 12)] for number in numbers]
def transposition(notes, start):
index = start - notes[0]
return [(n + index) % 12 for n in notes]
def gen_scales():
c_scale = [0, 2, 4, 5, 7, 9, 11]
return [notes_name(transposition(c_scale, note)) for note in range(0, 12)]
for scale in gen_scales():
print " ".join(scale)