Last active
March 3, 2023 20:08
-
-
Save spacekitcat/101fe3a275dbf68192b54edd2cb5b41e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
CHROMATIC_SCALE = deque(['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']) | |
MAJOR=[0, 2, 4, 5, 7, 9, 11] | |
MINOR=[0, 2, 3, 5, 7, 8, 10] | |
def printScaleLine(scale): | |
scaleOutputString='' | |
for x in scale: | |
scaleOutputString = scaleOutputString + x.ljust(3) | |
print(scaleOutputString.rjust(26)) | |
def computeScale(chromaticScale, hepatonicScaleIndices): | |
return [CHROMATIC_SCALE[i] for i in hepatonicScaleIndices] | |
print() | |
print('MAJOR SCALES'.rjust(20)) | |
for i in range(0, 12): | |
printScaleLine(computeScale(CHROMATIC_SCALE, MAJOR)) | |
CHROMATIC_SCALE.rotate(1) | |
print() | |
print('MINOR SCALES'.rjust(20)) | |
for i in range(0, 12): | |
printScaleLine(computeScale(CHROMATIC_SCALE, MINOR)) | |
CHROMATIC_SCALE.rotate(1) | |
print() |
Author
spacekitcat
commented
Mar 3, 2023
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment