Skip to content

Commit 2430a78

Browse files
committed
First time adding the files
0 parents  commit 2430a78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+726
-0
lines changed

Diff for: Generate_guitar_exercises.py

+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
#!/bin/python2
2+
"""
3+
Input example:
4+
python2 thisprogram.py 2 2 4 2 2
5+
Each number declares how many of the corresponding exercises are produced
6+
7+
If there is no input, then there is a helpful prompt.
8+
"""
9+
# Set those for Aebersold's patterns
10+
Maj251Patterns=range(1,9)
11+
Min251Patterns=range(1,9)
12+
13+
import sys
14+
import os
15+
from collections import OrderedDict
16+
from Generate_guitar_exercises_definitions import *
17+
18+
# Dictionary as follows:
19+
# { Function name : [description,number of exercises],
20+
# ...
21+
# }
22+
# In other words, for x in the exercises
23+
# - x is the function
24+
# - Exercise[x][0] is the description
25+
# - Exercise[x][1] is the number of exercises
26+
27+
Exercises=OrderedDict([
28+
(BilliesBounce,["Billie's bounce",0]),
29+
(IIVIVI_improvlines,["2-5-1-6 Improv lines",0]),
30+
(ScalePracticeTechniques,["Scale practice technique",0]),
31+
(IIVILineExample,["2-5-1 Line examples",0]),
32+
(ApproachBluesInF,["Approach: Blues in F",0]),
33+
# (Scale,["Scales",0]),
34+
# (Triad,["Triads",0]),
35+
# (Moving_treble,["Moving trebles",0]),
36+
# (Diatonic_chords_within_a_CAGED_form,["Diatonic chords",0]),
37+
(II_V_I_Aebersold_patterns,["Aebersold II-V-I patterns",0]),
38+
# (Sight_reading_studies,["Sight-reading (Leavitt)",0]),
39+
# (Technique_patterns,["Technique: patterns",0]),
40+
# (Technique_right_hand_fingers,["Technique: right hand fingers",0]),
41+
# (Technique_right_hand_picking,["Technique: right hand picking",0])
42+
])
43+
44+
# Input prompt
45+
Input_prompt=""
46+
for e in Exercises:
47+
Input_prompt+= '%d. %s\n' % (Exercises.keys().index(e)+1,Exercises[e][0])
48+
Input_prompt+=" --- Press <C-c> to exit, or enter numbers of exercises separated by spaces.\n\n"
49+
50+
# Set some variables according to whether we are doing latex or not
51+
TexMode=False
52+
ExtraArgs=1 # Number of input strings other than exercise numbers
53+
if len(sys.argv) > 1:
54+
if sys.argv[1] in ["-t","--tex-mode"]:
55+
TexMode=True
56+
ExtraArgs=2
57+
AebDict=dict()
58+
MyTitle = raw_input("Enter title (press return for \"Guitar exercises\"): ")
59+
60+
# Setting how many times we do each exercise
61+
if len(sys.argv)==len(Exercises)+ExtraArgs: # User gave arguments correctly
62+
TimesEachExercise=[int(i) for i in sys.argv[ExtraArgs:]]
63+
else: # No user input or input not given correctly
64+
InputNums = raw_input(Input_prompt)
65+
TimesEachExercise = [int(i) for i in InputNums.split() if i.isdigit()]
66+
while len(TimesEachExercise) != len(Exercises):
67+
print "\nSomething was wrong, try again: "
68+
InputNums = raw_input()
69+
TimesEachExercise = [int(i) for i in InputNums.split() if i.isdigit()]
70+
for e in Exercises:
71+
i=Exercises.keys().index(e)
72+
Exercises[e][1]=TimesEachExercise[i]
73+
74+
List_of_exercises=[]
75+
for e in Exercises:
76+
# The following is a special case, since we need the scans
77+
if e.__name__=='II_V_I_Aebersold_patterns':
78+
for i in range(Exercises[e][1]):
79+
AebOutput=e(Maj251Patterns,Min251Patterns)
80+
AebExercise=AebOutput[0]
81+
AebPatternLabel=AebOutput[1]
82+
if TexMode:
83+
AebDict[AebPatternLabel]=AebDict.get(AebPatternLabel,0)+1
84+
s = '\t\item %s \label{%s-%d}\\dotfill$\square$\n' % (AebExercise,AebPatternLabel,AebDict[AebPatternLabel])
85+
else:
86+
s = AebOutput[0]
87+
List_of_exercises.append(s)
88+
# If you have any other special exercises, elif them here
89+
# Continuing with radom regular exercises
90+
else:
91+
for i in range(Exercises[e][1]):
92+
if TexMode:
93+
s = '\t\item %s\\dotfill$\square$\n' % (e())
94+
else:
95+
s = e()
96+
List_of_exercises.append(s)
97+
98+
random.shuffle(List_of_exercises)
99+
100+
if TexMode:
101+
# Overview of exercises
102+
IncludedExercises="\\section*{Overview}\n\\begin{itemize}\n"
103+
for e in Exercises:
104+
if Exercises[e][1]>0:
105+
IncludedExercises+='\item %s: %d\n' % (Exercises[e][0],Exercises[e][1])
106+
IncludedExercises+="\\end{itemize}"
107+
108+
# Take care of the figures, if any
109+
IIVIFiguresParagraph= ""
110+
if Exercises[II_V_I_Aebersold_patterns][1]>0: # There exist Aebersold 251 exercises
111+
Items_for_251_figures=[]
112+
for pattern in AebDict:
113+
s="\\item Used in \\cref{"
114+
for i in range(AebDict[pattern]-1):
115+
s+='%s-%d,' % (pattern,i+1)
116+
s+= '%s-%d}' % (pattern,AebDict[pattern])
117+
s+= "\n\\newline\\newline\n"
118+
s+= '\\includegraphics[width=0.8\\linewidth]{scans251/%s.png}' % (pattern)
119+
Items_for_251_figures.append(s)
120+
121+
IIVIFiguresParagraph= "\n\\section*{II-V-I patterns}\n"
122+
IIVIFiguresParagraph+= "\\begin{itemize}\n"
123+
for i in Items_for_251_figures:
124+
IIVIFiguresParagraph+=i
125+
IIVIFiguresParagraph+= "\n\\end{itemize}\n"
126+
127+
TexOutput=""
128+
TexOutput+="\documentclass[letterpaper]{article}\n"
129+
TexOutput+="\usepackage[top=1in, left=1.2in, right=1.2in, bottom=1.5in]{geometry}\n"
130+
TexOutput+="\usepackage{amssymb,graphicx,enumitem,cleveref}\n"
131+
TexOutput+="\crefname{enumi}{exercise}{exercises}\n"
132+
if MyTitle:
133+
TexOutput+='\\title{%s}\n\date{\\vspace{-3em}\\today}\n' % (MyTitle)
134+
else:
135+
TexOutput+="\\title{Guitar exercises}\n\date{\\vspace{-3em}\\today}\n"
136+
TexOutput+="\n\\author{}\n"
137+
TexOutput+="\\begin{document}\n"
138+
TexOutput+="\\maketitle\n"
139+
TexOutput+=IncludedExercises
140+
TexOutput+="\n\\section*{Exercises}"
141+
TexOutput+="\\begin{enumerate}\n"
142+
for e in List_of_exercises:
143+
x=e.replace("flat","$\\flat$")
144+
x=x.replace("#","$\\sharp$")
145+
TexOutput+=x
146+
TexOutput+="\\end{enumerate}\n"
147+
148+
TexOutput+=IIVIFiguresParagraph
149+
TexOutput+="\n\\end{document}\n"
150+
151+
f = open("Tex/GuitarExercises.tex", "w")
152+
f.write(TexOutput)
153+
f.close()
154+
155+
for i in range(3):
156+
os.system("sh -c 'cd Tex && pdflatex -interaction=nonstopmode GuitarExercises.tex'")
157+
os.system("sh -c 'cd Tex && zathura GuitarExercises.pdf &'")
158+
159+
160+
else:
161+
for e in List_of_exercises:
162+
print e.replace("flat","b")
163+
164+

Diff for: Generate_guitar_exercises_definitions.py

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
import random
2+
from random import randint
3+
4+
Forms=['C','A','G','E','D']
5+
Keys= ['A', 'Aflat', 'B', 'Bflat', 'C', 'D', 'Dflat', 'E', 'Eflat', 'F', 'F#', 'G', 'Gflat','C#','Cb']
6+
FullKeys= ['A', 'A#', 'Aflat', 'B', 'B#', 'Bflat', 'C', 'C#', 'Cflat', 'D', 'D#', 'Dflat', 'E', 'E#', 'Eflat', 'F', 'F#', 'Fflat', 'G', 'G#', 'Gflat']
7+
FourNoteChordsQualities=['maj7','7','m7','m7flat5']
8+
TriadQualities=['','m','dim','aug']
9+
Asc_OR_Desc=["ascending","descending"]
10+
MaybeTwelveFret=[".",", above the 12th fret."]
11+
TriadWays=(['fifth',1],['third',2],['root',3],['fifth',4],['third',5],['root',6])
12+
Patterns=['1234','13','123456','135','16']
13+
MajorModes=['ionian','dorian','frygian','lydian','mixolydian','aeolian','locrian']
14+
15+
########## February 2017 #####
16+
def BilliesBounce():
17+
what=random.choice(["Theme","Solo"])
18+
return 'Study Billie\'s bounce: %s' % (what)
19+
20+
def IIVIVI_improvlines():
21+
exercnum=random.choice(range(1,6))
22+
form=random.choice(Forms)
23+
return 'Play line example %d in %s form over Dm7 G7 Cmaj7 A7' % (exercnum,form)
24+
25+
def ScalePracticeTechniques():
26+
exercnum=random.choice(range(1,7))
27+
form=random.choice(Forms)
28+
return 'Practice scale technique %d in %s form' % (exercnum,form)
29+
30+
def IIVILineExample():
31+
exercnum=random.choice(range(1,6))
32+
return 'Study line example %d over descending II-V-I\'s' % (exercnum)
33+
34+
def ApproachBluesInF():
35+
chorus=random.choice(range(1,3))
36+
return 'Approach - Blues in F: focus on chorus %d' % (chorus)
37+
38+
########## Below: old exercises
39+
40+
def Technique_right_hand_picking():
41+
return "Play the chromatic scale for 5 minutes focusing on the picking"
42+
43+
def Sight_reading_studies():
44+
return "Do 5 minutes of sight-reading from Leavitt"
45+
46+
def Technique_right_hand_fingers():
47+
typeofrighthand=random.choice(['thumb-finger exchange', 'pima arpeggio', 'free stroke (a+p)mim'])
48+
return '3 minutes of right-hand: %s' % (typeofrighthand)
49+
50+
def Technique_patterns():
51+
pattern=random.choice(Patterns)
52+
form=random.choice(Forms+["three-note per string "+i for i in MajorModes])
53+
fret=random.choice(range(16))
54+
AorD=random.choice(Asc_OR_Desc)
55+
exercise='Play pattern %s using the %s form in fret %d, %s.' % (pattern,form,fret,AorD)
56+
return exercise
57+
58+
59+
def Scale():
60+
key=random.choice(Keys)
61+
mode=random.choice(MajorModes+["Melodic minor"])
62+
AorD=random.choice(Asc_OR_Desc)
63+
finger=randint(1,4)
64+
stringnum=randint(1,6)
65+
where=random.choice(MaybeTwelveFret)
66+
67+
exercise='Play %s %s %s. Start with finger %d on string %d%s' % (key,mode,AorD,finger,stringnum,where)
68+
return exercise
69+
70+
def Triad():
71+
key=random.choice(FullKeys)
72+
quality=random.choice(TriadQualities)
73+
starting=random.choice(TriadWays)
74+
AorD=random.choice(Asc_OR_Desc)
75+
where=random.choice(MaybeTwelveFret)
76+
77+
exercise='Play the triad for %s %s %s. Start with the %s at string %d%s' % (key,quality,AorD,starting[0],starting[1],where)
78+
return exercise
79+
80+
def Moving_treble():
81+
key=random.choice(Keys)
82+
AorD=random.choice(Asc_OR_Desc)
83+
quality=random.choice(FourNoteChordsQualities)
84+
otherquality=random.choice(FourNoteChordsQualities)
85+
86+
exercise='Play the moving treble for %s. Start by %s in %s and do the other way in %s.' % (key,AorD,quality,otherquality)
87+
return exercise
88+
89+
def Diatonic_chords_within_a_CAGED_form():
90+
key=random.choice(Keys)
91+
form=random.choice(Forms)
92+
where=random.choice(MaybeTwelveFret)
93+
94+
exercise='Play the diatonic chords for %s major within its %s form%s' % (key,form,where)
95+
return exercise
96+
97+
def II_V_I_Aebersold_patterns(MajPatterns,MinPatterns):
98+
key=random.choice(Keys)
99+
quality=random.choice(["major", "minor"])
100+
if quality=="major":
101+
aebersoldpattern=random.choice(MinPatterns)
102+
else:
103+
aebersoldpattern=random.choice(MajPatterns)
104+
exercise='Play %s II-V-I pattern %d for %s across the fretboard' % (quality,aebersoldpattern,key)
105+
return (exercise,quality+str(aebersoldpattern))
106+
# second looks like maj2, min58, etc (for latex labels)

Diff for: Guitar-DiatonicChords.txt

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
tags:guitar chords
2+
Play the diatonic chords for A major within its G form.
3+
Play the diatonic chords for Eb major within its G form, above the 12th fret.
4+
Play the diatonic chords for Eb major within its C form, above the 12th fret.
5+
Play the diatonic chords for Gb major within its G form.
6+
Play the diatonic chords for F major within its A form, above the 12th fret.
7+
Play the diatonic chords for F# major within its A form, above the 12th fret.
8+
Play the diatonic chords for Ab major within its G form.
9+
Play the diatonic chords for G major within its C form.
10+
Play the diatonic chords for D major within its D form, above the 12th fret.
11+
Play the diatonic chords for Ab major within its E form, above the 12th fret.
12+
Play the diatonic chords for D major within its A form, above the 12th fret.
13+
Play the diatonic chords for E major within its C form.
14+
Play the diatonic chords for E major within its G form.
15+
Play the diatonic chords for E major within its D form.
16+
Play the diatonic chords for Ab major within its A form.
17+
Play the diatonic chords for Bb major within its G form.
18+
Play the diatonic chords for F# major within its G form, above the 12th fret.
19+
Play the diatonic chords for D major within its E form, above the 12th fret.
20+
Play the diatonic chords for Ab major within its E form.
21+
Play the diatonic chords for B major within its C form, above the 12th fret.
22+
Play the diatonic chords for Bb major within its G form.
23+
Play the diatonic chords for G major within its E form, above the 12th fret.
24+
Play the diatonic chords for F major within its A form.
25+
Play the diatonic chords for E major within its G form.
26+
Play the diatonic chords for A major within its C form.
27+
Play the diatonic chords for Db major within its E form.
28+
Play the diatonic chords for F major within its C form, above the 12th fret.
29+
Play the diatonic chords for B major within its E form, above the 12th fret.
30+
Play the diatonic chords for E major within its A form, above the 12th fret.
31+
Play the diatonic chords for A major within its C form.
32+
Play the diatonic chords for Gb major within its D form.
33+
Play the diatonic chords for A major within its E form, above the 12th fret.
34+
Play the diatonic chords for B major within its A form.
35+
Play the diatonic chords for Eb major within its E form.
36+
Play the diatonic chords for F# major within its E form.
37+
Play the diatonic chords for Eb major within its G form, above the 12th fret.
38+
Play the diatonic chords for G major within its A form.
39+
Play the diatonic chords for Db major within its A form.
40+
Play the diatonic chords for A major within its A form, above the 12th fret.
41+
Play the diatonic chords for B major within its A form, above the 12th fret.
42+
Play the diatonic chords for D major within its E form.
43+
Play the diatonic chords for D major within its A form.
44+
Play the diatonic chords for C major within its E form, above the 12th fret.
45+
Play the diatonic chords for A major within its D form.
46+
Play the diatonic chords for Gb major within its G form.
47+
Play the diatonic chords for B major within its C form, above the 12th fret.
48+
Play the diatonic chords for E major within its D form, above the 12th fret.
49+
Play the diatonic chords for Gb major within its G form.
50+
Play the diatonic chords for Db major within its C form, above the 12th fret.
51+
Play the diatonic chords for Eb major within its G form.
52+
Play the diatonic chords for F major within its D form.
53+
Play the diatonic chords for F# major within its G form.
54+
Play the diatonic chords for F major within its G form.
55+
Play the diatonic chords for E major within its E form, above the 12th fret.
56+
Play the diatonic chords for B major within its C form.
57+
Play the diatonic chords for Db major within its C form.
58+
Play the diatonic chords for B major within its D form, above the 12th fret.
59+
Play the diatonic chords for Db major within its D form, above the 12th fret.
60+
Play the diatonic chords for Eb major within its E form.
61+
Play the diatonic chords for E major within its A form.
62+
Play the diatonic chords for Db major within its G form.
63+
Play the diatonic chords for C major within its D form, above the 12th fret.
64+
Play the diatonic chords for E major within its A form, above the 12th fret.
65+
Play the diatonic chords for D major within its E form, above the 12th fret.
66+
Play the diatonic chords for Ab major within its D form.
67+
Play the diatonic chords for A major within its G form.
68+
Play the diatonic chords for B major within its E form, above the 12th fret.
69+
Play the diatonic chords for Eb major within its E form.
70+
Play the diatonic chords for F major within its C form, above the 12th fret.
71+
Play the diatonic chords for A major within its G form.
72+
Play the diatonic chords for Gb major within its E form, above the 12th fret.
73+
Play the diatonic chords for G major within its A form.
74+
Play the diatonic chords for C major within its G form.
75+
Play the diatonic chords for B major within its A form, above the 12th fret.
76+
Play the diatonic chords for C major within its E form.
77+
Play the diatonic chords for G major within its E form, above the 12th fret.
78+
Play the diatonic chords for C major within its C form.
79+
Play the diatonic chords for Eb major within its G form, above the 12th fret.
80+
Play the diatonic chords for F# major within its D form.
81+
Play the diatonic chords for F# major within its G form.
82+
Play the diatonic chords for Db major within its E form.
83+
Play the diatonic chords for G major within its E form.
84+
Play the diatonic chords for F# major within its A form, above the 12th fret.
85+
Play the diatonic chords for D major within its E form.
86+
Play the diatonic chords for C major within its E form, above the 12th fret.
87+
Play the diatonic chords for A major within its C form.
88+
Play the diatonic chords for F major within its A form.
89+
Play the diatonic chords for E major within its E form.
90+
Play the diatonic chords for F# major within its G form.
91+
Play the diatonic chords for G major within its D form.
92+
Play the diatonic chords for F major within its D form.
93+
Play the diatonic chords for Eb major within its D form, above the 12th fret.
94+
Play the diatonic chords for Eb major within its C form.
95+
Play the diatonic chords for E major within its A form.
96+
Play the diatonic chords for E major within its C form, above the 12th fret.
97+
Play the diatonic chords for Db major within its A form.
98+
Play the diatonic chords for F# major within its D form, above the 12th fret.
99+
Play the diatonic chords for Bb major within its A form, above the 12th fret.
100+
Play the diatonic chords for F# major within its C form.
101+
Play the diatonic chords for F major within its G form.

0 commit comments

Comments
 (0)