def _init_north_toolbar(self): frame = factory.frame(self) toolbar = factory.label_frame(frame, "Bank") specs = self.synth.specs format_ = specs["format"] sid = self.synth.sid logo_filename = os.path.join("resources", format_, "logo_small.png") lab_logo = factory.image_label(frame, logo_filename, format_) lab_sid = factory.label(frame, "ID = %s" % sid) b_open = factory.button(toolbar, "Open", ttip="Read bank file", command=self._open_bank) b_save = factory.button(toolbar, "Save", ttip="Save bank file", command=self._save_bank) b_init = factory.button(toolbar, "Init", ttip="Initialize bank", command=self._init_bank) b_rem = factory.button(toolbar, "Rem", ttip="Edit bank remarks", command=self._edit_remarks) b_help = factory.help_button(toolbar, command= self._help) b_open.grid(row=0, column=0, sticky="ew") b_save.grid(row=0, column=1, sticky="ew") b_init.grid(row=0, column=2, sticky="ew") b_rem.grid(row=1, column=0, sticky="ew") b_help.grid(row=1, column=1, sticky="ew") lab_logo.grid(row=0, column=0, sticky='w', pady=4) lab_sid.grid(row=0, column=1, columnspan=2) toolbar.grid(row=1, column=0, columnspan=2) return frame
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)
def _init_north_toolbar(self): frame = factory.frame(self) toolbar = factory.label_frame(frame, "Bank") specs = self.synth.specs format_ = specs["format"] sid = self.synth.sid logo_filename = os.path.join("resources", format_, "logo_small.png") lab_logo = factory.image_label(frame, logo_filename, format_) lab_sid = factory.label(frame, "ID = %s" % sid) b_open = factory.button(toolbar, "Open", ttip="Read bank file", command=self._open_bank) b_save = factory.button(toolbar, "Save", ttip="Save bank file", command=self._save_bank) b_init = factory.button(toolbar, "Init", ttip="Initialize bank", command=self._init_bank) b_rem = factory.button(toolbar, "Rem", ttip="Edit bank remarks", command=self._edit_remarks) b_help = factory.help_button(toolbar, command= self._help) b_open.grid(row=0, column=0, sticky="ew") b_save.grid(row=0, column=1, sticky="ew") b_init.grid(row=0, column=2, sticky="ew") b_rem.grid(row=1, column=0, sticky="ew") b_help.grid(row=1, column=1, sticky="ew") lab_logo.grid(row=0, column=0, sticky='w', pady=4) lab_sid.grid(row=0, column=1, columnspan=2) toolbar.grid(row=1, column=0, columnspan=2) return frame
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)
def __init__(self, editor): frame = editor.create_tab(self.NAME, self.TAB_FILE) TkSubEditor.__init__(self, frame, editor, self.NAME) editor.add_child_editor(self.NAME, self) self.pack(expand=True, fill="both") lab_panel = factory.image_label(self, self.IMAGE_FILE) lab_panel.pack(anchor="nw", expand=False) s_delay = cf.normalized_slider(frame, "delay", editor) s_mod_depth = ExpSlider(frame, "imodDepth", editor, range_=1, degree=2) s_mod_freq = ExpSlider(frame, "imodFreq", editor, range_=10, degree=3) s_xmod_depth = ExpSlider(frame, "xmodDepth", editor, range_=1, degree=2) s_feedback = cf.bipolar_slider(frame, "feedback", editor) s_low_eq = cf.third_octave_slider(frame, "feedbackLowpass", editor) s_high_eq = cf.third_octave_slider(frame, "feedbackHighpass", editor) s_mix = cf.normalized_slider(frame, "efxMix", editor) s_xmix = cf.normalized_slider(frame, "xmixScale", editor) s_amp = cf.volume_slider(frame, "amp", editor) self.add_control("delay", s_delay) self.add_control("imodDepth", s_mod_depth) self.add_control("imodFreq", s_mod_freq) self.add_control("xmodDepth", s_xmod_depth) self.add_control("feedback", s_feedback) self.add_control("feedbackLowpass", s_low_eq) self.add_control("feedbackHighpass", s_high_eq) self.add_control("efxMix", s_mix) self.add_control("xmixScale", s_xmix) self.add_control("amp", s_amp) y0 = 120 x0 = 120 x1 = x0 + 90 x2 = x1 + 60 x3 = x2 + 60 xfb = x3 + 90 x4 = xfb x5 = x4 + 60 x6 = x5 + 60 xmix = x6 + 90 x7 = xmix x8 = x7+60 xamp = x8+90 s_delay.widget().place(x=x0, y=y0, height=175) s_mod_depth.layout(offset=(x1,y0), height=175, checkbutton_offset=None) s_mod_freq.layout(offset=(x2,y0), height = 175, checkbutton_offset=None) s_xmod_depth.layout(offset=(x3, y0), height=175, checkbutton_offset=None) s_feedback.widget().place(x=x4, y=y0, height=175) s_low_eq.widget().place(x=x5, y=y0, height=175) s_high_eq.widget().place(x=x6, y=y0, height=175) s_mix.widget().place(x=x7, y=y0, height=175) s_xmix.widget().place(x=x8, y=y0, height=175) s_amp.widget().place(x=xamp, y=y0, height=175)
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) y0, y1, y2 = 60, 170, 280 x0, xdelta = 60, 30 for i in range(9): j = i+1 x = x0+i*xdelta pa = "a%d" % j self.norm_slider(pa,x,y0,height=100) pp = "p%d" % j self.norm_slider(pp,x,y1,height=100) px = "x%d" % j self.norm_slider(px,x,y2,height=100) # Envelope xenv = x0+(xdelta*10) self.exp_slider("attack",1.0,xenv,y0+30,height=100) self.exp_slider("decay",1.0,xenv,y2-30,height=100) # Vibrato xvib=xenv+120 self.exp_slider("vfreq",8.0,xvib,y0) self.linear_slider("vdelay",(0,4),xvib+60,y0) self.norm_slider("vsens",xvib+120,y0) self.norm_slider("vdepth",xvib+180,y0) # X Bus xx = xvib self.linear_slider("xBias",(-2,2),xx,y2) self.linear_slider("xScale",(0,2),xx+60,y2) self.exp_slider("xToFreq",1.0,xx+120,y2) # Amp self.volume_slider("amp",xx+188,y2)
def __init__(self, editor): frame = editor.create_tab(self.NAME, self.TAB_FILE) TkSubEditor.__init__(self, frame, editor, self.NAME) editor.add_child_editor(self.NAME, self) self.pack(expand=True, fill="both") lab_panel = factory.image_label(self, self.IMAGE_FILE) lab_panel.pack(anchor="nw", expand=False) s_freq = ExpSlider(frame, "lfoFreq", editor, range_=10) s_depth = cf.normalized_slider(frame, "modDepth", editor) s_xdepth = cf.normalized_slider(frame, "xDepth", editor) s_xam = cf.normalized_slider(frame, "xLfoAmp", editor) s_xfm = ExpSlider(frame, "xLfoFreq", editor, range_=30) s_limit = cf.linear_slider(frame, "limit", editor, range_=(0,2)) s_amp = cf.volume_slider(frame, "amp", editor) self.add_control("lfoFreq",s_freq) self.add_control("modDepth",s_depth) self.add_control("xDepth",s_xdepth) self.add_control("xLfoAmp",s_xam) self.add_control("xLfoFreq",s_xfm) self.add_control("limit",s_limit) self.add_control("amp",s_amp) y0 = 90 x0 = 90 x1 = x0 + 60 x2 = x1 + 90 x3 = x2 + 60 x4 = x3 + 60 x5 = x4 + 90 x6 = x5 + 90 s_freq.layout(offset=(x0, y0), checkbutton_offset=None) s_depth.widget().place(x=x1, y=y0) s_xdepth.widget().place(x=x2, y=y0) s_xam.widget().place(x=x3, y=y0) s_xfm.layout(offset=(x4, y0), checkbutton_offset=None) s_limit.widget().place(x=x5, y=y0) s_amp.widget().place(x=x6, y=y0)
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) # Filter Freq s_freq = cfactory.third_octave_slider(frame, "filterFreq", editor, "Filter frequency") s_keytrack = cfactory.linear_slider(frame, "filterKeytrack", editor,range_ = (0.0, 4.0)) s_freq_env1 = ExpSlider(frame, "filterFreq_env1", editor, range_=12000, degree=4) s_freq_lfo = ExpSlider(frame, "filterFreq_lfo", editor, range_=12000, degree=4) s_freq_external = ExpSlider(frame, "xToFilterFreq", editor, range_=12000, degree=4) s_bandpass_offset = cfactory.linear_slider(frame, "bandpassOffset", editor,range_ = (1, 16)) s_bandpass_lag = cfactory.normalized_slider(frame, "bandpassLag", editor) y0, y1 = 50, 300 x0 = 60 x1 = x0 + 60 x2 = x1 + 60 x3 = x2 + 40 s_freq.widget().place(x=x0, y=y0) s_keytrack.widget().place(x=x1, y=y0) s_freq_env1.layout((x0,y1), checkbutton_offset=(-5,-28)) s_freq_lfo.layout((x1,y1), checkbutton_offset=(-5,-28)) s_freq_external.layout(offset = (x1+30, y1), checkbutton_offset = None) s_bandpass_offset.widget().place(x=x2, y=y0) s_bandpass_lag.widget().place(x=x3, y=y0, width=10, height=75) # Filter Resonace s_res = cfactory.normalized_slider(frame, "filterRes", editor) s_res_env1 = ExpSlider(frame, "filterRes_env1", editor, range_=1.0, degree=1) s_res_lfo = ExpSlider(frame, "filterRes_lfo", editor, range_=1.0, degree=1) x4 = x3 + 40 s_res.widget().place(x=x4, y=y0) s_res_env1.layout(offset=(x4-60, y1), checkbutton_offset=(-5,-28)) s_res_lfo.layout(offset=(x4, y1), checkbutton_offset=(-5,-28)) # Filter Mix s_filter_mix = cfactory.bipolar_slider(frame, "filterMix", editor) s_filter_mix_env1 = ExpSlider(frame, "filterMix_env1", editor, range_=1, degree=1) s_filter_mix_lfo = ExpSlider(frame, "filterMix_lfo", editor, range_=1, degree=1) x5 = x4 + 60 x6 = x5 + 60 s_filter_mix.widget().place(x=x5, y=y0) s_filter_mix_env1.layout(offset=(x5, y1), checkbutton_offset=(-5, -28)) s_filter_mix_lfo.layout(offset=(x6, y1), checkbutton_offset=(-5, -28)) self.add_control("filterFreq", s_freq) self.add_control("filterKeytrack", s_keytrack) self.add_control("bandpassOffset", s_bandpass_offset) self.add_control("bandpassLag", s_bandpass_lag) self.add_control("filterFreq_env1", s_freq_env1) self.add_control("filterFreq_lfo", s_freq_lfo) self.add_control("filterRes", s_res) self.add_control("filterRes_env1", s_res_env1) self.add_control("filterRes_lfo", s_res_lfo) self.add_control("filterMix", s_filter_mix) self.add_control("filterMix_env1", s_filter_mix_env1) self.add_control("filterMix_lfo", s_filter_mix_lfo) self.add_control("xToFilterFreq", s_freq_external) # Env1 s_env1_a = ExpSlider(frame, "env1Attack", editor, range_=8, degree=2) s_env1_d = ExpSlider(frame, "env1Decay", editor, range_=8, degree=2) s_env1_r = ExpSlider(frame, "env1Release", editor, range_=8, degree=2) s_env1_s = cfactory.normalized_slider(frame, "env1Sustain", editor) self.add_control("env1Attack", s_env1_a) self.add_control("env1Decay", s_env1_d) self.add_control("env1Release", s_env1_r) self.add_control("env1Sustain", s_env1_s) xenv = x6 + 90 xa = xenv xd = xa + 60 xs = xd + 60 xr = xs + 60 s_env1_a.layout(offset = (xa, y0), checkbutton_offset=None) s_env1_d.layout(offset = (xd, y0), checkbutton_offset=None) s_env1_r.layout(offset = (xr, y0), checkbutton_offset=None) s_env1_s.widget().place(x=xs, y=y0) # Env2 s_env2_a = ExpSlider(frame, "env2Attack", editor, range_=8, degree=2) s_env2_d = ExpSlider(frame, "env2Decay", editor, range_=8, degree=2) s_env2_r = ExpSlider(frame, "env2Release", editor, range_=8, degree=2) s_env2_s = cfactory.normalized_slider(frame, "env2Sustain", editor) self.add_control("env2Attack", s_env2_a) self.add_control("env2Decay", s_env2_d) self.add_control("env2Release", s_env2_r) self.add_control("env2Sustain", s_env2_s) xenv = x6 + 90 xa = xenv xd = xa + 60 xs = xd + 60 xr = xs + 60 s_env2_a.layout(offset = (xa, y1), checkbutton_offset=None) s_env2_d.layout(offset = (xd, y1), checkbutton_offset=None) s_env2_r.layout(offset = (xr, y1), checkbutton_offset=None) s_env2_s.widget().place(x=xs, y=y1) # LFO s_lfo_freq = ExpSlider(frame, "lfoFreq", editor, range_=20, degree=2, clip=(0.01,20)) s_lfo_delay = cfactory.linear_slider(frame, "lfoDelay", editor, range_=(0,4)) s_lfo_depth = cfactory.normalized_slider(frame, "lfoDepth", editor) self.add_control("lfoFreq", s_lfo_freq) self.add_control("lfoDelay", s_lfo_delay) self.add_control("lfoDepth", s_lfo_depth) xlfo = xr + 90 x1 = xlfo x2 = x1 + 60 x3 = x2 + 60 s_lfo_freq.layout(offset=(x1, y0), checkbutton_offset=None) s_lfo_delay.widget().place(x=x2, y=y0) s_lfo_depth.widget().place(x=x3, y=y0) # Vibrato s_vfreq = ExpSlider(frame, "vfreq", editor, range_=20, clip=(0.01,20)) s_vdelay = cfactory.linear_slider(frame, "vdelay", editor, range_=(0,4)) s_vsens = ExpSlider(frame, "vsens", editor, range_=1) s_vdepth = cfactory.normalized_slider(frame, "vdepth", editor) self.add_control("vfreq", s_vfreq) self.add_control("vdelay", s_vdelay) self.add_control("vsens", s_vsens) self.add_control("vdepth", s_vdepth) x4 = x3 + 60 s_vfreq.layout(offset=(x1, y1), checkbutton_offset=None) s_vdelay.widget().place(x=x2, y=y1) s_vsens.layout(offset=(x3, y1), checkbutton_offset=None) s_vdepth.widget().place(x=x4, y=y1) # Primary amp xamp = x4 + 60 s_amp = cfactory.volume_slider(frame, "amp", editor) self.add_control("amp", s_amp) s_amp.widget().place(x=xamp, y=y0)
def __init__(self, editor): frame = editor.create_tab(self.NAME, self.TAB_FILE) TkSubEditor.__init__(self, frame, editor, self.NAME) editor.add_child_editor(self.NAME, self) self.pack(expand=True, fill="both") lab_panel = factory.image_label(self, self.IMAGE_FILE) lab_panel.pack(anchor="nw", expand=False) s_spread = cf.linear_slider(frame, "spread", editor, range_=(0, 4)) s_cluster = cf.linear_slider(frame, "cluster", editor, range_=(0, 16)) s_pw = cf.normalized_slider(frame, "pw", editor) s_noise = cf.normalized_slider(frame, "noiseAmp", editor) xs_filter = ExpSlider(frame, "filterFreq", editor, range_=16000) s_res = cf.normalized_slider(frame, "res", editor) s_filter_mix = cf.normalized_slider(frame, "filterMix", editor) s_amp = cf.volume_slider(frame, "amp", editor) s_spread_env = cf.linear_slider(frame, "spreadEnv", editor, range_=(0, 4)) s_spread_lfo = cf.linear_slider(frame, "spreadLfo", editor, range_=(0, 4)) s_cluster_env = cf.linear_slider(frame, "clusterEnv", editor, range_=(-16, 16)) s_cluster_lfo = cf.linear_slider(frame, "clusterLfo", editor, range_=(0, 16)) s_cluster_lag = cf.normalized_slider(frame, "clusterLag", editor) s_pw_lfo = cf.normalized_slider(frame, "pwLfo", editor) xs_filter_env = ExpSlider(frame, "filterEnv", editor, range_=9999) xs_filter_lfo = ExpSlider(frame, "filterLfo", editor, range_=9999) s_filter_lag = cf.normalized_slider(frame, "filterLag", editor) self.add_control("spread", s_spread) self.add_control("cluster", s_cluster) self.add_control("pw", s_pw) self.add_control("noiseAmp", s_noise) self.add_control("filterFreq", xs_filter) self.add_control("res", s_res) self.add_control("filterMix", s_filter_mix) self.add_control("amp", s_amp) self.add_control("spreadEnv", s_spread_env) self.add_control("spreadLfo", s_spread_lfo) self.add_control("clusterEnv", s_cluster_env) self.add_control("clusterLfo", s_cluster_lfo) self.add_control("clusterLag", s_cluster_lag) self.add_control("pwLfo", s_pw_lfo) self.add_control("filterEnv", xs_filter_env) self.add_control("filterLfo", xs_filter_lfo) self.add_control("filterLag", s_filter_lag) y0 = 90 x0 = 90 x1 = x0 + 60 x2 = x1 + 60 x3 = x2 + 60 x4 = x3 + 60 xnoise = x4 + 75 xfilter = xnoise + 75 x5 = xfilter + 60 x6 = x5 + 60 xamp = x6 + 75 s_spread.widget().place(x=x0, y=y0) s_cluster.widget().place(x=x2, y=y0) s_pw.widget().place(x=x4, y=y0) s_noise.widget().place(x=xnoise, y=y0) xs_filter.layout(offset=(xfilter, y0), checkbutton_offset=None) s_res.widget().place(x=x5, y=y0) s_filter_mix.widget().place(x=x6, y=y0) s_amp.widget().place(x=xamp, y=y0) y1 = 320 s_spread_env.widget().place(x=x0, y=y1) s_spread_lfo.widget().place(x=x1, y=y1) s_cluster_env.widget().place(x=x2, y=y1) s_cluster_lfo.widget().place(x=x3, y=y1) s_cluster_lag.widget().place(x=x3 + 30, y=y1, width=10, height=75) s_pw_lfo.widget().place(x=x4 + 30, y=y1) xs_filter_env.layout(offset=(xfilter, y1), checkbutton_offset=(-4, -20)) xs_filter_lfo.layout(offset=(x5, y1), checkbutton_offset=(-4, -20)) s_filter_lag.widget().place(x=x5 + 30, y=y1, width=10, height=75)
def __init__(self, editor): frame = editor.create_tab(self.NAME, self.TAB_FILE) TkSubEditor.__init__(self, frame, editor, self.NAME) editor.add_child_editor(self.NAME, self) self.pack(expand=True, fill="both") lab_panel = factory.image_label(self, self.IMAGE_FILE) lab_panel.pack(anchor="nw", expand=False) xs_attack = ExpSlider(frame, "attack", editor, range_=32) xs_decay = ExpSlider(frame, "decay", editor, range_=32) s_sustain = cf.normalized_slider(frame, "sustain", editor) xs_release = ExpSlider(frame, "release", editor, range_=32) cb_envmode = cf.ControlCheckbutton(frame, "envMode", editor, values=(0, 1)) xs_lfo_freq = ExpSlider(frame, "lfoFreq", editor, range_=100) ds_lfo_ratios = cf.discrete_slider(frame, "lfo2FreqRatio", editor, values=LFO_RATIOS) xs_lfo_xmod = ExpSlider(frame, "lfoXMod", editor, range_=100) s_lfo_delay = cf.linear_slider(frame, "lfoDelay", editor, range_=(0, 8)) s_lfo_depth = cf.normalized_slider(frame, "lfoDepth", editor) s_vibrato = cf.normalized_slider(frame, "vibrato", editor) s_xspread = cf.normalized_slider(frame, "xToSpread", editor) s_xnoise = cf.normalized_slider(frame, "xToNoise", editor) s_xfilter = cf.normalized_slider(frame, "xToFilter", editor) s_xscale = cf.linear_slider(frame, "xScale", editor, range_=(0, 4)) self.add_control("attack", xs_attack) self.add_control("decay", xs_decay) self.add_control("sustain", s_sustain) self.add_control("release", xs_release) self.add_control("envMode", cb_envmode) self.add_control("lfoFreq", xs_lfo_freq) self.add_control("lfo2FreqRatio", ds_lfo_ratios) self.add_control("lfoXMod", xs_lfo_xmod) self.add_control("lfoDelay", s_lfo_delay) self.add_control("lfoDepth", s_lfo_depth) self.add_control("vibrato", s_vibrato) self.add_control("xToSpread", s_xspread) self.add_control("xToNoise", s_xnoise) self.add_control("xToFilter", s_xfilter) self.add_control("xScale", s_xscale) y0 = 90 x0 = 90 x1 = x0 + 60 x2 = x1 + 60 x3 = x2 + 60 x4 = x3 + 60 #5 = x4 + 30 xlfo = x4 + 75 x6 = xlfo x7 = x6 + 60 x8 = x7 + 60 x9 = x8 + 60 x10 = x9 + 60 x11 = x10 + 60 xs_attack.layout(offset=(x0, y0), checkbutton_offset=None, height=380) xs_decay.layout(offset=(x1, y0), checkbutton_offset=None, height=380) s_sustain.widget().place(x=x2, y=y0, height=380) xs_release.layout(offset=(x3, y0), checkbutton_offset=None, height=380) cb_envmode.widget().place(x=x4, y=y0) xs_lfo_freq.layout(offset=(x6, y0), checkbutton_offset=None, height=380) xs_lfo_xmod.layout(offset=(x7, y0), checkbutton_offset=None, height=380) ds_lfo_ratios.widget().place(x=x8, y=y0) s_lfo_delay.widget().place(x=x9, y=y0) s_lfo_depth.widget().place(x=x10, y=y0) s_vibrato.widget().place(x=x11, y=y0) y1 = 320 s_xspread.widget().place(x=x8, y=y1) s_xnoise.widget().place(x=x9, y=y1) s_xfilter.widget().place(x=x10, y=y1) s_xscale.widget().place(x=x11, y=y1)
def __init__(self, master, app, synth_type, is_efx=False, is_controller=False): Toplevel.__init__(self, master) main = factory.frame(self) main.pack(anchor=W, expand=True, fill=BOTH) self.app = app self.stype = synth_type self.is_efx = is_efx self.is_controller = is_controller sid = "%s_%d" % (synth_type, SynthProxy.current_synth_serial_number()) specs = SynthSpecs.global_synth_type_registry[synth_type] self._combo_audio_in = {} # Maps synth parameter to combo box self._combo_audio_out = {} self._combo_control_in = {} self._combo_control_out = {} self._buffername_map = {} title = "Add %s " % synth_type if is_efx: title += "Effect" elif is_controller: title += "Controller Synth" else: title += "Synth" title += " sid = %s" % sid frame_north = factory.frame(main) frame_north.grid(row=0, column=0, columnspan=2, sticky='ew', padx=4, pady=8) logo_filename = os.path.join("resources", synth_type, "logo_small.png") lab_logo = factory.image_label(frame_north, logo_filename, synth_type) lab_id = factory.dialog_title_label(frame_north, title) lab_logo.grid(row=0, column=0, padx=8) lab_id.grid(row=0, column=1) # Audio Input Buses frame_audio_in = factory.label_frame(main, "Audio Input Buses") row = 0 for i in range(MAX_BUS_COUNT): try: b = specs["audio-input-buses"][i] param = b[0] lab_name = factory.label(frame_audio_in, "%d - %s" % (i + 1, param)) combo = factory.audio_bus_combobox(frame_audio_in, self.app) combo.set(b[1]) lab_name.grid(row=row, column=0, sticky="w", padx=4, pady=4) combo.grid(row=row, column=1, sticky="w", padx=4, pady=4) self._combo_audio_in[param] = combo except IndexError: lab_dummy = factory.label(frame_audio_in, "%d - n/a" % (i + 1, )) lab_dummy.grid(row=row, column=0) row += 1 factory.padding_label(frame_audio_in).grid(row=row, column=0) frame_audio_in.grid(row=1, column=0, padx=4, pady=4, sticky='ew') # Audio Output Buses frame_audio_out = factory.label_frame(main, "Audio Output Buses") row = 0 for i in range(MAX_BUS_COUNT): try: b = specs["audio-output-buses"][i] param = b[0] lab_name = factory.label(frame_audio_out, "%d - %s" % (i + 1, param)) combo = factory.audio_bus_combobox(frame_audio_out, self.app) combo.set(b[1]) lab_name.grid(row=row, column=0, sticky="w", padx=4, pady=4) combo.grid(row=row, column=1, sticky="w", padx=4, pady=4) self._combo_audio_out[param] = combo except IndexError: lab_dummy = factory.label(frame_audio_out, "%d - n/a" % (i + 1, )) lab_dummy.grid(row=row, column=0) row += 1 factory.padding_label(frame_audio_out).grid(row=row, column=0) frame_audio_out.grid(row=5, column=0, padx=4, pady=4, sticky='ew') # Control Input Buses frame_control_in = factory.label_frame(main, "Control Input Buses") row = 0 for i in range(MAX_BUS_COUNT): try: b = specs["control-input-buses"][i] param = b[0] lab_name = factory.label(frame_control_in, "%d - %s" % (i + 1, param)) combo = factory.control_bus_combobox(frame_control_in, self.app) combo.set(b[1]) lab_name.grid(row=row, column=0, sticky="w", padx=4, pady=4) combo.grid(row=row, column=1, sticky="w", padx=4, pady=4) self._combo_control_in[param] = combo except IndexError: lab_dummy = factory.label(frame_control_in, "%d - n/a" % (i + 1, )) lab_dummy.grid(row=row, column=0) row += 1 factory.padding_label(frame_control_in).grid(row=row, column=0) frame_control_in.grid(row=1, column=3, padx=4, pady=4, sticky='ew') # Control Output Buses frame_control_out = factory.label_frame(main, "Control Output Buses") row = 0 for i in range(MAX_BUS_COUNT): try: b = specs["control-output-buses"][i] param = b[0] lab_name = factory.label(frame_control_out, "%d - %s" % (i + 1, param)) combo = factory.control_bus_combobox(frame_control_out, self.app) combo.set(b[1]) lab_name.grid(row=row, column=0, sticky="w", padx=4, pady=4) combo.grid(row=row, column=1, sticky="w", padx=4, pady=4) self._combo_control_out[param] = combo except IndexError: lab_dummy = factory.label(frame_control_out, "%d - n/a" % (i + 1, )) lab_dummy.grid(row=row, column=0) row += 1 factory.padding_label(frame_control_out).grid(row=row, column=0) frame_control_out.grid(row=5, column=3, padx=4, pady=4, sticky='ew') # Buffers # if specs["buffers"]: # frame_buffers = factory.label_frame(main, "Buffers") # row = 0 # for param in specs["buffers"]: # lab_name = factory.label(frame_buffers, param) # combo = factory.buffer_combobox(frame_buffers, self.app) # lab_name.grid(row=row, column=0, sticky="w", padx=4, pady=4) # combo.grid(row=row, column=1, sticky="w", padx=4, pady=4) # self._buffername_map[param] = combo # row += 1 # factory.padding_label(frame_buffers).grid(row=row, column=0, sticky='ew') # frame_buffers.grid(row=9, column=3, padx=4, pady=4) # Keymode self.var_keymode = StringVar() self.var_voice_count = StringVar() self.var_voice_count.set(8) frame_keymode = factory.label_frame(main, "Key mode") col = 0 for km in specs["keymodes"]: rb = factory.radio(frame_keymode, km, self.var_keymode, km) rb.grid(row=0, column=col, sticky="w", padx=4, pady=4) col += 1 self.var_keymode.set(specs["keymodes"][0]) # Set default keymode lab_vc = factory.label(frame_keymode, "Voice count") spin_vc = factory.int_spinbox(frame_keymode, self.var_voice_count, from_=1, to=128) lab_vc.grid(row=1, column=0, padx=4) spin_vc.grid(row=1, column=1, columnspan=3, padx=4, pady=4) frame_keymode.grid(row=9, column=0, padx=4, pady=4, sticky='ew') factory.padding_label(frame_keymode).grid(row=2, column=0) # South Toolbar toolbar = factory.frame(main) b_help = factory.help_button(toolbar, command=self.display_help) b_accept = factory.accept_button(toolbar, command=self.accept) b_cancel = factory.cancel_button(toolbar, command=self.cancel) b_help.grid(row=0, column=0, sticky="w") factory.padding_label(toolbar).grid(row=0, column=1) b_accept.grid(row=0, column=2, sticky="e") b_cancel.grid(row=0, column=3, sticky="e") toolbar.grid(row=10, column=0, columnspan=5, sticky="ew", padx=4, pady=8)
def __init__(self, editor): frame = editor.create_tab(self.NAME) 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) # Envelopes s_env1_a = ExpSlider(frame, "env1Attack", editor, range_=60, degree=5, ttip="ENV1 Attack") s_env1_d = ExpSlider(frame, "env1Decay", editor, range_=60, degree=5, ttip="ENV1 Decay") s_env1_s = cfactory.normalized_slider(frame, "env1Sustain", editor, ttip="ENV1 Sustain") s_env1_r = ExpSlider(frame, "env1Release", editor, range_=60, degree=5, ttip="ENV1 Release") s_env2_a = ExpSlider(frame, "env2Attack", editor, range_=60, degree=5, ttip="ENV2 Attack") s_env2_d = ExpSlider(frame, "env2Decay", editor, range_=60, degree=5, ttip="ENV2 Decay") s_env2_s = cfactory.normalized_slider(frame, "env2Sustain", editor, ttip="ENV2 Sustain") s_env2_r = ExpSlider(frame, "env2Release", editor, range_=60, degree=5, ttip="ENV2 Release") y0, y1 = 50, 300 x0 = 60 x1 = x0 + 60 x2 = x1 + 60 x3 = x2 + 60 s_env1_a.layout((x0, y0), checkbutton_offset=None) s_env1_d.layout((x1, y0), checkbutton_offset=None) s_env1_s.widget().place(x=x2, y=y0) s_env1_r.layout((x3, y0), checkbutton_offset=None) s_env2_a.layout((x0, y1), checkbutton_offset=None) s_env2_d.layout((x1, y1), checkbutton_offset=None) s_env2_s.widget().place(x=x2, y=y1) s_env2_r.layout((x3, y1), checkbutton_offset=None) self.add_control("env1Attack", s_env1_a) self.add_control("env1Decay", s_env1_d) self.add_control("env1Sustain", s_env1_s) self.add_control("env1Release", s_env1_r) self.add_control("env2Attack", s_env2_a) self.add_control("env2Decay", s_env2_d) self.add_control("env2Sustain", s_env2_s) self.add_control("env2Release", s_env2_r) # Vibrato s_vfreq = cfactory.simple_lfo_freq_slider(frame, "vfreq", editor, "Vibrato frequency") s_vsens = cfactory.normalized_slider(frame, "vsens", editor, "Vibrato Sensitivity") s_vdelay = cfactory.linear_slider(frame, "vdelay", editor, range_=(0, 4), ttip="Vibrato delay") s_vdepth = cfactory.normalized_slider(frame, "vdepth", editor, "Vibrato depth") x4 = x3 + 90 x5 = x4 + 60 x6 = x5 + 60 x7 = x6 + 60 s_vfreq.widget().place(x=x4, y=y0) s_vdelay.widget().place(x=x5, y=y0) s_vdepth.widget().place(x=x6, y=y0) s_vsens.widget().place(x=x7, y=y0) self.add_control("vfreq", s_vfreq) self.add_control("vsens", s_vsens) self.add_control("vdelay", s_vdelay) self.add_control("vdepth", s_vdepth) # LFO s_lfo_freq = cfactory.simple_lfo_freq_slider(frame, "lfoFreq", editor, "LFO Frequency") s_lfo_delay = cfactory.linear_slider(frame, "lfoDelay", editor, range_=(0, 4), ttip="LFO delay") s_lfo_depth = cfactory.normalized_slider(frame, "lfoDepth", editor, "LFO depth") s_lfo_freq.widget().place(x=x4, y=y1) s_lfo_delay.widget().place(x=x5, y=y1) s_lfo_depth.widget().place(x=x6, y=y1) self.add_control("lfoFreq", s_lfo_freq) self.add_control("lfoDelay", s_lfo_delay) self.add_control("lfoDepth", s_lfo_depth) # Amp x8 = x7 + 90 s_amp = cfactory.volume_slider(frame, "amp", editor) s_amp.widget().place(x=x8, y=y0)
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) y0, y1, y2 = 60, 170, 280 x0, xdelta = 60, 30 for i in range(9): j = i+1 x = x0 + i * xdelta pa = "a%d" % j sa = cfactory.normalized_slider(frame, pa, editor) self.add_control(pa, sa) sa.widget().place(x=x, y=y0, height=100, width=10) pp = "p%d" % j sp = cfactory.normalized_slider(frame, pp, editor) self.add_control(pp, sp) sp.widget().place(x=x, y=y1, height=100, width=10) px = "x%d" % j sx = cfactory.normalized_slider(frame, px, editor) self.add_control(px, sx) sx.widget().place(x=x, y=y2, height=100, width=10) # Envelope xenv = x0 + (xdelta * 10) s_attack = ExpSlider(frame, "attack", editor, range_=1) s_decay = ExpSlider(frame, "decay", editor, range_=1) self.add_control("attack", s_attack) self.add_control("decay", s_decay) s_attack.layout(offset = (xenv, y0+30), height = 100, width = 14, checkbutton_offset = None) s_decay.layout(offset = (xenv, y2-30), height = 100, width = 14, checkbutton_offset = None) # Vibrato xvib = xenv + 120 s_vfreq = ExpSlider(frame, "vfreq", editor, range_=8, degree=2) s_vdelay = cfactory.linear_slider(frame, "vdelay", editor, range_=(0,4)) s_vsens = cfactory.normalized_slider(frame, "vsens", editor) s_vdepth = cfactory.normalized_slider(frame, "vdepth", editor) self.add_control("vfreq", s_vfreq) self.add_control("vdelay", s_vfreq) self.add_control("vdepth", s_vdepth) s_vfreq.layout(offset=(xvib, y0),checkbutton_offset = None) s_vdelay.widget().place(x=xvib+60, y=y0) s_vsens.widget().place(x=xvib+120, y=y0) s_vdepth.widget().place(x=xvib+180, y=y0) # X Bus xx = xvib s_xbias = cfactory.linear_slider(frame, "xBias", editor, range_=(-2,2)) s_xscale = cfactory.linear_slider(frame, "xScale", editor, range_=(0, 2)) s_xfreq = ExpSlider(frame, "xToFreq", editor, range_=1) self.add_control("xBias", s_xbias) self.add_control("xScale", s_xscale) self.add_control("xToFreq", s_xfreq) s_xbias.widget().place(x=xx, y=y2) s_xscale.widget().place(x=xx+60, y=y2) s_xfreq.layout(offset=(xx+120, y2), checkbutton_offset=None) # AMP s_amp = cfactory.volume_slider(frame, "amp", editor) self.add_control("amp", s_amp) s_amp.widget().place(x=xx+188, y=y2)
def __init__(self, editor): frame = editor.create_tab(self.NAME, self.TAB_FILE) lab_panel = factory.image_label(frame, self.IMAGE_FILE) lab_panel.pack(anchor="nw", expand=False)
def __init__(self, editor): frame = editor.create_tab(self.NAME, self.TAB_FILE) lab_panel = factory.image_label(frame, self.IMAGE_FILE) lab_panel.pack(anchor="nw", expand=False)
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) # Filter Freq s_freq = cfactory.third_octave_slider(frame, "filterFreq", editor, "Filter frequency") s_keytrack = cfactory.linear_slider(frame, "filterKeytrack", editor, range_=(0.0, 4.0)) s_freq_env1 = ExpSlider(frame, "filterFreq_env1", editor, range_=12000, degree=4) s_freq_lfo = ExpSlider(frame, "filterFreq_lfo", editor, range_=12000, degree=4) s_freq_external = ExpSlider(frame, "xToFilterFreq", editor, range_=12000, degree=4) s_bandpass_offset = cfactory.linear_slider(frame, "bandpassOffset", editor, range_=(1, 16)) s_bandpass_lag = cfactory.normalized_slider(frame, "bandpassLag", editor) y0, y1 = 50, 300 x0 = 60 x1 = x0 + 60 x2 = x1 + 60 x3 = x2 + 40 s_freq.widget().place(x=x0, y=y0) s_keytrack.widget().place(x=x1, y=y0) s_freq_env1.layout((x0, y1), checkbutton_offset=(-5, -28)) s_freq_lfo.layout((x1, y1), checkbutton_offset=(-5, -28)) s_freq_external.layout(offset=(x1 + 30, y1), checkbutton_offset=None) s_bandpass_offset.widget().place(x=x2, y=y0) s_bandpass_lag.widget().place(x=x3, y=y0, width=10, height=75) # Filter Resonace s_res = cfactory.normalized_slider(frame, "filterRes", editor) s_res_env1 = ExpSlider(frame, "filterRes_env1", editor, range_=1.0, degree=1) s_res_lfo = ExpSlider(frame, "filterRes_lfo", editor, range_=1.0, degree=1) x4 = x3 + 40 s_res.widget().place(x=x4, y=y0) s_res_env1.layout(offset=(x4 - 60, y1), checkbutton_offset=(-5, -28)) s_res_lfo.layout(offset=(x4, y1), checkbutton_offset=(-5, -28)) # Filter Mix s_filter_mix = cfactory.bipolar_slider(frame, "filterMix", editor) s_filter_mix_env1 = ExpSlider(frame, "filterMix_env1", editor, range_=1, degree=1) s_filter_mix_lfo = ExpSlider(frame, "filterMix_lfo", editor, range_=1, degree=1) x5 = x4 + 60 x6 = x5 + 60 s_filter_mix.widget().place(x=x5, y=y0) s_filter_mix_env1.layout(offset=(x5, y1), checkbutton_offset=(-5, -28)) s_filter_mix_lfo.layout(offset=(x6, y1), checkbutton_offset=(-5, -28)) self.add_control("filterFreq", s_freq) self.add_control("filterKeytrack", s_keytrack) self.add_control("bandpassOffset", s_bandpass_offset) self.add_control("bandpassLag", s_bandpass_lag) self.add_control("filterFreq_env1", s_freq_env1) self.add_control("filterFreq_lfo", s_freq_lfo) self.add_control("filterRes", s_res) self.add_control("filterRes_env1", s_res_env1) self.add_control("filterRes_lfo", s_res_lfo) self.add_control("filterMix", s_filter_mix) self.add_control("filterMix_env1", s_filter_mix_env1) self.add_control("filterMix_lfo", s_filter_mix_lfo) self.add_control("xToFilterFreq", s_freq_external) # Env1 s_env1_a = ExpSlider(frame, "env1Attack", editor, range_=8, degree=2) s_env1_d = ExpSlider(frame, "env1Decay", editor, range_=8, degree=2) s_env1_r = ExpSlider(frame, "env1Release", editor, range_=8, degree=2) s_env1_s = cfactory.normalized_slider(frame, "env1Sustain", editor) self.add_control("env1Attack", s_env1_a) self.add_control("env1Decay", s_env1_d) self.add_control("env1Release", s_env1_r) self.add_control("env1Sustain", s_env1_s) xenv = x6 + 90 xa = xenv xd = xa + 60 xs = xd + 60 xr = xs + 60 s_env1_a.layout(offset=(xa, y0), checkbutton_offset=None) s_env1_d.layout(offset=(xd, y0), checkbutton_offset=None) s_env1_r.layout(offset=(xr, y0), checkbutton_offset=None) s_env1_s.widget().place(x=xs, y=y0) # Env2 s_env2_a = ExpSlider(frame, "env2Attack", editor, range_=8, degree=2) s_env2_d = ExpSlider(frame, "env2Decay", editor, range_=8, degree=2) s_env2_r = ExpSlider(frame, "env2Release", editor, range_=8, degree=2) s_env2_s = cfactory.normalized_slider(frame, "env2Sustain", editor) self.add_control("env2Attack", s_env2_a) self.add_control("env2Decay", s_env2_d) self.add_control("env2Release", s_env2_r) self.add_control("env2Sustain", s_env2_s) xenv = x6 + 90 xa = xenv xd = xa + 60 xs = xd + 60 xr = xs + 60 s_env2_a.layout(offset=(xa, y1), checkbutton_offset=None) s_env2_d.layout(offset=(xd, y1), checkbutton_offset=None) s_env2_r.layout(offset=(xr, y1), checkbutton_offset=None) s_env2_s.widget().place(x=xs, y=y1) # LFO s_lfo_freq = ExpSlider(frame, "lfoFreq", editor, range_=20, degree=2, clip=(0.01, 20)) s_lfo_delay = cfactory.linear_slider(frame, "lfoDelay", editor, range_=(0, 4)) s_lfo_depth = cfactory.normalized_slider(frame, "lfoDepth", editor) self.add_control("lfoFreq", s_lfo_freq) self.add_control("lfoDelay", s_lfo_delay) self.add_control("lfoDepth", s_lfo_depth) xlfo = xr + 90 x1 = xlfo x2 = x1 + 60 x3 = x2 + 60 s_lfo_freq.layout(offset=(x1, y0), checkbutton_offset=None) s_lfo_delay.widget().place(x=x2, y=y0) s_lfo_depth.widget().place(x=x3, y=y0) # Vibrato s_vfreq = ExpSlider(frame, "vfreq", editor, range_=20, clip=(0.01, 20)) s_vdelay = cfactory.linear_slider(frame, "vdelay", editor, range_=(0, 4)) s_vsens = ExpSlider(frame, "vsens", editor, range_=1) s_vdepth = cfactory.normalized_slider(frame, "vdepth", editor) self.add_control("vfreq", s_vfreq) self.add_control("vdelay", s_vdelay) self.add_control("vsens", s_vsens) self.add_control("vdepth", s_vdepth) x4 = x3 + 60 s_vfreq.layout(offset=(x1, y1), checkbutton_offset=None) s_vdelay.widget().place(x=x2, y=y1) s_vsens.layout(offset=(x3, y1), checkbutton_offset=None) s_vdepth.widget().place(x=x4, y=y1) # Primary amp xamp = x4 + 60 s_amp = cfactory.volume_slider(frame, "amp", editor) self.add_control("amp", s_amp) s_amp.widget().place(x=xamp, y=y0)
def __init__(self, editor): frame = editor.create_tab(self.NAME, self.TAB_FILE) TkSubEditor.__init__(self, frame, editor, self.NAME) editor.add_child_editor(self.NAME, self) self.pack(expand=True, fill="both") lab_panel = factory.image_label(self, self.IMAGE_FILE) lab_panel.pack(anchor="nw", expand=False) s_spread = cf.linear_slider(frame, "spread", editor, range_=(0,4)) s_cluster = cf.linear_slider(frame, "cluster", editor, range_=(0,16)) s_pw = cf.normalized_slider(frame, "pw", editor) s_noise = cf.normalized_slider(frame, "noiseAmp", editor) xs_filter = ExpSlider(frame, "filterFreq", editor, range_=16000) s_res = cf.normalized_slider(frame, "res", editor) s_filter_mix = cf.normalized_slider(frame, "filterMix", editor) s_amp = cf.volume_slider(frame, "amp", editor) s_spread_env = cf.linear_slider(frame, "spreadEnv", editor, range_ = (0,4)) s_spread_lfo = cf.linear_slider(frame, "spreadLfo", editor, range_ = (0,4)) s_cluster_env = cf.linear_slider(frame, "clusterEnv", editor, range_ = (-16, 16)) s_cluster_lfo = cf.linear_slider(frame, "clusterLfo", editor, range_ = (0, 16)) s_cluster_lag = cf.normalized_slider(frame, "clusterLag", editor) s_pw_lfo = cf.normalized_slider(frame, "pwLfo", editor) xs_filter_env = ExpSlider(frame, "filterEnv", editor, range_ = 9999) xs_filter_lfo = ExpSlider(frame, "filterLfo", editor, range_ = 9999) s_filter_lag = cf.normalized_slider(frame, "filterLag", editor) self.add_control("spread", s_spread) self.add_control("cluster", s_cluster) self.add_control("pw", s_pw) self.add_control("noiseAmp", s_noise) self.add_control("filterFreq", xs_filter) self.add_control("res", s_res) self.add_control("filterMix", s_filter_mix) self.add_control("amp", s_amp) self.add_control("spreadEnv", s_spread_env) self.add_control("spreadLfo", s_spread_lfo) self.add_control("clusterEnv", s_cluster_env) self.add_control("clusterLfo", s_cluster_lfo) self.add_control("clusterLag", s_cluster_lag) self.add_control("pwLfo", s_pw_lfo) self.add_control("filterEnv", xs_filter_env) self.add_control("filterLfo", xs_filter_lfo) self.add_control("filterLag", s_filter_lag) y0 = 90 x0 = 90 x1 = x0 + 60 x2 = x1 + 60 x3 = x2 + 60 x4 = x3 + 60 xnoise = x4 + 75 xfilter = xnoise + 75 x5 = xfilter + 60 x6 = x5 + 60 xamp = x6 + 75 s_spread.widget().place(x=x0, y=y0) s_cluster.widget().place(x=x2, y=y0) s_pw.widget().place(x=x4, y=y0) s_noise.widget().place(x=xnoise, y=y0) xs_filter.layout(offset=(xfilter,y0), checkbutton_offset=None) s_res.widget().place(x=x5, y=y0) s_filter_mix.widget().place(x=x6, y=y0) s_amp.widget().place(x=xamp, y=y0) y1 = 320 s_spread_env.widget().place(x=x0, y=y1) s_spread_lfo.widget().place(x=x1, y=y1) s_cluster_env.widget().place(x=x2, y=y1) s_cluster_lfo.widget().place(x=x3, y=y1) s_cluster_lag.widget().place(x=x3+30, y=y1, width=10, height=75) s_pw_lfo.widget().place(x=x4+30, y=y1) xs_filter_env.layout(offset=(xfilter, y1), checkbutton_offset = (-4, -20)) xs_filter_lfo.layout(offset=(x5, y1), checkbutton_offset = (-4, -20)) s_filter_lag.widget().place(x=x5+30, y=y1, width=10, height=75)
def __init__(self, editor): frame = editor.create_tab(self.NAME, self.TAB_FILE) TkSubEditor.__init__(self, frame, editor, self.NAME) editor.add_child_editor(self.NAME, self) self.pack(expand=True, fill="both") lab_panel = factory.image_label(self, self.IMAGE_FILE) lab_panel.pack(anchor="nw", expand=False) xs_attack = ExpSlider(frame, "attack", editor, range_= 32) xs_decay = ExpSlider(frame, "decay", editor, range_= 32) s_sustain = cf.normalized_slider(frame, "sustain", editor) xs_release = ExpSlider(frame, "release", editor, range_= 32) cb_envmode = cf.ControlCheckbutton(frame, "envMode", editor, values=(0,1)) xs_lfo_freq = ExpSlider(frame, "lfoFreq", editor, range_= 100) ds_lfo_ratios = cf.discrete_slider(frame,"lfo2FreqRatio", editor, values=LFO_RATIOS) xs_lfo_xmod = ExpSlider(frame, "lfoXMod", editor, range_= 100) s_lfo_delay = cf.linear_slider(frame, "lfoDelay", editor, range_=(0,8)) s_lfo_depth = cf.normalized_slider(frame, "lfoDepth", editor) s_vibrato = cf.normalized_slider(frame, "vibrato", editor) s_xspread = cf.normalized_slider(frame, "xToSpread", editor) s_xnoise = cf.normalized_slider(frame, "xToNoise", editor) s_xfilter = cf.normalized_slider(frame, "xToFilter", editor) s_xscale = cf.linear_slider(frame, "xScale", editor, range_=(0,4)) self.add_control("attack", xs_attack) self.add_control("decay", xs_decay) self.add_control("sustain", s_sustain) self.add_control("release", xs_release) self.add_control("envMode", cb_envmode) self.add_control("lfoFreq",xs_lfo_freq) self.add_control("lfo2FreqRatio",ds_lfo_ratios) self.add_control("lfoXMod",xs_lfo_xmod) self.add_control("lfoDelay",s_lfo_delay) self.add_control("lfoDepth",s_lfo_depth) self.add_control("vibrato",s_vibrato) self.add_control("xToSpread", s_xspread) self.add_control("xToNoise", s_xnoise) self.add_control("xToFilter", s_xfilter) self.add_control("xScale", s_xscale) y0 = 90 x0 = 90 x1 = x0 + 60 x2 = x1 + 60 x3 = x2 + 60 x4 = x3 + 60 #5 = x4 + 30 xlfo = x4 + 75 x6 = xlfo x7 = x6 + 60 x8 = x7 + 60 x9 = x8 + 60 x10 = x9 + 60 x11 = x10 + 60 xs_attack.layout(offset = (x0, y0), checkbutton_offset =None, height=380) xs_decay.layout(offset = (x1, y0), checkbutton_offset =None, height=380) s_sustain.widget().place(x=x2, y=y0, height=380) xs_release.layout(offset = (x3, y0), checkbutton_offset =None, height=380) cb_envmode.widget().place(x=x4, y=y0) xs_lfo_freq.layout(offset=(x6, y0),checkbutton_offset = None, height=380) xs_lfo_xmod.layout(offset=(x7, y0),checkbutton_offset = None, height=380) ds_lfo_ratios.widget().place(x=x8, y=y0) s_lfo_delay.widget().place(x=x9, y=y0) s_lfo_depth.widget().place(x=x10, y=y0) s_vibrato.widget().place(x=x11, y=y0) y1 = 320 s_xspread.widget().place(x=x8, y=y1) s_xnoise.widget().place(x=x9, y=y1) s_xfilter.widget().place(x=x10, y=y1) s_xscale.widget().place(x=x11, y=y1)
def __init__(self, editor): frame = editor.create_tab(self.NAME) 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) # Envelopes s_env1_a = ExpSlider(frame, "env1Attack", editor,range_=60, degree=5,ttip="ENV1 Attack") s_env1_d = ExpSlider(frame, "env1Decay", editor,range_=60, degree=5,ttip="ENV1 Decay") s_env1_s = cfactory.normalized_slider(frame, "env1Sustain", editor, ttip="ENV1 Sustain") s_env1_r = ExpSlider(frame, "env1Release", editor,range_=60, degree=5,ttip="ENV1 Release") s_env2_a = ExpSlider(frame, "env2Attack", editor,range_=60, degree=5,ttip="ENV2 Attack") s_env2_d = ExpSlider(frame, "env2Decay", editor,range_=60, degree=5,ttip="ENV2 Decay") s_env2_s = cfactory.normalized_slider(frame, "env2Sustain", editor, ttip="ENV2 Sustain") s_env2_r = ExpSlider(frame, "env2Release", editor,range_=60, degree=5,ttip="ENV2 Release") y0, y1 = 50, 300 x0 = 60 x1 = x0+60 x2 = x1+60 x3 = x2+60 s_env1_a.layout((x0, y0), checkbutton_offset = None) s_env1_d.layout((x1, y0), checkbutton_offset = None) s_env1_s.widget().place(x=x2, y=y0) s_env1_r.layout((x3, y0), checkbutton_offset = None) s_env2_a.layout((x0, y1), checkbutton_offset = None) s_env2_d.layout((x1, y1), checkbutton_offset = None) s_env2_s.widget().place(x=x2, y=y1) s_env2_r.layout((x3, y1), checkbutton_offset = None) self.add_control("env1Attack", s_env1_a) self.add_control("env1Decay", s_env1_d) self.add_control("env1Sustain", s_env1_s) self.add_control("env1Release", s_env1_r) self.add_control("env2Attack", s_env2_a) self.add_control("env2Decay", s_env2_d) self.add_control("env2Sustain", s_env2_s) self.add_control("env2Release", s_env2_r) # Vibrato s_vfreq = cfactory.simple_lfo_freq_slider(frame,"vfreq",editor,"Vibrato frequency") s_vsens = cfactory.normalized_slider(frame,"vsens",editor,"Vibrato Sensitivity") s_vdelay = cfactory.linear_slider(frame,"vdelay",editor,range_=(0,4),ttip="Vibrato delay") s_vdepth = cfactory.normalized_slider(frame,"vdepth",editor,"Vibrato depth") x4 = x3+90 x5 = x4+60 x6 = x5+60 x7 = x6+60 s_vfreq.widget().place(x=x4, y=y0) s_vdelay.widget().place(x=x5, y=y0) s_vdepth.widget().place(x=x6, y=y0) s_vsens.widget().place(x=x7, y=y0) self.add_control("vfreq",s_vfreq) self.add_control("vsens",s_vsens) self.add_control("vdelay",s_vdelay) self.add_control("vdepth",s_vdepth) # LFO s_lfo_freq = cfactory.simple_lfo_freq_slider(frame,"lfoFreq",editor,"LFO Frequency") s_lfo_delay = cfactory.linear_slider(frame,"lfoDelay",editor,range_=(0,4),ttip="LFO delay") s_lfo_depth = cfactory.normalized_slider(frame,"lfoDepth",editor,"LFO depth") s_lfo_freq.widget().place(x=x4, y=y1) s_lfo_delay.widget().place(x=x5, y=y1) s_lfo_depth.widget().place(x=x6, y=y1) self.add_control("lfoFreq",s_lfo_freq) self.add_control("lfoDelay",s_lfo_delay) self.add_control("lfoDepth",s_lfo_depth) # Amp x8 = x7+90 s_amp = cfactory.volume_slider(frame, "amp", editor) s_amp.widget().place(x=x8, y=y0)
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) y0, y1, y2 = 60, 170, 280 x0, xdelta = 60, 30 for i in range(9): j = i + 1 x = x0 + i * xdelta pa = "a%d" % j sa = cfactory.normalized_slider(frame, pa, editor) self.add_control(pa, sa) sa.widget().place(x=x, y=y0, height=100, width=10) pp = "p%d" % j sp = cfactory.normalized_slider(frame, pp, editor) self.add_control(pp, sp) sp.widget().place(x=x, y=y1, height=100, width=10) px = "x%d" % j sx = cfactory.normalized_slider(frame, px, editor) self.add_control(px, sx) sx.widget().place(x=x, y=y2, height=100, width=10) # Envelope xenv = x0 + (xdelta * 10) s_attack = ExpSlider(frame, "attack", editor, range_=1) s_decay = ExpSlider(frame, "decay", editor, range_=1) self.add_control("attack", s_attack) self.add_control("decay", s_decay) s_attack.layout(offset=(xenv, y0 + 30), height=100, width=14, checkbutton_offset=None) s_decay.layout(offset=(xenv, y2 - 30), height=100, width=14, checkbutton_offset=None) # Vibrato xvib = xenv + 120 s_vfreq = ExpSlider(frame, "vfreq", editor, range_=8, degree=2) s_vdelay = cfactory.linear_slider(frame, "vdelay", editor, range_=(0, 4)) s_vsens = cfactory.normalized_slider(frame, "vsens", editor) s_vdepth = cfactory.normalized_slider(frame, "vdepth", editor) self.add_control("vfreq", s_vfreq) self.add_control("vdelay", s_vfreq) self.add_control("vdepth", s_vdepth) s_vfreq.layout(offset=(xvib, y0), checkbutton_offset=None) s_vdelay.widget().place(x=xvib + 60, y=y0) s_vsens.widget().place(x=xvib + 120, y=y0) s_vdepth.widget().place(x=xvib + 180, y=y0) # X Bus xx = xvib s_xbias = cfactory.linear_slider(frame, "xBias", editor, range_=(-2, 2)) s_xscale = cfactory.linear_slider(frame, "xScale", editor, range_=(0, 2)) s_xfreq = ExpSlider(frame, "xToFreq", editor, range_=1) self.add_control("xBias", s_xbias) self.add_control("xScale", s_xscale) self.add_control("xToFreq", s_xfreq) s_xbias.widget().place(x=xx, y=y2) s_xscale.widget().place(x=xx + 60, y=y2) s_xfreq.layout(offset=(xx + 120, y2), checkbutton_offset=None) # AMP s_amp = cfactory.volume_slider(frame, "amp", editor) self.add_control("amp", s_amp) s_amp.widget().place(x=xx + 188, y=y2)
def __init__(self, master, app, synth_type, is_efx=False, is_controller=False): Toplevel.__init__(self, master) main = factory.frame(self) main.pack(anchor=W, expand=True, fill=BOTH) self.app = app self.stype = synth_type self.is_efx = is_efx self.is_controller = is_controller sid = "%s_%d" % (synth_type, SynthProxy.current_synth_serial_number()) specs = SynthSpecs.global_synth_type_registry[synth_type] self._combo_audio_in = {} # Maps synth parameter to combo box self._combo_audio_out = {} self._combo_control_in = {} self._combo_control_out = {} self._buffername_map = {} title = "Add %s " % synth_type if is_efx: title += "Effect" elif is_controller: title += "Controller Synth" else: title += "Synth" title += " sid = %s" % sid frame_north = factory.frame(main) frame_north.grid(row=0, column=0, columnspan=2, sticky='ew', padx=4, pady=8) logo_filename = os.path.join("resources", synth_type, "logo_small.png") lab_logo = factory.image_label(frame_north, logo_filename, synth_type) lab_id = factory.dialog_title_label(frame_north, title) lab_logo.grid(row=0, column=0, padx=8) lab_id.grid(row=0, column=1) # Audio Input Buses frame_audio_in = factory.label_frame(main, "Audio Input Buses") row = 0 for i in range(MAX_BUS_COUNT): try: b = specs["audio-input-buses"][i] param = b[0] lab_name = factory.label(frame_audio_in, "%d - %s" % (i+1, param)) combo = factory.audio_bus_combobox(frame_audio_in, self.app) combo.set(b[1]) lab_name.grid(row=row, column=0, sticky="w", padx=4, pady=4) combo.grid(row=row, column=1, sticky="w", padx=4, pady=4) self._combo_audio_in[param] = combo except IndexError: lab_dummy = factory.label(frame_audio_in, "%d - n/a" % (i+1, )) lab_dummy.grid(row=row, column=0) row += 1 factory.padding_label(frame_audio_in).grid(row=row, column=0) frame_audio_in.grid(row=1, column=0, padx=4, pady=4, sticky='ew') # Audio Output Buses frame_audio_out = factory.label_frame(main, "Audio Output Buses") row = 0 for i in range(MAX_BUS_COUNT): try: b = specs["audio-output-buses"][i] param = b[0] lab_name = factory.label(frame_audio_out, "%d - %s" % (i+1, param)) combo = factory.audio_bus_combobox(frame_audio_out, self.app) combo.set(b[1]) lab_name.grid(row=row, column=0, sticky="w", padx=4, pady=4) combo.grid(row=row, column=1, sticky="w", padx=4, pady=4) self._combo_audio_out[param] = combo except IndexError: lab_dummy = factory.label(frame_audio_out, "%d - n/a" % (i+1,)) lab_dummy.grid(row=row, column=0) row += 1 factory.padding_label(frame_audio_out).grid(row=row, column=0) frame_audio_out.grid(row=5, column=0, padx=4, pady=4, sticky='ew') # Control Input Buses frame_control_in = factory.label_frame(main, "Control Input Buses") row = 0 for i in range(MAX_BUS_COUNT): try: b = specs["control-input-buses"][i] param = b[0] lab_name = factory.label(frame_control_in, "%d - %s" % (i+1, param)) combo = factory.control_bus_combobox(frame_control_in, self.app) combo.set(b[1]) lab_name.grid(row=row, column=0, sticky="w", padx=4, pady=4) combo.grid(row=row, column=1, sticky="w", padx=4, pady=4) self._combo_control_in[param] = combo except IndexError: lab_dummy = factory.label(frame_control_in, "%d - n/a" % (i+1, )) lab_dummy.grid(row=row, column=0) row += 1 factory.padding_label(frame_control_in).grid(row=row, column=0) frame_control_in.grid(row=1, column=3, padx=4, pady=4, sticky='ew') # Control Output Buses frame_control_out = factory.label_frame(main, "Control Output Buses") row = 0 for i in range(MAX_BUS_COUNT): try: b = specs["control-output-buses"][i] param = b[0] lab_name = factory.label(frame_control_out, "%d - %s" % (i+1, param)) combo = factory.control_bus_combobox(frame_control_out, self.app) combo.set(b[1]) lab_name.grid(row=row, column=0, sticky="w", padx=4, pady=4) combo.grid(row=row, column=1, sticky="w", padx=4, pady=4) self._combo_control_out[param] = combo except IndexError: lab_dummy = factory.label(frame_control_out, "%d - n/a" % (i+1, )) lab_dummy.grid(row=row, column=0) row += 1 factory.padding_label(frame_control_out).grid(row=row, column=0) frame_control_out.grid(row=5, column=3, padx=4, pady=4, sticky='ew') # Buffers # if specs["buffers"]: # frame_buffers = factory.label_frame(main, "Buffers") # row = 0 # for param in specs["buffers"]: # lab_name = factory.label(frame_buffers, param) # combo = factory.buffer_combobox(frame_buffers, self.app) # lab_name.grid(row=row, column=0, sticky="w", padx=4, pady=4) # combo.grid(row=row, column=1, sticky="w", padx=4, pady=4) # self._buffername_map[param] = combo # row += 1 # factory.padding_label(frame_buffers).grid(row=row, column=0, sticky='ew') # frame_buffers.grid(row=9, column=3, padx=4, pady=4) # Keymode self.var_keymode = StringVar() self.var_voice_count = StringVar() self.var_voice_count.set(8) frame_keymode = factory.label_frame(main, "Key mode") col = 0 for km in specs["keymodes"]: rb = factory.radio(frame_keymode, km, self.var_keymode, km) rb.grid(row=0, column=col, sticky="w", padx=4, pady=4) col += 1 self.var_keymode.set(specs["keymodes"][0]) # Set default keymode lab_vc = factory.label(frame_keymode, "Voice count") spin_vc = factory.int_spinbox(frame_keymode, self.var_voice_count, from_=1, to=128) lab_vc.grid(row=1, column=0, padx=4) spin_vc.grid(row=1, column=1, columnspan=3, padx=4, pady=4) frame_keymode.grid(row=9, column=0, padx=4, pady=4, sticky='ew') factory.padding_label(frame_keymode).grid(row=2, column=0) # South Toolbar toolbar = factory.frame(main) b_help = factory.help_button(toolbar, command=self.display_help) b_accept = factory.accept_button(toolbar, command=self.accept) b_cancel = factory.cancel_button(toolbar, command=self.cancel) b_help.grid(row=0, column=0, sticky="w") factory.padding_label(toolbar).grid(row=0, column=1) b_accept.grid(row=0, column=2, sticky="e") b_cancel.grid(row=0, column=3, sticky="e") toolbar.grid(row=10, column=0, columnspan=5, sticky="ew", padx=4, pady=8)
def __init__(self, editor): frame = editor.create_tab(self.NAME) TkSubEditor.__init__(self, frame, editor, self.NAME) editor.add_child_editor(self.NAME, self) self.pack(expand=True, fill="both") lab_panel = factory.image_label(self, self.IMAGE_FILE) lab_panel.pack(anchor="nw", expand=False) # Tone Spread s_spread = cfactory.linear_slider(frame, "spread", self, range_=(0, 4)) s_spread_lfo = cfactory.linear_slider(frame, "spreadLfo", self, range_=(0,4)) s_spread_env = cfactory.linear_slider(frame, "spreadEnv", self, range_=(0,4)) self.add_control("spread", s_spread) self.add_control("spreadLfo", s_spread_lfo) self.add_control("spreadEnv", s_spread_env) # Tone Cluster s_cluster = cfactory.linear_slider(frame, "cluster", self, range_=(0,16)) s_cluster_lfo = cfactory.linear_slider(frame, "clusterLfo", self, range_=(0,16)) s_cluster_env = cfactory.linear_slider(frame, "clusterEnv", self, range_=(-16,16)) s_cluster_lag = cfactory.normalized_slider(frame, "clusterLag", self) self.add_control("cluster", s_cluster) self.add_control("clusterLfo", s_cluster_lfo) self.add_control("clusterEnv", s_cluster_env) self.add_control("clusterLag", s_cluster_lag) # Tone PW s_pw = cfactory.normalized_slider(frame, "pw", self) s_pwm = cfactory.normalized_slider(frame, "pwLfo", self) self.add_control("pw", s_pw) self.add_control("pwLfo", s_pwm) # Noise s_noise = cfactory.mix_slider(frame, "noiseAmp", self) self.add_control("noiseAmp", s_noise) # LFO s_lfo_freq = ExpSlider(frame, "lfoFreq", self, range_=100, degree=3, clip=(0.001, 100)) s_lfo_ratio = cfactory.discrete_slider(frame, "lfo2FreqRatio", self, values = [0.01, 0.1, 0.25, 0.333, 0.5, 0.667, 0.75, 1.0, 1.125, 1.25, 1.5, 1.175, 2, 3, 4, 5, 8]) s_lfo_xmod = ExpSlider(frame, "lfoXMod", self, range_=100, degree=3) s_lfo_delay = cfactory.linear_slider(frame, "lfoDelay", self, range_=(0, 8)) s_lfo_depth = cfactory.normalized_slider(frame, "lfoDepth", self) s_vibrato = cfactory.normalized_slider(frame, "vibrato", self) self.add_control("lfoFreq", s_lfo_freq) self.add_control("lfo2FreqRatio", s_lfo_ratio) self.add_control("lfoXMod", s_lfo_xmod) self.add_control("lfoDelay", s_lfo_delay) self.add_control("lfoDepth", s_lfo_depth) self.add_control("vibrato", s_vibrato) # Filter s_filter = ExpSlider(frame, "filterFreq", self, range_= 16000) s_filter_lfo = ExpSlider(frame, "filterLfo", self, range_ = 9999) s_filter_env = ExpSlider(frame, "filterEnv", self, range_ = 9999) s_filter_lag = cfactory.normalized_slider(frame, "filterLag", self) s_filter_res = cfactory.normalized_slider(frame, "res", self) s_filter_mix = cfactory.normalized_slider(frame, "filterMix", self) s_filter_env.widget("checkbutton-sign").config(background="#2c272e") s_filter_lfo.widget("checkbutton-sign").config(background="#2c272e") self.add_control("filterFreq", s_filter) self.add_control("filterLfo", s_filter_lfo) self.add_control("filterEnv", s_filter_env) self.add_control("filterLag", s_filter_lag) self.add_control("res", s_filter_res) self.add_control("filterMix", s_filter_mix) # Env self.var_env_mode = tk.BooleanVar() s_attack = ExpSlider(frame, "attack", self, range_=60, degree=3) s_decay = ExpSlider(frame, "decay", self, range_=60, degree=3) s_release = ExpSlider(frame, "release", self, range_=60, degree=3) s_sustain = cfactory.normalized_slider(frame, "sustain", self) cb_trigmode = cfactory.ControlCheckbutton(frame, "envMode", self, "Trig") cb_trigmode.widget().config(background="#3D3937") self.add_control("attack", s_attack) self.add_control("decay", s_decay) self.add_control("release", s_release) self.add_control("sustain", s_sustain) self.add_control("envMode", cb_trigmode) # Amp s_amp = cfactory.volume_slider(frame, "amp", self) self.add_control("amp", s_amp) s_xtone = cfactory.normalized_slider(frame, "xToSpread", editor) s_xnoise = cfactory.normalized_slider(frame, "xToNoise", editor) s_xfilter = cfactory.normalized_slider(frame, "xToFilter", editor) rs_xscale = ReciprocalSlider(frame, "xScale", editor, range_ = 4, degree=1) s_xbias = cfactory.linear_slider(frame, "xBias", editor, range_=(-4, 4)) self.add_control("xToSpread", s_xtone) self.add_control("xToNoise", s_xnoise) self.add_control("xToFilter", s_xfilter) self.add_control("xScale", rs_xscale) self.add_control("xBias", s_xbias) y0, y1 = 50, 300 x0 = 50 x1 = x0 + 60 x2 = x1 + 60 s_spread.widget().place(x=x0, y=y0) s_spread_lfo.widget().place(x=x1, y=y0) s_spread_env.widget().place(x=x2, y=y0) x3 = x2 + 90 x4 = x3 + 60 x5 = x4 + 60 x5b = x5 + 30 s_cluster.widget().place(x=x3, y=y0) s_cluster_lfo.widget().place(x=x4, y=y0) s_cluster_env.widget().place(x=x5, y=y0) s_cluster_lag.widget().place(x=x5b, y=y0, width=14, height=75) x6 = x5+90 x7 = x6+60 s_pw.widget().place(x=x6, y=y0) s_pwm.widget().place(x=x7, y=y0) x8 = x7 + 90 s_noise.widget().place(x=x8, y=y0) x9 = x8 + 90 x10 = x9 + 60 x11 = x10 + 60 x12 = x11 + 60 x13 = x12 + 60 x14 = x13 + 60 s_lfo_freq.layout(offset=(x9, y0), checkbutton_offset=None) s_lfo_ratio.widget().place(x=x10, y=y0) s_lfo_xmod.layout(offset=(x11, y0), checkbutton_offset=None) s_lfo_delay.widget().place(x=x12, y=y0) s_lfo_depth.widget().place(x=x13, y=y0) s_vibrato.widget().place(x=x14, y=y0) # ROW 2 s_filter.layout(offset=(x0, y1), checkbutton_offset = None) s_filter_lfo.layout(offset=(x1, y1), checkbutton_offset = (-6, -24)) s_filter_env.layout(offset=(x2, y1), checkbutton_offset = (-6, -24)) s_filter_lag.widget().place(x=x2+30, y=y1, width=14, height=75) s_filter_res.widget().place(x=x3, y=y1) s_filter_mix.widget().place(x=x4, y=y1) x5 = x4 + 90 x6 = x5+60 x7 = x6+60 x8 = x7+60 x9 = x8+30 s_attack.layout(offset=(x5, y1), checkbutton_offset = None) s_decay.layout(offset=(x6, y1), checkbutton_offset = None) s_sustain.widget().place(x=x7, y=y1) s_release.layout(offset=(x8, y1), checkbutton_offset = None) cb_trigmode.widget().place(x=x9, y=y1) # x10 = x8+120 # s_amp.widget().place(x=x10, y=y1) # x11 = x10 + 190 # x12 = x11 + 60 # x13 = x12 + 60 # s_xtone.widget().place(x=x11, y=y1) # s_xnoise.widget().place(x=x12, y=y1) # s_xfilter.widget().place(x=x13, y=y1) x10 = x8+120 x11 = x10+60 x12 = x11 + 60 x13 = x12 + 60 x14 = x13 + 60 x15 = x14 + 60 s_xtone.widget().place(x=x10, y=y1) s_xnoise.widget().place(x=x11, y=y1) s_xfilter.widget().place(x=x12, y=y1) rs_xscale.layout(offset=(x13,y1), sign_offset = None, invert_offset = (-4, -20)) s_xbias.widget().place(x=x14, y=y1) s_amp.widget().place(x=x15, y=y1)
def __init__(self, editor): frame = editor.create_tab(self.NAME) TkSubEditor.__init__(self, frame, editor, self.NAME) editor.add_child_editor(self.NAME, self) self.pack(expand=True, fill="both") lab_panel = factory.image_label(self, self.IMAGE_FILE) lab_panel.pack(anchor="nw", expand=False) # Tone Spread s_spread = cfactory.linear_slider(frame, "spread", self, range_=(0, 4)) s_spread_lfo = cfactory.linear_slider(frame, "spreadLfo", self, range_=(0, 4)) s_spread_env = cfactory.linear_slider(frame, "spreadEnv", self, range_=(0, 4)) self.add_control("spread", s_spread) self.add_control("spreadLfo", s_spread_lfo) self.add_control("spreadEnv", s_spread_env) # Tone Cluster s_cluster = cfactory.linear_slider(frame, "cluster", self, range_=(0, 16)) s_cluster_lfo = cfactory.linear_slider(frame, "clusterLfo", self, range_=(0, 16)) s_cluster_env = cfactory.linear_slider(frame, "clusterEnv", self, range_=(-16, 16)) s_cluster_lag = cfactory.normalized_slider(frame, "clusterLag", self) self.add_control("cluster", s_cluster) self.add_control("clusterLfo", s_cluster_lfo) self.add_control("clusterEnv", s_cluster_env) self.add_control("clusterLag", s_cluster_lag) # Tone PW s_pw = cfactory.normalized_slider(frame, "pw", self) s_pwm = cfactory.normalized_slider(frame, "pwLfo", self) self.add_control("pw", s_pw) self.add_control("pwLfo", s_pwm) # Noise s_noise = cfactory.mix_slider(frame, "noiseAmp", self) self.add_control("noiseAmp", s_noise) # LFO s_lfo_freq = ExpSlider(frame, "lfoFreq", self, range_=100, degree=3, clip=(0.001, 100)) s_lfo_ratio = cfactory.discrete_slider(frame, "lfo2FreqRatio", self, values=[ 0.01, 0.1, 0.25, 0.333, 0.5, 0.667, 0.75, 1.0, 1.125, 1.25, 1.5, 1.175, 2, 3, 4, 5, 8 ]) s_lfo_xmod = ExpSlider(frame, "lfoXMod", self, range_=100, degree=3) s_lfo_delay = cfactory.linear_slider(frame, "lfoDelay", self, range_=(0, 8)) s_lfo_depth = cfactory.normalized_slider(frame, "lfoDepth", self) s_vibrato = cfactory.normalized_slider(frame, "vibrato", self) self.add_control("lfoFreq", s_lfo_freq) self.add_control("lfo2FreqRatio", s_lfo_ratio) self.add_control("lfoXMod", s_lfo_xmod) self.add_control("lfoDelay", s_lfo_delay) self.add_control("lfoDepth", s_lfo_depth) self.add_control("vibrato", s_vibrato) # Filter s_filter = ExpSlider(frame, "filterFreq", self, range_=16000) s_filter_lfo = ExpSlider(frame, "filterLfo", self, range_=9999) s_filter_env = ExpSlider(frame, "filterEnv", self, range_=9999) s_filter_lag = cfactory.normalized_slider(frame, "filterLag", self) s_filter_res = cfactory.normalized_slider(frame, "res", self) s_filter_mix = cfactory.normalized_slider(frame, "filterMix", self) s_filter_env.widget("checkbutton-sign").config(background="#2c272e") s_filter_lfo.widget("checkbutton-sign").config(background="#2c272e") self.add_control("filterFreq", s_filter) self.add_control("filterLfo", s_filter_lfo) self.add_control("filterEnv", s_filter_env) self.add_control("filterLag", s_filter_lag) self.add_control("res", s_filter_res) self.add_control("filterMix", s_filter_mix) # Env self.var_env_mode = tk.BooleanVar() s_attack = ExpSlider(frame, "attack", self, range_=60, degree=3) s_decay = ExpSlider(frame, "decay", self, range_=60, degree=3) s_release = ExpSlider(frame, "release", self, range_=60, degree=3) s_sustain = cfactory.normalized_slider(frame, "sustain", self) cb_trigmode = cfactory.ControlCheckbutton(frame, "envMode", self, "Trig") cb_trigmode.widget().config(background="#3D3937") self.add_control("attack", s_attack) self.add_control("decay", s_decay) self.add_control("release", s_release) self.add_control("sustain", s_sustain) self.add_control("envMode", cb_trigmode) # Amp s_amp = cfactory.volume_slider(frame, "amp", self) self.add_control("amp", s_amp) s_xtone = cfactory.normalized_slider(frame, "xToSpread", editor) s_xnoise = cfactory.normalized_slider(frame, "xToNoise", editor) s_xfilter = cfactory.normalized_slider(frame, "xToFilter", editor) rs_xscale = ReciprocalSlider(frame, "xScale", editor, range_=4, degree=1) s_xbias = cfactory.linear_slider(frame, "xBias", editor, range_=(-4, 4)) self.add_control("xToSpread", s_xtone) self.add_control("xToNoise", s_xnoise) self.add_control("xToFilter", s_xfilter) self.add_control("xScale", rs_xscale) self.add_control("xBias", s_xbias) y0, y1 = 50, 300 x0 = 50 x1 = x0 + 60 x2 = x1 + 60 s_spread.widget().place(x=x0, y=y0) s_spread_lfo.widget().place(x=x1, y=y0) s_spread_env.widget().place(x=x2, y=y0) x3 = x2 + 90 x4 = x3 + 60 x5 = x4 + 60 x5b = x5 + 30 s_cluster.widget().place(x=x3, y=y0) s_cluster_lfo.widget().place(x=x4, y=y0) s_cluster_env.widget().place(x=x5, y=y0) s_cluster_lag.widget().place(x=x5b, y=y0, width=14, height=75) x6 = x5 + 90 x7 = x6 + 60 s_pw.widget().place(x=x6, y=y0) s_pwm.widget().place(x=x7, y=y0) x8 = x7 + 90 s_noise.widget().place(x=x8, y=y0) x9 = x8 + 90 x10 = x9 + 60 x11 = x10 + 60 x12 = x11 + 60 x13 = x12 + 60 x14 = x13 + 60 s_lfo_freq.layout(offset=(x9, y0), checkbutton_offset=None) s_lfo_ratio.widget().place(x=x10, y=y0) s_lfo_xmod.layout(offset=(x11, y0), checkbutton_offset=None) s_lfo_delay.widget().place(x=x12, y=y0) s_lfo_depth.widget().place(x=x13, y=y0) s_vibrato.widget().place(x=x14, y=y0) # ROW 2 s_filter.layout(offset=(x0, y1), checkbutton_offset=None) s_filter_lfo.layout(offset=(x1, y1), checkbutton_offset=(-6, -24)) s_filter_env.layout(offset=(x2, y1), checkbutton_offset=(-6, -24)) s_filter_lag.widget().place(x=x2 + 30, y=y1, width=14, height=75) s_filter_res.widget().place(x=x3, y=y1) s_filter_mix.widget().place(x=x4, y=y1) x5 = x4 + 90 x6 = x5 + 60 x7 = x6 + 60 x8 = x7 + 60 x9 = x8 + 30 s_attack.layout(offset=(x5, y1), checkbutton_offset=None) s_decay.layout(offset=(x6, y1), checkbutton_offset=None) s_sustain.widget().place(x=x7, y=y1) s_release.layout(offset=(x8, y1), checkbutton_offset=None) cb_trigmode.widget().place(x=x9, y=y1) # x10 = x8+120 # s_amp.widget().place(x=x10, y=y1) # x11 = x10 + 190 # x12 = x11 + 60 # x13 = x12 + 60 # s_xtone.widget().place(x=x11, y=y1) # s_xnoise.widget().place(x=x12, y=y1) # s_xfilter.widget().place(x=x13, y=y1) x10 = x8 + 120 x11 = x10 + 60 x12 = x11 + 60 x13 = x12 + 60 x14 = x13 + 60 x15 = x14 + 60 s_xtone.widget().place(x=x10, y=y1) s_xnoise.widget().place(x=x11, y=y1) s_xfilter.widget().place(x=x12, y=y1) rs_xscale.layout(offset=(x13, y1), sign_offset=None, invert_offset=(-4, -20)) s_xbias.widget().place(x=x14, y=y1) s_amp.widget().place(x=x15, y=y1)