Deeestrukto's Guitar Riff Generator v2.0
Deeestrukto's Guitar Riff Generator v1 was written in late 2009 and unleashed on the Internet on January 1, 2010.
Deeestrukto's Guitar Riff Generator v2 was written in 2013 and unleashed on the Internet on May 7, 2023.
import random
def main():
print("Hello World!")
print("I am a very simple random guitar riff generator designed by K. Patola!")
## My main function
#define_chords() # define the chords i can play
#create_random_chords() # define the random chords that will be in this riff
#print_my_tab() # print out the random chords that were created
#def define_chords():
#define my note lists and add them to a list of lists called list_1
fsharp_whole = ["--------", "--------", "--------", "4-------", "4-------", "2-------"]
e_whole = ["--------", "--------", "--------", "2-------", "2-------", "0-------"]
d_whole = ["--------", "3-------", "2-------", "0-------", "--------", "--------"]
b_whole = ["--------", "--------", "4-------", "4-------", "2-------", "--------"]
a_whole = ["--------", "--------", "2-------", "2-------", "0-------", "--------"]
fsharp_half = ["----", "----", "----", "4---", "4---", "2---"]
e_half = ["----", "----", "----", "2---", "2---", "0---"]
d_half = ["----", "3---", "2---", "0---", "----", "----"]
b_half = ["----", "----", "4---", "4---", "2---", "----"]
a_half = ["----", "----", "2---", "2---", "0---", "----"]
fsharp_quarter = ["--", "--", "--", "4-", "4-", "2-"]
e_quarter = ["--", "--", "--", "2-", "2-", "0-"]
d_quarter = ["--", "3-", "2-", "0-", "--", "--"]
b_quarter = ["--", "--", "4-", "4-", "2-", "--"]
a_quarter = ["--", "--", "2-", "2-", "0-", "--"]
#list of lists - first list is the names of chords, second inner list is the list of notes
list_1 = [fsharp_whole, e_whole, d_whole, b_whole, a_whole, fsharp_whole, e_half, d_half, b_half, a_half, fsharp_quarter, e_quarter, d_quarter, b_quarter, a_quarter]
#def create_random_chords():
#define the random chords that will be used in this riff by randomizing integers for each of 8 chords in this riff
random_int1 = random.randint(0,14)
random_int2 = random.randint(0,14)
random_int3 = random.randint(0,14)
random_int4 = random.randint(0,14)
random_int5 = random.randint(0,14)
random_int6 = random.randint(0,14)
random_int7 = random.randint(0,14)
random_int8 = random.randint(0,14)
#def print_my_tab():
#print the chords that were randomized in the earlier function by using the random integers to find the corresponding (create_random_chords()) chords in the list of lists defined in define_chords()
print(list_1[random_int1][0] + list_1[random_int2][0] + list_1[random_int3][0] + list_1[random_int4][0] + list_1[random_int5][0] + list_1[random_int6][0] + list_1[random_int7][0] + list_1[random_int8][0])
print(list_1[random_int1][1] + list_1[random_int2][1] + list_1[random_int3][1] + list_1[random_int4][1] + list_1[random_int5][1] + list_1[random_int6][1] + list_1[random_int7][1] + list_1[random_int8][1])
print(list_1[random_int1][2] + list_1[random_int2][2] + list_1[random_int3][2] + list_1[random_int4][2] + list_1[random_int5][2] + list_1[random_int6][2] + list_1[random_int7][2] + list_1[random_int8][2])
print(list_1[random_int1][3] + list_1[random_int2][3] + list_1[random_int3][3] + list_1[random_int4][3] + list_1[random_int5][3] + list_1[random_int6][3] + list_1[random_int7][3] + list_1[random_int8][3])
print(list_1[random_int1][4] + list_1[random_int2][4] + list_1[random_int3][4] + list_1[random_int4][4] + list_1[random_int5][4] + list_1[random_int6][4] + list_1[random_int7][4] + list_1[random_int8][4])
print(list_1[random_int1][5] + list_1[random_int2][5] + list_1[random_int3][5] + list_1[random_int4][5] + list_1[random_int5][5] + list_1[random_int6][5] + list_1[random_int7][5] + list_1[random_int8][5])
if __name__ == "__main__":
main()