forked from SuperRiderTH/CAT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto_animations.py
More file actions
193 lines (153 loc) · 6.18 KB
/
Copy pathauto_animations.py
File metadata and controls
193 lines (153 loc) · 6.18 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
from reaper_python import *
import C3toolbox
import sys
import os
sys.argv=["Main"]
import tkinter
global form
global level_var
global instrument_var
global crashChkvar
global softChkvar
global flamChkvar
global tolerance
global form
global expression_var
global fldRowTxt
global mutevar
global beattrack_var
global keysvar
def execute(selected):
global beattrack_var
global level_var
global instrument_var
global crashChkvar
global softChkvar
global flamChkvar
global tolerance
global form
global expression_var
global fldRowTxt
global mutevar
global keysvar
C3toolbox.startup()
expression = str(expression_var.get())
pause = str(fldRowTxt.get())
if pause == 'default':
pause = 0
level = str(level_var.get())
grid_array = { '1/16' : 'e', '1/32' : 's' }
grid = grid_array[level]
crash = crashChkvar.get()
soft = softChkvar.get()
flam = flamChkvar.get()
keysvar = int(keysvar.get())
tolerance = tolerance.get()
if tolerance == '':
tolerance = 4
mutevar = mutevar.get()
beattrack = beattrack_var.get()
if beattrack == 'Normal BEAT track':
beattrack = 0
else:
beattrack = 1
#C3toolbox.PM(str(beattrack) + " - " + str(expression) + " - " + str(pause) + " - " + str(grid) + " - " + str(crash) + " - " + str(soft) + " - " + str(flam) + " - " + str(tolerance) + " - " + str(mutevar))
C3toolbox.startup()
C3toolbox.auto_animations(beattrack, expression, pause, grid, crash, soft, flam, tolerance, keysvar, mutevar)
form.destroy()
def launch():
global beattrack_var
global level_var
global instrument_var
global crashChkvar
global softChkvar
global flamChkvar
global tolerance
global form
global expression_var
global fldRowTxt
global mutevar
global keysvar
form = tkinter.Tk()
form.wm_title('Auto animations')
C3toolbox.startup()
# GENERAL
general = tkinter.LabelFrame(form, text=" General animations: ")
general.grid(row=0, columnspan=4, sticky='WE', \
padx=5, pady=5, ipadx=5, ipady=5)
OPTIONS = ["Normal BEAT track", "Halved BEAT track"]
beattrack_var = tkinter.StringVar(general)
beattrack_var.set(OPTIONS[0]) # default value
beattrackOpt = tkinter.OptionMenu(*(general, beattrack_var) + tuple(OPTIONS))
beattrackOpt.grid(row=0, column=1, sticky="W", pady=3)
OPTIONS = ["play", "mellow", "intense"]
expression_var = tkinter.StringVar(general)
expression_var.set(OPTIONS[0]) # default value
expressionOpt = tkinter.OptionMenu(*(general, expression_var) + tuple(OPTIONS))
expressionOpt.grid(row=0, column=2, columnspan=1, sticky="WE", pady=3)
fldLbl = tkinter.Label(general, \
text="Ticks to trigger idle:")
fldLbl.grid(row=0, column=3, padx=5, pady=2, sticky='W')
var = tkinter.StringVar()
fldRowTxt = tkinter.Entry(general, textvariable=var)
var.set('default')
fldRowTxt.grid(row=0, column=4, columnspan=1, padx=5, pady=2, sticky='W')
# KEYS
keysanim = tkinter.LabelFrame(form, text=" Pro keys animations: ")
keysanim.grid(row=3, columnspan=5, sticky='WE', \
padx=5, pady=5, ipadx=5, ipady=5)
keysvar = tkinter.IntVar(keysanim)
keysvarChk = tkinter.Checkbutton(keysanim, \
text="Create pro keys animations from Real Keys X", onvalue=1, offvalue=0, variable=keysvar)
keysvarChk.grid(row=0, column=1, sticky='W', padx=5, pady=2)
if C3toolbox.tracks_array['PART REAL_KEYS_X'] != 999:
keysvarChk.select()
# DRUMS
drumsanim = tkinter.LabelFrame(form, text=" Drums animations: ")
drumsanim.grid(row=4, columnspan=5, sticky='WE', \
padx=5, pady=5, ipadx=5, ipady=5)
levelLbl = tkinter.Label(drumsanim, text="Select grid")
levelLbl.grid(row=0, column=1, sticky='WE', padx=5, pady=2)
OPTIONS = ["1/16", "1/32"]
level_var = tkinter.StringVar(drumsanim)
level_var.set(OPTIONS[0]) # default value
levelOpt = tkinter.OptionMenu(*(drumsanim, level_var) + tuple(OPTIONS))
levelOpt.grid(row=1, column=1, sticky="WE", pady=3)
crashChkvar = tkinter.IntVar(drumsanim)
crashChk = tkinter.Checkbutton(drumsanim, \
text="CRASH1 as default crash", onvalue=1, offvalue=0, variable=crashChkvar)
crashChk.grid(row=0, column=2, sticky='W', padx=5, pady=2)
softChkvar = tkinter.IntVar(drumsanim)
softChk = tkinter.Checkbutton(drumsanim, \
text="Soft as default for snare/crash", onvalue=1, offvalue=0, variable=softChkvar)
softChk.grid(row=1, column=2, sticky='W', padx=5, pady=2)
toleranceLbl = tkinter.Label(drumsanim, \
text="Min. cymbals hits:")
toleranceLbl.grid(row=0, column=3, padx=5, pady=2, sticky='W')
tolerance = tkinter.Entry(drumsanim)
tolerance.insert(0, "4")
tolerance.config(width=5)
tolerance.grid(row=1, column=3, padx=5, pady=2, sticky='W')
mutevar = tkinter.IntVar(drumsanim)
muteChk = tkinter.Checkbutton(drumsanim, \
text="Overwrite notes", onvalue=1, offvalue=0, variable=mutevar)
muteChk.grid(row=2, column=1, sticky='W', padx=5, pady=2)
flamChkvar = tkinter.IntVar(drumsanim)
flamChk = tkinter.Checkbutton(drumsanim, \
text="Make snare+Y toms flams", onvalue=1, offvalue=0, variable=flamChkvar)
flamChk.grid(row=2, column=2, sticky='W', padx=5, pady=2)
flamChk.select()
allBtn = tkinter.Button(drumsanim, text="Create animations", command= lambda: execute(0))
allBtn.grid(row=2, column=3, 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.reduce_5lane('PART BASS', [1, 1, 1], ['e', 0, 1, 1], ['q', 1, 1, 0], ['h', 1, 1, 0], 0, 10)