Skip to content

Instantly share code, notes, and snippets.

@dgrant
Last active December 14, 2015 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgrant/5156882 to your computer and use it in GitHub Desktop.
Save dgrant/5156882 to your computer and use it in GitHub Desktop.
I use this to generate some scales, arpeggios, triads, chords to practice.
#!/usr/bin/env python3
"""Generate technique practice schedule"""
import argparse
import datetime
import random
ALL_TYPES = \
{'Major Scales': ["G","D","B","Bb","Eb"],
'Harmonic Minor Scales': ["E","B","G#","G","C"],
'Melodic Minor Scales': ["E","B","G#","G","C"],
'Formula Pattern': ["C","Eb","E minor"],
'Chromatic Scales': ["C","D","E","F","G","A","B"],
'4-note Broken Major Chords': ["G","D","B","Bb","Eb"],
'4-note Broken Minor Chords': ["E","B","G#","G","C"],
'Dominant 7th Solid Chords': ["G","D","B","Bb","Eb"],
'Dominant 7th Broken Chords': ["G","D","B","Bb","Eb"],
'Diminished 7th Solid Chords': ["E","B","G#","G","C"],
'Diminished 7th Broken Chords': ["E","B","G#","G","C"],
'Arpeggios major/minor': ["G","D","B","Em","Bm"],
'Arpeggios 7th': ["Gdom7","Ddom7","Bb dom7","Edim","Bdim","Cdim"]}
def print_plan(how_many=1, print_dates=False):
""" Print random music technique """
today = datetime.datetime.today()
for delta in range(how_many):
print("----------------------------------------")
if print_dates is True:
print("Date:", (today + datetime.timedelta(delta)).date())
for key, values in list(ALL_TYPES.items()):
print(key + ",", end=' ')
print(random.choice(values))
print()
def parse_command_line():
""" parse command line arguments """
parser = argparse.ArgumentParser()
parser.add_argument('--dates', '-d', action='store_true',
default=False,
help='Print each random set with a date on it')
parser.add_argument('--num', '-n', default=1, type=int,
help='How many to generate')
return parser.parse_args()
def main():
""" main script """
args = parse_command_line()
print_plan(args.num, args.dates)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment