forked from SuperRiderTH/CAT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_singalong.py
More file actions
88 lines (68 loc) · 2.53 KB
/
Copy pathcreate_singalong.py
File metadata and controls
88 lines (68 loc) · 2.53 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
from reaper_python import *
import C3toolbox
import sys
import os
sys.argv=["Main"]
import tkinter
global h2Chkvar
global h3Chkvar
global h1Chkvar
def execute():
global form
h2 = h2Chkvar.get()
h3 = h3Chkvar.get()
h1 = h1Chkvar.get()
if h2 == 1:
C3toolbox.create_singalong("HARM2")
if h3 == 1:
C3toolbox.create_singalong("HARM3")
if h1 == 1:
C3toolbox.create_singalong("HARM1")
form.destroy()
def launch():
global h2Chkvar
global h3Chkvar
global h1Chkvar
global form
form = tkinter.Tk()
getFld = tkinter.IntVar()
form.wm_title('Create sing-a-long notes')
C3toolbox.startup()
# Setup options
userOpts = tkinter.LabelFrame(form, text=" Select the harmony parts to generate notes for: ")
userOpts.grid(row=0, columnspan=5, sticky="WE", \
padx=5, pady=5, ipadx=5, ipady=5)
h2Chkvar = tkinter.IntVar(userOpts)
h2Chk = tkinter.Checkbutton(userOpts, \
text="Harmony 2 (guitarist)", onvalue=1, offvalue=0, variable=h2Chkvar)
h2Chk.grid(row=1, column=1, sticky='W', padx=5, pady=2)
h2Chk.select()
h3Chkvar = tkinter.IntVar(userOpts)
h3Chk = tkinter.Checkbutton(userOpts, \
text="Harmony 3 (bassist)", onvalue=1, offvalue=0, variable=h3Chkvar)
h3Chk.grid(row=2, column=1, sticky='W', padx=5, pady=2)
h3Chk.select()
h1Chkvar = tkinter.IntVar(userOpts)
h1Chk = tkinter.Checkbutton(userOpts, \
text="Harmony 1 (drummer)", onvalue=1, offvalue=0, variable=h1Chkvar)
h1Chk.grid(row=3, column=1, sticky='W', padx=5, pady=2)
# HELP
helpLf = tkinter.LabelFrame(form, text=" Quick Help ")
helpLf.grid(row=0, column=9, columnspan=1, rowspan=2, \
sticky='NS', padx=5, pady=5)
helpLbl = tkinter.Label(helpLf, text="Keys sings the missing\nguitar or bass part.\n\n")
helpLbl.grid(row=0, columnspan=1, column=9, sticky='W')
okFileBtn = tkinter.Button(helpLf, text="Run", command= lambda: execute())
okFileBtn.grid(row=1, column=9, sticky="WE", padx=5, pady=2)
logo = tkinter.Frame(form, bg="#000")
logo.grid(row=5, column=0, columnspan=10, 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()
#C3toolbox.startup()
#C3toolbox.create_singalong("HARM2")