forked from SuperRiderTH/CAT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpgrootnotes.py
More file actions
118 lines (93 loc) · 3.38 KB
/
pgrootnotes.py
File metadata and controls
118 lines (93 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
from reaper_python import *
import C3toolbox
import os
import sys
sys.argv=["Main"]
import tkinter
global tuningE
global tuningA
global tuningD
global tuningG
global tuningB
global tuninge
global instrument_var
global form
def execute(a):
global tuningE
global tuningA
global tuningD
global tuningG
global tuningB
global tuninge
global instrument_var
global form
C3toolbox.startup()
instrument = str(instrument_var.get())
instrument = C3toolbox.array_instruments[instrument]
stringE = tuningE.get()
stringA = tuningA.get()
stringD = tuningD.get()
stringG = tuningG.get()
stringB = tuningB.get()
stringe = tuninge.get()
C3toolbox.pg_root_notes(instrument, int(stringE), int(stringA), int(stringD), int(stringG), int(stringB), int(stringe))
form.destroy()
def launch():
global tuningE
global tuningA
global tuningD
global tuningG
global tuningB
global tuninge
global instrument_var
global form
form = tkinter.Tk()
form.wm_title('Root Notes Generator')
helpLf = tkinter.Frame(form)
helpLf.grid(row=0, column=1, sticky='NS', padx=5, pady=5)
inFileLbl = tkinter.Label(helpLf, text="Select instrument")
inFileLbl.grid(row=0, column=1, sticky='E', padx=5, pady=2)
OPTIONS = ["Pro Guitar", "Pro Bass", "Pro Guitar 22", "Pro Bass 22"]
instrument_var = tkinter.StringVar(helpLf)
instrument_var.set(OPTIONS[0]) # default value
instrumentOpt = tkinter.OptionMenu(*(helpLf, instrument_var) + tuple(OPTIONS))
instrumentOpt.grid(row=0, column=2, columnspan=1, sticky="WE", pady=3)
tuningLbl = tkinter.Label(helpLf, \
text="Tuning:")
tuningLbl.grid(row=0, column=3, padx=0, pady=2, sticky='W')
tuningE = tkinter.Entry(helpLf)
tuningE.insert(0, "0")
tuningE.config(width=2)
tuningE.grid(row=0, column=4, padx=0, pady=0, sticky='W')
tuningA = tkinter.Entry(helpLf)
tuningA.insert(0, "0")
tuningA.config(width=2)
tuningA.grid(row=0, column=5, padx=0, pady=0, sticky='W')
tuningD = tkinter.Entry(helpLf)
tuningD.insert(0, "0")
tuningD.config(width=2)
tuningD.grid(row=0, column=6, padx=0, pady=0, sticky='W')
tuningG = tkinter.Entry(helpLf)
tuningG.insert(0, "0")
tuningG.config(width=2)
tuningG.grid(row=0, column=7, padx=0, pady=0, sticky='W')
tuningB = tkinter.Entry(helpLf)
tuningB.insert(0, "0")
tuningB.config(width=2)
tuningB.grid(row=0, column=8, padx=0, pady=0, sticky='W')
tuninge = tkinter.Entry(helpLf)
tuninge.insert(0, "0")
tuninge.config(width=2)
tuninge.grid(row=0, column=9, padx=0, pady=0, sticky='W')
allBtn = tkinter.Button(helpLf, text="Generate Root Notes", command= lambda: execute(0))
allBtn.grid(row=1, column=4, rowspan=1, columnspan=6, sticky="WE", padx=5, pady=2)
logo = tkinter.Frame(form, bg="#000")
logo.grid(row=4, column=0, columnspan=3, sticky='WE', \
padx=0, pady=0, ipadx=0, ipady=0)
path = os.path.join( sys.path[0], "banner.gif" )
img = tkinter.PhotoImage(file=path)
imageLbl = tkinter.Label(logo, image = img, borderwidth=0)
imageLbl.grid(row=0, column=0, rowspan=2, sticky='E', padx=0, pady=0)
form.mainloop()
if __name__ == '__main__':
launch()