Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from reaper_python import *
- import C3toolbox
- import os
- import sys
- sys.argv=["Main"]
- import Tkinter
- def execute(a):
- global level_var
- global instrument_var
- global st1
- global st2
- global st3
- global st4
- global st5
- global st6
- C3toolbox.startup()
- level = str(level_var.get())
- grid_array = { '1/16' : 'e', '1/32' : 's' }
- grid = grid_array[level]
- instrument = str(instrument_var.get())
- instrument = C3toolbox.array_instruments[instrument]
- str1 = st1.get()
- str2 = st2.get()
- str3 = st3.get()
- str4 = st4.get()
- str5 = st5.get()
- str6 = st6.get()
- C3toolbox.pg_root_notes(instrument, int(str1), int(str2), int(str3), int(str4), int(srt5), int(str6))
- form.destroy()
- def launch():
- global level_var
- global instrument_var
- global st1
- global st2
- global st3
- global st4
- global st5
- global st6
- form = Tkinter.Tk()
- form.wm_title('Root Note Generator')
- helpLf = Tkinter.Frame(form)
- helpLf.grid(row=0, column=1, sticky='NS', padx=5, pady=2)
- tuningLb1 = Tkinter.Label(helpLf, \
- text="Tuning, All 0 = E Standard, -2 0 0 0 0 0 = Drop D)")
- tuningLb1.grid(row=1, column=1, padx=5, pady=2, sticky='W')
- st1 = Tkinter.Entry(helpLf)
- st1.insert(0, "0")
- st1.config(width=5)
- st1.grid(row=2, column=1, padx=5, pady=2, sticky'W')
- st2 = Tkinter.Entry(helpLf)
- st2.insert(0, "0")
- st2.config(width=5)
- st2.grid(row=2, column=2, padx=5, pady=2, sticky'W')
- st3 = Tkinter.Entry(helpLf)
- st3.insert(0, "0")
- st3.config(width=5)
- st3.grid(row=2, column=3, padx=5, pady=2, sticky'W')
- st4 = Tkinter.Entry(helpLf)
- st4.insert(0, "0")
- st4.config(width=5)
- st4.grid(row=2, column=4, padx=5, pady=2, sticky'W')
- st5 = Tkinter.Entry(helpLf)
- st5.insert(0, "0")
- st5.config(width=5)
- st5.grid(row=2, column=5, padx=5, pady=2, sticky'W')
- st6 = Tkinter.Entry(helpLf)
- st6.insert(0, "0")
- st6.config(width=5)
- st6.grid(row=2, column=6, padx=5, pady=2, sticky'W')
- inFileLbl = Tkinter.Label(helpLf, text="Select Track")
- inFileLbl.grid(row=0, column=1, sticky='E', padx=5, pady=2)
- OPTIONS = ["Real Guitar", "Real Guitar 22", "Real Bass", "Real Bass 22"]
- instrument_var = Tkinter.StringVar(helpLf)
- instrument_var.set(OPTIONS[0]) # default value
- instrumentOpt = apply(Tkinter.OptionMenu, (helpLf, instrument_var) + tuple(OPTIONS))
- instrumentOpt.grid(row=3, column=1, columnspan=1, sticky="WE", pady=3)
- allBtn = Tkinter.Button(helpLf, text="Generate Root Notes", command= lambda: execute(0))
- allBtn.grid(row=5, column=1, rowspan=1, 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()
Advertisement
Add Comment
Please, Sign In to add comment