mzk

- 🎸 music theory helper 🎵
git clone git://git.acid.vegas/mzk.git
Log | Files | Refs | Archive | README | LICENSE

main.py (1212B)

      1 #!/usr/bin/env python
      2 # mzk music theory helper - developed by acidvegas in python (https://git.acid.vegas/mzk)
      3 # main.py
      4 
      5 import sys
      6 
      7 sys.dont_write_bytecode = True
      8 
      9 import constants
     10 import functions
     11 
     12 if len(sys.argv) != 2:
     13 	functions.print_help()
     14 else:
     15 	print(sys.argv[1])
     16 	if sys.argv[1] == '--chords':
     17 		functions.print_chords()
     18 	elif sys.argv[1].startswith('--chord='):
     19 		chord = sys.argv[1][8:]
     20 		key   = chord.split('_')[0].upper()
     21 		type  = chord[len(key)+1:].lower()
     22 		if key in constants.notes and type in constants.chords:
     23 			functions.print_scale(key, type, chord=True)
     24 		else:
     25 			print('error: invalid key or chord type\n\n')
     26 			functions.print_help()
     27 	elif sys.argv[1] == '--circle':
     28 		functions.print_circle_of_fifths()
     29 	elif sys.argv[1] == '--intervals':
     30 		functions.print_intervals()
     31 	elif sys.argv[1].startswith('--scale='):
     32 		scale = sys.argv[1][8:]
     33 		key   = scale.split('_')[0].upper()
     34 		type  = scale[len(key)+1:].lower()
     35 		if key in constants.notes and type in constants.scales:
     36 			functions.print_scale(key, type)
     37 		else:
     38 			print('error: invalid key or chord type\n\n')
     39 			functions.print_help()
     40 	elif sys.argv[1] == '--scales':
     41 		functions.print_scales()
     42 	else:
     43 		functions.print_help()