Advertisement
Guest User

Untitled

a guest
Feb 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. import random
  4.  
  5. keys = ['C' , 'Db', 'D' ,
  6.         'Eb', 'E' , 'F' ,
  7.         'Gb', 'G' , 'Ab',
  8.         'A' , 'Bb', 'B' ]
  9.  
  10. qualities = ["Major",
  11.              "minor",
  12.              "diminished",
  13.              "Augmented"]
  14.  
  15. positions = ["Root Position",
  16.              "1st Inversion",
  17.              "2nd Inversion"]
  18.  
  19. def generate_and_print_random_chord():
  20.     global key
  21.     global quality
  22.     global position
  23.     key      = random.choice(keys)
  24.     quality  = random.choice(qualities)
  25.     position = random.choice(positions)
  26.     print(key, quality, "in", position)
  27.  
  28. while True:
  29.     generate_and_print_random_chord()
  30.     wait = input() # click <return> to continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement