mzk- 🎸 music theory helper 🎵 |
git clone git://git.acid.vegas/mzk.git |
Log | Files | Refs | Archive | README | LICENSE |
constants.py (4602B)
1 #!/usr/bin/env python 2 # mzk music theory helper - developed by acidvegas in python (https://git.acid.vegas/mzk) 3 # constants.py 4 5 chords = { 6 'major' : {'symbol':'', 'pattern':'1 3 5'}, 7 'minor' : {'symbol':'m', 'pattern':'1 b3 5'}, 8 '7th' : {'symbol':'7', 'pattern':'1 3 5 b7'}, 9 'minor_7th' : {'symbol':'m7', 'pattern':'1 b3 5 b7'}, 10 'major_7th' : {'symbol':'maj7', 'pattern':'1 3 5 7'}, 11 'minor_7th_flat_5th' : {'symbol':'m7b5', 'pattern':'1 b3 b5 b7'}, 12 'suspended_4th' : {'symbol':'sus4', 'pattern':'1 4 5'}, 13 'diminished' : {'symbol':'dim', 'pattern':'1 b3 b5'}, 14 'augmented' : {'symbol':'aug', 'pattern':'1 3 #5'}, 15 '6th' : {'symbol':'6', 'pattern':'1 3 5 6'}, 16 'minor_6th' : {'symbol':'m6', 'pattern':'1 b3 5 6'}, 17 'minor_6th_add_9th' : {'symbol':'6add9', 'pattern':'1 3 5 6 9'}, 18 '9th' : {'symbol':'9', 'pattern':'1 3 5 b7 9'}, 19 'minor_9th' : {'symbol':'m9', 'pattern':'1 b3 5 b7 9'}, 20 'major_9th' : {'symbol':'maj9', 'pattern':'1 3 5 7 9'} 21 } 22 23 circle = ''' major 24 25 C 26 F G 27 â™® 28 1â™ 1♯ 29 a 30 Bâ™ d c D 31 2â™ 2♯ 32 g minor b 33 34 35 Eâ™ 3â™ c f♯ 3♯ A 36 37 38 f c♯ 39 4â™ 4 40 Aâ™ bâ™ g♯ E 41 eâ™/d♯ 42 5â™/7♯ 7â™/5♯ 43 6â™/6♯ 44 Dâ™ B 45 Gâ™/F♯ 46 C♯ Câ™''' 47 48 colors = { 49 'gray' : '\033[0;90m', 50 'red' : '\033[0;91m', 51 'green' : '\033[0;92m', 52 'reset' : '\033[0m' 53 } 54 55 compound_intervals = { 56 'minor_ninth' : {'semitones':13, 'short_name':'m9'}, 57 'major_ninth' : {'semitones':14, 'short_name':'M9'}, 58 'minor_tenth' : {'semitones':15, 'short_name':'m10'}, 59 'major_tenth' : {'semitones':16, 'short_name':'M10'}, 60 'perfect_eleventh' : {'semitones':17, 'short_name':'P11'}, 61 'augmented_eleventh' : {'semitones':18, 'short_name':'TT'}, 62 'perfect_twelfth' : {'semitones':19, 'short_name':'P12'}, 63 'minor_thirteenth' : {'semitones':20, 'short_name':'m13'}, 64 'major_thirteenth' : {'semitones':21, 'short_name':'M13'}, 65 'minor_fourteenth' : {'semitones':22, 'short_name':'m14'}, 66 'major_fourteenth' : {'semitones':23, 'short_name':'M14'}, 67 'double_octave' : {'semitones':24, 'short_name':'15ma'} 68 } 69 70 intervals = { 71 'perfect_unison' : {'semitones':0, 'short_name':'P1'}, 72 'minor_second' : {'semitones':1, 'short_name':'m2'}, 73 'major_second' : {'semitones':2, 'short_name':'M2'}, 74 'minor_third' : {'semitones':3, 'short_name':'m3'}, 75 'major_third' : {'semitones':4, 'short_name':'M3'}, 76 'perfect_fourth' : {'semitones':5, 'short_name':'P4'}, 77 'tritone' : {'semitones':6, 'short_name':'TT'}, # diminished fifth / augmented fourt 78 'perfect_fifth' : {'semitones':7, 'short_name':'P5'}, 79 'minor_sixth' : {'semitones':8, 'short_name':'m6'}, 80 'major_sixth' : {'semitones':9, 'short_name':'M6'}, 81 'minor_seventh' : {'semitones':10, 'short_name':'m7'}, 82 'major_seventh' : {'semitones':11, 'short_name':'M7'}, 83 'perfect_octave' : {'semitones':12, 'short_name':'P8'} 84 } 85 86 notes = ('A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#') # Chromatic scale 87 numerals = ('I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII') 88 scale_degrees = ('tonic','supertonic','mediant','subdominant','dominant''submediant','subtonic') 89 90 scales = { 91 'algerian' : '2131131', 92 'aeolian' : '2122122', 93 'blues' : '321132', 94 'dorian' : '2122212', 95 'half_whole_diminished' : '12121212', 96 'harmonic_minor' : '2122131', 97 'ionian' : '2212221', 98 'locrian' : '1221222', 99 'lydian' : '2221221', 100 'major' : '2212221', 101 'major_pentatonic' : '22323', 102 'melodic_minor' : '2122221', 103 'mixolydian' : '2212212', 104 'natural_minor' : '2122122', 105 'persian' : '1311231', 106 'phrygian' : '1222122', 107 'whole_half_diminished' : '21212121', 108 'whole_tone' : '2222222' 109 }