本文整理汇总了Python中llia.gui.tk.tk_subeditor.TkSubEditor类的典型用法代码示例。如果您正苦于以下问题:Python TkSubEditor类的具体用法?Python TkSubEditor怎么用?Python TkSubEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TkSubEditor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, editor):
frame = editor.create_tab(self.NAME, self.TAB_FILE)
frame.config(background=factory.bg())
canvas = factory.canvas(frame, 1000, 700, self.IMAGE_FILE)
canvas.pack()
self.canvas = canvas
self.editor = editor
TkSubEditor.__init__(self, canvas, editor, self.NAME)
editor.add_child_editor(self.NAME, self)
w = 900
h = 300
y0 = 50
x0 = 50
xmsb = w/2
ymsb = h-50
for i,prefix in enumerate("ab"):
x = x0
y = y0 + i*(300+25)
paramlist = []
for s in ("Attack","Decay1","Decay2","Release","Breakpoint",
"Sustain","Envmode"):
paramlist.append("%s%s" % (prefix,s))
env = ADDSREditor(canvas,i,(x,y),(w,h),paramlist,editor,12)
self.add_child_editor("ENV%s" % prefix, env)
env.sync()
param = "%sInvert" % prefix
msb = ToggleButton(canvas,param,editor,["+Pos","-Inv"])
self.add_control(param,msb)
msb.layout((x+xmsb,y+ymsb))
msb.update_aspect()
示例2: __init__
def __init__(self,editor):
frame = editor.create_tab(self.NAME,self.TAB_FILE)
frame.config(background=factory.bg())
canvas = factory.canvas(frame,736,604,self.IMAGE_FILE)
canvas.pack()
TkSubEditor.__init__(self,canvas,editor,self.NAME)
editor.add_child_editor(self.NAME, self)
x0 = 75
xlfo = x0+180
xmix = xlfo + 320
y0=75
y1=340
for n,y in ((1,y0),(2,y1)):
def param(prefix):
return "%s%d" % (prefix,n)
self.linear_slider(param("delay"),(0,0.01),x0,y)
self.exp_slider(param("depth"),1.0,x0+60,y)
self.exp_slider(param("xmod"),1.0,x0+120,y)
msb = self.msb(param("lfoRatio"),len(LFO_RATIOS),xlfo,y)
for i,pair in enumerate(LFO_RATIOS):
val,text = pair
self.msb_aspect(msb,i,val,text=text)
msb.update_aspect()
self.linear_slider(param("feedback"),(-1,1),xlfo+100,y)
self.linear_slider(param("xfeedback"),(-1,1),xlfo+160,y)
self.exp_slider(param("lowpass"),16000,xlfo+220,y)
self.volume_slider(param("dryMix"),xmix,y,height=100)
self.linear_slider(param("dryPan"),(-1,1),xmix,y+130,height=75)
self.volume_slider(param("efxMix"),xmix+60,y,height=100)
self.linear_slider(param("efxPan"),(-1,1),xmix+60,y+130,height=75)
self.tumbler("timebase",5,0.001,xlfo-7,y0+100)
示例3: __init__
def __init__(self, editor):
frame = editor.create_tab(self.NAME,self.TAB_FILE)
frame.config(background=factory.bg())
canvas = factory.canvas(frame, 1400, 700, self.IMAGE_FILE)
canvas.pack()
self.canvas = canvas
self.editor = editor
TkSubEditor.__init__(self, canvas, editor, self.NAME)
editor.add_child_editor(self.NAME, self)
x0 = 75
xdelay = x0+220
xmixer = xdelay+350
y0,y1 = 75,260
self.tumbler("pitchRatio",4,0.001,x0,y0,range_=(0,4000))
self.norm_slider("pitchDispersion",x0+80,y0)
self.norm_slider("timeDispersion",x0+140,y0)
self.toggle("delayInSelect",xdelay,y0,off=(0,"P.Shifter"),on=(1,"Drysig"))
self.exp_slider("delay",1,xdelay+80,y0)
self.exp_slider("delayMod",1,xdelay+140,y0)
self.tumbler("lfoFreq",5,0.001,xdelay+110,y1)
self.linear_slider("feedback",(-1,1),xdelay+200,y0)
self.exp_slider("lowpass",16000,xdelay+260,y0)
self.volume_slider("dryAmp",xmixer,y0)
self.volume_slider("psAmp",xmixer+60,y0)
self.volume_slider("delayAmp",xmixer+120,y0)
self.linear_slider("dryPan",(-1,1),xmixer,y1)
self.linear_slider("psPan",(-1,1),xmixer+60,y1)
self.linear_slider("delayPan",(-1,1),xmixer+120,y1)
self.toggle("feedbackDestination",xdelay,y1,off=(0,"P.shifter"),on=(1,"Delay"))
示例4: __init__
def __init__(self,stack,editor):
self.name = "Sol %s" % stack
self.image_file = "resources/Sol/editor_%s.png" % stack
self.tab_file = "resources/Sol/tab_%s.png" % stack
frame = editor.create_tab(self.name,self.tab_file)
frame.config(background=factory.bg())
canvas = factory.canvas(frame,900,550,self.image_file)
canvas.pack()
TkSubEditor.__init__(self,canvas,editor,self.name)
editor.add_child_editor(self.name, self)
x0 = 50
xop = x0
xfilter = 640
y0 = 75
y1 = 300
if stack == 'x':
self.init_fm_op('a',xop,y0)
self.init_fm_op('b',xop,y1)
else:
self.init_wv_op('c',xop,y0)
self.init_wv_op('d',xop,y1)
self.init_stack_filter(stack,xfilter,y0,y1)
示例5: __init__
def __init__(self,editor):
frame = editor.create_tab(self.NAME,self.TAB_FILE)
frame.config(background=factory.bg())
canvas = factory.canvas(frame,740,343,self.IMAGE_FILE)
canvas.pack()
TkSubEditor.__init__(self,canvas,editor,self.NAME)
editor.add_child_editor(self.NAME, self)
x0,y0 = 75,75
x_tone = x0
x_feedback = x_tone+60
x_bandpass = x_feedback+90
x_filter = x_bandpass
x_mod = x_filter+60
x_xmod = x_mod+60
x_res = x_xmod+60
x_lfo = x_res+90
x_mix = x_lfo+90
x_amp = x_mix+60
self.norm_slider("tone",x_tone,y0)
self.linear_slider("feedback",(-1.0,1.0),x_feedback,y0)
self.norm_slider("filter",x_filter,y0)
self.norm_slider("modDepth",x_mod,y0)
self.norm_slider("xmodDepth",x_xmod,y0)
self.norm_slider("res",x_res,y0)
self.exp_slider("lfoFreq",16,x_lfo,y0,degree=3)
self.norm_slider("efxmix",x_mix,y0)
self.volume_slider("amp",x_amp,y0)
示例6: __init__
def __init__(self,editor):
frame = editor.create_tab(self.NAME,self.TAB_FILE)
frame.config(background=factory.bg())
canvas = factory.canvas(frame,1000,700,self.IMAGE_FILE)
canvas.pack()
TkSubEditor.__init__(self,canvas,editor,self.NAME)
editor.add_child_editor(self.NAME, self)
x0 = 75
y0 = 75
y1 = 380
self.norm_slider("spread_external",x0,y0)
self.norm_slider("cluster_external",x0+60,y0)
msb_harm = self.msb("harm2_external",len(POLAR_HARMONIC_MOD_RANGE),x0+120,y0)
msb_filter = self.msb("f1_freq_external",len(FILTER_MOD_VALUES),x0+120,y0+122)
for i,n in enumerate(POLAR_HARMONIC_MOD_RANGE):
fg = None
self.msb_aspect(msb_harm,i,n,foreground=fg)
for i,n in enumerate(FILTER_MOD_VALUES):
fg = None
self.msb_aspect(msb_filter,i,n,foreground=fg)
msb_harm.update_aspect()
msb_filter.update_aspect()
示例7: __init__
def __init__(self,editor):
frame = editor.create_tab(self.NAME,self.TAB_FILE)
frame.config(background=factory.bg())
canvas = factory.canvas(frame,565,478,self.IMAGE_FILE)
canvas.pack()
TkSubEditor.__init__(self,canvas,editor,self.NAME)
editor.add_child_editor(self.NAME, self)
x0,y0 = 150, 75
x_scale = x0
x_delay = x0+22
x_phase = x_scale+75
x_wetamp = x_phase+108
x_amp = x_wetamp+75
y_scale = y0+150
y_delay = y_scale+50
y_phase = y_scale
y_wetamp = y_delay
y_amp = y_wetamp
msb_scale = self.msb("delayScale",3,x_scale,y_scale)
self.norm_slider("delay",x_delay,y_delay)
msb_phase =self.msb("phase",2,x_phase,y_phase)
self.volume_slider("wet",x_wetamp,y_wetamp)
self.volume_slider("amp",x_amp,y_amp)
self.msb_aspect(msb_scale, 0, 0.001, "x1")
self.msb_aspect(msb_scale, 1, 0.010, "x2")
self.msb_aspect(msb_scale, 2, 0.100, "x3")
msb_scale.update_aspect()
self.msb_aspect(msb_phase, 0, -1, "-")
self.msb_aspect(msb_phase, 1, 1, "+")
msb_phase.update_aspect()
示例8: __init__
def __init__(self, editor):
frame = editor.create_tab(self.NAME,self.TAB_FILE)
frame.config(background=factory.bg())
TkSubEditor.__init__(self, frame, editor, self.NAME)
editor.add_child_editor(self.NAME, self)
lab_panel = factory.image_label(frame, self.IMAGE_FILE)
lab_panel.pack(anchor="nw", expand=False)
s_pos = cf.bipolar_slider(frame, "pos", editor)
s_lfo_freq = ExpSlider(frame, "lfoFreq", editor, range_=100, degree=3)
s_lfo_depth = cf.normalized_slider(frame, "lfoDepth", editor)
s_xscale = cf.linear_slider(frame, "xscale", editor, range_=(-2, 2))
s_xbias = cf.linear_slider(frame, "xbias", editor, range_=(-2,2))
s_amp = cf.volume_slider(frame, "amp", editor)
self.add_control("pos", s_pos)
self.add_control("lfoFreq", s_lfo_freq)
self.add_control("lfoDepth", s_lfo_depth)
self.add_control("xscale", s_xscale)
self.add_control("xbias", s_xbias)
self.add_control("amp", s_amp)
y0 = 60
x0 = 120
x_lfo_freq = x0 + 90
x_lfo_depth = x_lfo_freq + 60
x_xscale = x_lfo_depth + 90
x_xbias = x_xscale + 60
x_amp = x_xbias + 90
s_pos.widget().place(x=x0, y=y0, height=200)
s_lfo_freq.layout(offset=(x_lfo_freq, y0), height=200, checkbutton_offset=None)
s_lfo_depth.widget().place(x=x_lfo_depth, y=y0, height=200)
s_xscale.widget().place(x=x_xscale, y=y0, height=200)
s_xbias.widget().place(x=x_xbias, y=y0, height=200)
s_amp.widget().place(x=x_amp, y=y0, height=200)
示例9: __init__
def __init__(self, editor):
frame = editor.create_tab(self.NAME, self.TAB_FILE)
frame.config(background=factory.bg())
canvas = factory.canvas(frame, 1500, 708, self.IMAGE_FILE)
canvas.pack()
TkSubEditor.__init__(self, canvas, editor, self.NAME)
editor.add_child_editor(self.NAME, self)
y0, y1 = 105,358
x_delay = 105
x_wow = x_delay + 60
x_wfreq = x_wow + 60
x_flutter = x_wfreq + 60
x_xdelay = x_flutter + 60
x_fb = x_xdelay + 90
x_gain = x_fb + 60
x_threshold = x_gain + 60
x_low = x_threshold + 60
x_high = x_low + 60
x_mix = x_high + 90
x_xmix = x_mix + 60
x_amp = x_xmix + 90
self.linear_slider("delayTime",(0,MAX_DELAY),x_delay,y0,height=200)
self.exp_slider("wow",1.0,x_wow,y0,height=200)
self.exp_slider("wowFreq",5.0,x_wfreq,y0,height=200)
self.exp_slider("flutter",1.0,x_flutter,y0,height=200)
self.exp_slider("xDelayMod",1.0,x_xdelay,y0,height=200)
self.norm_slider("feedback",x_fb,y0,height=200)
self.linear_slider("gain",(0.5,2.0),x_gain,y0,height=200)
self.exp_slider("threshold",1.0,x_threshold,y0,height=200)
self.third_octave_slider("lowcut",x_low,y0,height=200)
self.third_octave_slider("highcut",x_high,y0,height=200)
self.norm_slider("efxMix",x_mix,y0,height=200)
self.norm_slider("xEfxMix",x_xmix,y0,height=200)
self.volume_slider("amp",x_amp,y0,height=200)
示例10: __init__
def __init__(self,editor):
frame = editor.create_tab(self.NAME, self.TAB_FILE)
frame.config(background=factory.bg())
canvas = factory.canvas(frame, 1000, 700, self.IMAGE_FILE)
canvas.pack()
self.canvas = canvas
self.editor = editor
TkSubEditor.__init__(self, canvas, editor, self.NAME)
editor.add_child_editor(self.NAME,self)
y0 = 75
y_tumbler = y0 + 50
x0 = 75
x_port = x0
x_lfo = x_port + 75
x_delay = x_lfo + 100
x_vsens = x_delay + 60
x_vdepth = x_vsens + 60
x_xpitch= x_vdepth + 60
x_moddepth = x_xpitch + 90
x_xmod = x_moddepth + 60
x_xscale = x_xmod + 90
x_amp = x_xscale + 90
def norm_slider(param,x):
s = cf.normalized_slider(canvas,param,editor)
self.add_control(param,s)
s.widget().place(x=x,y=y0)
return s
def linear_slider(param,x,range_=(0,4)):
s = cf.linear_slider(canvas,param,editor,range_=range_)
self.add_control(param,s)
s.widget().place(x=x,y=y0)
return s
def volume_slider(param,x):
s = cf.volume_slider(canvas,param,editor)
self.add_control(param,s)
s.widget().place(x=x,y=y0)
return s
def tumbler(param,x):
t = Tumbler(canvas,param,editor,digits=5,scale=0.001)
self.add_control(param,t)
t.layout((x,y_tumbler))
t.update_aspect()
return t
norm_slider("port",x_port)
tumbler("lfov_freq",x_lfo)
linear_slider("lfov_delay",x_delay)
norm_slider("vsens",x_vsens)
norm_slider("vdepth",x_vdepth)
norm_slider("xpitch",x_xpitch)
norm_slider("modDepth",x_moddepth)
norm_slider("xmod",x_xmod)
linear_slider("xscale",x_xscale,(0,2))
volume_slider("amp",x_amp)
示例11: __init__
def __init__(self, editor):
frame = editor.create_tab(self.NAME,self.TAB_FILE)
frame.config(background=factory.bg())
canvas = factory.canvas(frame,735,510,self.IMAGE_FILE)
canvas.pack()
TkSubEditor.__init__(self, canvas, editor, self.NAME)
editor.add_child_editor(self.NAME, self)
def linear_slider(param, range_, x, y):
s = cf.linear_slider(canvas,param,editor,range_=range_)
self.add_control(param,s)
s.widget().place(x=x,y=y)
def norm_slider(param,x,y):
s = cf.normalized_slider(canvas,param,editor)
self.add_control(param,s)
s.widget().place(x=x,y=y)
def eq_slider(param,x,y):
s = cf.third_octave_slider(canvas,param,editor)
self.add_control(param,s)
s.widget().place(x=x,y=y)
def amp_slider(param,x,y):
s = cf.volume_slider(canvas,param,editor)
self.add_control(param,s)
s.widget().place(x=x,y=y)
def pan_slider(param,x,y):
s = cf.bipolar_slider(canvas,param,editor)
self.add_control(param,s)
s.widget().place(x=x,y=y)
y0 = 50
x0 = 75
x1 = x0 + 60
x2 = x1 + 60
x3 = x2 + 60
xeq = x3 + 75
xlp = xeq
xhp = xlp+60
xdry = xhp+75
xwet = xdry+120
linear_slider("preDelay",(0.0,0.333),x0,y0)
norm_slider("roomSize",x1,y0)
norm_slider("damp",x2,y0)
norm_slider("modDepth",x3,y0)
eq_slider("lpcutoff",xlp,y0)
eq_slider("hpcutoff",xhp,y0)
amp_slider("dryAmp", xdry,y0)
pan_slider("dryPan", xdry+60,y0)
amp_slider("wetAmp", xwet,y0)
pan_slider("wetPan", xwet+60,y0)
msb_gate = ToggleButton(canvas,"gatted",editor,)
self.add_control("gatted", msb_gate)
msb_gate.layout((x0+157,y0+200))
msb_gate.update_aspect()
示例12: __init__
def __init__(self,editor):
self.name = "Sol Mod"
self.image_file = "resources/Sol/editor_mod.png"
self.tab_file = "resources/Sol/tab_mod.png"
frame = editor.create_tab(self.name,self.tab_file)
frame.config(background=factory.bg())
canvas = factory.canvas(frame,1100,580,self.image_file)
canvas.pack()
TkSubEditor.__init__(self,canvas,editor,self.name)
editor.add_child_editor(self.name, self)
x0 = 50
y0 = 75
y1 = 330
self.tumbler("timebase",5,0.001,x0,y0)
self.norm_slider("port",x0+30,y1)
xvib = x0+100
msb_vratio = self.msb("vratio",len(LFO_RATIOS),xvib,y0)
self.linear_slider("vdelay",(0,MAX_LFO_DELAY),xvib+100,y0)
self.norm_slider("vsens",xvib+160,y0)
self.norm_slider("vdepth",xvib+220,y0)
self.norm_slider("pitch_ctrlbus",xvib+280,y0)
msb_aratio = self.msb("alfo_ratio",len(LFO_RATIOS),xvib,y1)
self.linear_slider("alfo_delay",(0,MAX_LFO_DELAY),xvib+100,y1)
msb_bratio = self.msb("blfo_ratio",len(LFO_RATIOS),xvib+180,y1)
self.linear_slider("blfo_delay",(0,MAX_LFO_DELAY),xvib+280,y1)
lfo_ratio_msblist = (msb_vratio,msb_aratio,msb_bratio)
for i,r in enumerate(LFO_RATIOS):
n,d = r.numerator,r.denominator
if d == 1:
txt = "%d" % n
else:
txt = "%d/%d" % (n,d)
for msb in lfo_ratio_msblist:
self.msb_aspect(msb,i,float(r),text=txt)
for msb in lfo_ratio_msblist:
msb.update_aspect()
def env_slider(param,x,y):
self.exp_slider(param,MAX_ENV_SEGMENT_TIME,x,y)
xenv = xvib+340
for q in "ab":
if q == 'a':
y = y0
else:
y = y1
env_slider("%senv_attack" % q,xenv,y)
env_slider("%senv_decay" % q,xenv+40,y)
self.norm_slider("%senv_sustain" % q,xenv+80,y)
env_slider("%senv_release" % q,xenv+120,y)
self.toggle("%senv_lfo_trig" % q,xenv,y+175)
xcenv = xenv+170
cenv = ADDSREditor(canvas,1,(xcenv,y0),(400,400),
("cenv_attack","cenv_decay1","cenv_decay2",
"cenv_release","cenv_breakpoint","cenv_sustain",
"cenv_trig_mode"),
self,MAX_ENV_SEGMENT_TIME)
self.add_child_editor("Cenv",cenv)
cenv.sync()
示例13: __init__
def __init__(self,editor):
frame = editor.create_tab(_NAME, _TAB_FILE)
frame.config(background=factory.bg())
self.editor = editor
TkSubEditor.__init__(self,frame,editor,_NAME)
editor.add_child_editor(_NAME,self)
self._layout_engion_selection(frame)
self._layout_env_type(frame)
self._layout_env_time(frame)
self._layout_slider_panel(frame)
lab_help = factory.label(frame,_BLURB)
lab_help.grid(row=2,column=0,rowspan=3,columnspan=4)
示例14: __init__
def __init__(self, editor):
frame = editor.create_tab(self.NAME,self.TAB_FILENAME)
frame.config(background=factory.bg())
canvas = factory.canvas(frame, 946,777, self.IMAGE_FILE)
canvas.pack()
self.canvas = canvas
self.editor = editor
TkSubEditor.__init__(self, canvas, editor, self.NAME)
editor.add_child_editor(self.NAME, self)
y0 = 50
y1 = y0 + 230
xfreq1, yfreq_offset = 50, 0
xamp1 = xfreq1+90
xfreq2 = xamp1+60
xamp2 = xfreq2+90
xattack = xamp2+75
xdecay = xattack+60
xsustain = xdecay+60
xrelease = xsustain+60
xmod = xrelease+75
xexternmod = xmod + 60
xexternpitch = xexternmod + 60
xchorus = xexternpitch + 75
xchorus_delay = xchorus+60
xvfreq = xmod
xvdelay = xvfreq+60
xvdepth = xvdelay+60
xamp = xchorus_delay
self.tumbler("r2", xfreq1, y0+yfreq_offset)
self.norm_slider("amp2",xamp1,y0)
self.tumbler("r4", xfreq2,y0+yfreq_offset)
self.norm_slider("amp4",xamp2,y0)
self.env_time_slider("mattack", xattack, y0)
self.env_time_slider("mdecay", xdecay, y0)
self.env_time_slider("msustain", xsustain, y0)
self.env_time_slider("mrelease", xrelease, y0)
self.norm_slider("modulationDepth", xmod, y0)
self.norm_slider("xToModulationDepth", xexternmod, y0)
self.norm_slider("xToPitch", xexternpitch, y0)
self.norm_slider("chorus", xchorus, y0)
self.linear_slider("chorusDelay",(0,4),xchorus_delay, y0)
self.tumbler("r1", xfreq1, y1+yfreq_offset)
self.volume_slider("amp1", xamp1, y1)
self.tumbler('r3', xfreq2, y1+yfreq_offset)
self.volume_slider("amp3", xamp2, y1)
self.env_time_slider("cattack", xattack, y1)
self.env_time_slider("cdecay", xdecay, y1)
self.env_time_slider("csustain", xsustain, y1)
self.env_time_slider("crelease", xrelease, y1)
self.linear_slider("vfreq", (0,8), xvfreq, y1)
self.linear_slider("vdelay", (0,4), xvdepth, y1)
self.norm_slider("vdepth", xvdelay, y1)
self.volume_slider("amp", xamp, y1)
示例15: __init__
def __init__(self, editor):
frame = editor.create_tab(self.NAME, self.TAB_FILE)
frame.config(background=factory.bg())
canvas=factory.canvas(frame,696,361,self.IMAGE_FILE)
canvas.pack()
TkSubEditor.__init__(self, canvas, editor, self.NAME)
editor.add_child_editor(self.NAME, self)
y0 = 75
x0 = 100
xmix = x0 + 150
xsaw = xmix
xnoise = xsaw+64
xexternal = xnoise + 60
xlag = xexternal+90
def tumbler(param,x,y):
t = Tumbler(canvas,param,editor,digits=5,scale=0.001,
outline='#a5a08a',
foreground='#a5a08a',
fill='black')
self.add_control(param,t)
t.layout((x,y))
return y
def norm(param,x):
s = cf.normalized_slider(canvas,param,editor)
self.add_control(param,s)
s.widget().place(x=x,y=y0)
return s
def linear_slider(param,x,range_):
s = cf.linear_slider(canvas,param,editor,range_=range_)
self.add_control(param,s)
s.widget().place(x=x,y=y0)
tumbler("clockRate",x0,y0)
tumbler("sawFreq",xsaw-30,y0+160)
tog = ToggleButton(canvas,"clockSource",editor,
text=["Internal","External"],
fill='black',foreground='#007d47',
selected_fill='black',selected_foreground='#007d47')
self.add_control("clockSource", tog)
tog.layout((x0+8,y0+36))
tog.update_aspect()
norm("sawMix",xsaw)
norm("noiseMix",xnoise)
norm("externalMix",xexternal)
norm("lag",xlag)
norm("scale",xlag+60)
linear_slider("bias",xlag+120,(-4,4))