Example #1
0
File: editor.py Project: kaos/Llia
    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)
        y0 = 50
        x0 = 75
        xim = x0 + 120
        xxm = xim + 90
        xxbleed = xxm + 60
        xcbleed = xxbleed + 90
        xamp = xcbleed + 90

        def vslider(param, x):
            s = cf.volume_slider(canvas, param, editor)
            self.add_control(param, s)
            s.widget().place(x=x, y=y0)
            return s

        tfreq = Tumbler(canvas, "imodfreq", editor, digits=5, scale=1)
        self.add_control("imodfreq", tfreq)
        tfreq.layout((x0, y0))
        vslider("imodamp", xim)
        vslider("xmodamp", xxm)
        vslider("xmodbleed", xxbleed)
        vslider("carbleed", xcbleed)
        vslider("amp", xamp)
Example #2
0
File: editor.py Project: kaos/Llia
 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
Example #3
0
 def tumbler(param,digits,scale,x,y):
     t = Tumbler(canvas,param,editor,digits=digits,scale=scale,
                 fill = BG,
                 foreground = CFOREGROUND,
                 outline = COUTLINE)
     self.add_control(param,t)
     t.layout((x,y))
     return y
Example #4
0
File: editor.py Project: kaos/Llia
 def tumbler(self, param, digits, scale, x, y):
     t = Tumbler(self.canvas,
                 param,
                 self.editor,
                 digits=digits,
                 scale=scale)
     self.add_control(param, t)
     t.layout((x, y))
     return t
Example #5
0
File: editor.py Project: kaos/Llia
 def tumbler(param,x):
     t = Tumbler(canvas,param,editor,
                 digits=5,scale=0.001,
                 fill='#140e23',
                 foreground='#8f94a9',
                 outline='#8f94a9')
     self.add_control(param,t)
     t.layout((x,y_tumbler))
     return t
Example #6
0
 def tumbler(self, param, is_ratio, x, y):
     if is_ratio:
         scale = 0.001
     else:
         scale = 0.01
     t = Tumbler(self.canvas, param, self.editor, digits=5, scale=scale)
     self.add_control(param, t)
     t.layout((x, y))
     return t
Example #7
0
 def tumbler(self,param,is_ratio,x,y):
     if is_ratio:
         scale = 0.001
     else:
         scale = 0.01
     t = Tumbler(self.canvas,param,self.editor,
                 digits=5,scale=scale)
     self.add_control(param,t)
     t.layout((x,y))
     return t
Example #8
0
File: editor.py Project: kaos/Llia
 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
Example #9
0
File: editor.py Project: kaos/Llia
 def tumbler(param, x):
     t = Tumbler(canvas,
                 param,
                 editor,
                 digits=5,
                 scale=0.001,
                 fill='#140e23',
                 foreground='#8f94a9',
                 outline='#8f94a9')
     self.add_control(param, t)
     t.layout((x, y_tumbler))
     return t
Example #10
0
    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)

        y,ypan = 50,250
        x0 = 100
        x1 = x0+90
        x2 = x1+60
        x3 = x2+60
        x4 = x3+60
        x5 = x4+90
        x6 = x5+60
        x7 = x6+60
        
        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,width=14, height=150)

        def bipolar_slider(param,x,y):
            s = cf.bipolar_slider(canvas,param,editor)
            self.add_control(param,s)
            s.widget().place(x=x,y=y,width=14, height=75)

        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,width=14,height=150)
            
        tratio = Tumbler(canvas,"pitchRatio",editor,
                         sign=False,digits=4,scale=0.001,
                         range_=(0,4000))
        self.add_control("pitchRatio", tratio)
        tratio.layout((x0,y))
        norm_slider("pitchDispersion",x1,y)
        norm_slider("timeDispersion",x2,y)
        norm_slider("delay",x3,y)
        norm_slider("feedback",x4,y)
        amp_slider("dryAmp",x5,y)
        amp_slider("psAmp",x6,y)
        amp_slider("delayAmp",x7,y)
        bipolar_slider("dryPan",x5,ypan)
        bipolar_slider("psPan",x6,ypan)
        bipolar_slider("delayPan",x7,ypan)
        
            
Example #11
0
File: editor.py Project: kaos/Llia
    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)

        y,ypan = 50,250
        x0 = 100
        x1 = x0+90
        x2 = x1+60
        x3 = x2+60
        x4 = x3+60
        x5 = x4+90
        x6 = x5+60
        x7 = x6+60
        
        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,width=14, height=150)

        def bipolar_slider(param,x,y):
            s = cf.bipolar_slider(canvas,param,editor)
            self.add_control(param,s)
            s.widget().place(x=x,y=y,width=14, height=75)

        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,width=14,height=150)
            
        tratio = Tumbler(canvas,"pitchRatio",editor,
                         sign=False,digits=4,scale=0.001,
                         range_=(0,4000))
        self.add_control("pitchRatio", tratio)
        tratio.layout((x0,y))
        norm_slider("pitchDispersion",x1,y)
        norm_slider("timeDispersion",x2,y)
        norm_slider("delay",x3,y)
        norm_slider("feedback",x4,y)
        amp_slider("dryAmp",x5,y)
        amp_slider("psAmp",x6,y)
        amp_slider("delayAmp",x7,y)
        bipolar_slider("dryPan",x5,ypan)
        bipolar_slider("psPan",x6,ypan)
        bipolar_slider("delayPan",x7,ypan)
Example #12
0
    def tumbler(self,param,digits,scale,x,y):
        '''
        Adds digital tumbler to canvas.
        
        ARGS:
          param  - String, synth parameter
          digits - int, number of digits
          scale  - float, numeric scale factor.
          x      - int, x coordinate
          y      - int, y coordinate

        RETURNS: Tumbler
        '''
        t = Tumbler(self.canvas,param,self.parent,
                    digits = digits,
                    scale = scale)
        self.add_control(param,t)
        t.layout((x,y))
        return t
Example #13
0
    def tumbler(self, param, digits, scale, x, y):
        '''
        Adds digital tumbler to canvas.
        
        ARGS:
          param  - String, synth parameter
          digits - int, number of digits
          scale  - float, numeric scale factor.
          x      - int, x coordinate
          y      - int, y coordinate

        RETURNS: Tumbler
        '''
        t = Tumbler(self.canvas,
                    param,
                    self.parent,
                    digits=digits,
                    scale=scale)
        self.add_control(param, t)
        t.layout((x, y))
        return t
Example #14
0
 def __init__(self, editor):
     frame = editor.create_tab(self.NAME, self.TAB_FILE)
     frame.config(background=factory.bg())
     canvas = factory.canvas(frame, 1200, 600, 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 = 60
     y1 = 300
     yfreq_offset = 0
     ybias_offset = 100
     x0, xosc_offset = 50, 225
     x_wave_offset = 105
     x_amp_offset = x_wave_offset + 60
     x_env1_wave_offset = x_wave_offset - 60
     x_lfo_wave_offset = x_wave_offset
     x_env1_amp_offset = x_amp_offset
     for i, osc in enumerate(("osc1", "osc2", "osc3")):
         x = x0 + (i * xosc_offset)
         tumbler = Tumbler(canvas,
                           osc + "Freq",
                           editor,
                           digits=5,
                           scale=0.001)
         self.add_control(osc + "Freq", tumbler)
         tumbler.layout((x, y0 + yfreq_offset))
         self.norm_slider(osc + "Wave", x + x_wave_offset, y0)
         self.volume_slider(osc + "Amp", x + x_amp_offset, y0)
         self.exp_slider(osc + "Wave_env1", x + x_env1_wave_offset, y1)
         self.exp_slider(osc + "Wave_lfo", x + x_lfo_wave_offset, y1)
         self.exp_slider(osc + "Amp_env1", x + x_env1_amp_offset, y1)
         xosc3 = x
     tumbler = Tumbler(canvas, "osc3Bias", editor, digits=5, scale=0.01)
     self.add_control("osc3Bias", tumbler)
     tumbler.layout((xosc3, y0 + ybias_offset))
     self.norm_slider("osc3WaveLag",
                      xosc3 + x_wave_offset + 25,
                      y0,
                      width=10,
                      height=75)
     xnoise = xosc3 + xosc_offset + 30
     self.linear_slider("noiseFreq", xnoise, y0)
     self.volume_slider("noiseAmp", xnoise + 60, y0)
     self.norm_slider("noiseBW", xnoise, y1)
     self.exp_slider("noiseAmp_env1", xnoise + 60, y1)
     xpitch = xnoise + 150
     self.linear_slider("port", xpitch, y0, range_=(0, 2))
     self.norm_slider("xToPitch", xpitch, y1)
Example #15
0
File: editor.py Project: kaos/Llia
 def __init__(self, editor):
     frame = editor.create_tab(self.NAME, self.TAB_FILE)
     frame.config(background=factory.bg())
     canvas = factory.canvas(frame, 1200, 600, 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 = 60
     y1 = 300
     yfreq_offset = 0
     ybias_offset = 100
     x0, xosc_offset = 50, 225
     x_wave_offset = 105
     x_amp_offset = x_wave_offset+60
     x_env1_wave_offset = x_wave_offset-60
     x_lfo_wave_offset = x_wave_offset
     x_env1_amp_offset = x_amp_offset
     for i, osc in enumerate(("osc1", "osc2", "osc3")):
         x = x0 + (i * xosc_offset)
         tumbler = Tumbler(canvas,osc+"Freq",editor,digits=5, scale=0.001)
         self.add_control(osc+"Freq", tumbler)
         tumbler.layout((x, y0+yfreq_offset))
         self.norm_slider(osc+"Wave", x+x_wave_offset, y0)
         self.volume_slider(osc+"Amp", x+x_amp_offset, y0)
         self.exp_slider(osc+"Wave_env1", x+x_env1_wave_offset, y1)
         self.exp_slider(osc+"Wave_lfo", x+x_lfo_wave_offset, y1)
         self.exp_slider(osc+"Amp_env1", x+x_env1_amp_offset, y1)
         xosc3 = x
     tumbler = Tumbler(canvas,"osc3Bias",editor,digits=5,scale=0.01)
     self.add_control("osc3Bias", tumbler)
     tumbler.layout((xosc3,y0+ybias_offset))
     self.norm_slider("osc3WaveLag", xosc3+x_wave_offset+25, y0, width=10, height=75)
     xnoise = xosc3 + xosc_offset + 30
     self.linear_slider("noiseFreq", xnoise, y0)
     self.volume_slider("noiseAmp", xnoise+60, y0)
     self.norm_slider("noiseBW", xnoise, y1)
     self.exp_slider("noiseAmp_env1", xnoise+60, y1)
     xpitch = xnoise+150
     self.linear_slider("port", xpitch, y0, range_=(0,2))
     self.norm_slider("xToPitch", xpitch, y1)
Example #16
0
 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
Example #17
0
 def tumbler(param, digits, scale, x, y):
     t = Tumbler(canvas, param, editor, digits=digits, scale=scale)
     self.add_control(param, t)
     t.layout((x, y))
     t.update_aspect()
     return t
Example #18
0
File: editor.py Project: kaos/Llia
 def __init__(self, editor):
     frame = editor.create_tab(self.NAME, self.TAB_FILE)
     frame.config(background=factory.bg())
     canvas = factory.canvas(frame, 1000, 600, self.IMAGE_FILE)
     canvas.pack()
     TkSubEditor.__init__(self, canvas, editor, self.NAME)
     editor.add_child_editor(self.NAME, self)
     tumbler = Tumbler(canvas, "clkFreq", editor, digits=5, scale=0.001)
     s_clk_pw = cf.normalized_slider(canvas, "clkPw", editor)
     s_saw_ratio = cf.discrete_slider(canvas,
                                      "sawRatio",
                                      editor,
                                      values=RATIOS)
     s_saw_slew = cf.normalized_slider(canvas, "sawSlew", editor)
     s_saw_amp = cf.linear_slider(canvas, "sawAmp", editor, range_=(0, 4))
     s_saw_bleed = cf.normalized_slider(canvas, "sawBleed", editor)
     s_saw_bias = cf.linear_slider(canvas,
                                   "sawBias",
                                   editor,
                                   range_=(-4, 4))
     s_pulse_ratio = cf.discrete_slider(canvas,
                                        "pulseRatio",
                                        editor,
                                        values=RATIOS)
     s_pulse_width = cf.normalized_slider(canvas, "pulseWidth", editor)
     s_pulse_amp = cf.linear_slider(canvas,
                                    "pulseAmp",
                                    editor,
                                    range_=(0, 4))
     s_pulse_bleed = cf.normalized_slider(canvas, "pulseBleed", editor)
     s_pulse_bias = cf.linear_slider(canvas,
                                     "pulseBias",
                                     editor,
                                     range_=(-4, 4))
     s_lag = cf.normalized_slider(canvas, "lag", editor)
     self.add_control("clkFreq", tumbler)
     self.add_control("clkPw", s_clk_pw)
     self.add_control("sawRatio", s_saw_ratio)
     self.add_control("sawSlew", s_saw_slew)
     self.add_control("sawAmp", s_saw_amp)
     self.add_control("sawBleed", s_saw_amp)
     self.add_control("sawBias", s_saw_bias)
     self.add_control("pulseRatio", s_pulse_ratio)
     self.add_control("pulseWidth", s_pulse_width)
     self.add_control("pulseAmp", s_pulse_amp)
     self.add_control("pulseBleed", s_pulse_amp)
     self.add_control("pulseBias", s_pulse_bias)
     self.add_control("lag", s_lag)
     y0 = 90
     x0 = 90
     x1 = x0 + 120
     xsaw = x1 + 90
     x2 = xsaw
     x3 = x2 + 60
     x4 = x3 + 60
     x5 = x4 + 60
     x6 = x5 + 60
     xpulse = x6 + 75
     x7 = xpulse
     x8 = x7 + 60
     x9 = x8 + 60
     x10 = x9 + 60
     x11 = x10 + 60
     xlag = x11 + 75
     tumbler.layout((x0 + 5, y0 + 30))
     s_clk_pw.widget().place(x=x1, y=y0, height=200)
     s_saw_ratio.widget().place(x=x2, y=y0, height=200)
     s_saw_slew.widget().place(x=x3, y=y0, height=200)
     s_saw_amp.widget().place(x=x4, y=y0, height=200)
     s_saw_bleed.widget().place(x=x5, y=y0, height=200)
     s_saw_bias.widget().place(x=x6, y=y0, height=200)
     s_pulse_ratio.widget().place(x=x7, y=y0, height=200)
     s_pulse_width.widget().place(x=x8, y=y0, height=200)
     s_pulse_amp.widget().place(x=x9, y=y0, height=200)
     s_pulse_bleed.widget().place(x=x10, y=y0, height=200)
     s_pulse_bias.widget().place(x=x11, y=y0, height=200)
     s_lag.widget().place(x=xlag, y=y0, height=200)
Example #19
0
File: editor.py Project: kaos/Llia
 def tumbler(self, param, x, y):
     t = Tumbler(self.canvas,param,self.editor,digits=5, scale=0.001)
     self.add_control(param,t)
     t.layout((x,y))
     return t
Example #20
0
File: editor.py Project: kaos/Llia
    def __init__(self, editor):
        frame = editor.create_tab(self.NAME,self.TAB_FILE)
        frame.config(background=factory.bg())
        canvas = factory.canvas(frame, 741,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 = 50
        x0 = 75
        xfilter = x0+130
        xmod = xfilter+90
        xattack = xmod + 90
        xrelease = xattack + 60
        xdry = xrelease+90
        xwet = xdry+60
               
        
        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 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 linear_slider(param,range_,x):
            s = cf.linear_slider(canvas,param,editor,range_=range_)
            self.add_control(param,s)
            s.widget().place(x=x,y=y0)
            return s

        t_freq = Tumbler(canvas,"fixedFrequency",editor,
                         digits = 4, scale=0.01)
        t_track = Tumbler(canvas,"keyTrack",editor,
                          digits=2, scale=1, range_=(0,16))
        self.add_control("fixedFrequency",t_freq)
        self.add_control("keyTrack",t_track)
        t_freq.layout((x0+25,y0+25))
        t_track.layout((x0+40,y0+100))

        cfill = 'black'
        cforeground = 'white'
        coutline = 'white'
        
        msb_filter = MSB(canvas,"inputFilter",editor,len(FILTER_VALUES))
        for i,v in enumerate(FILTER_VALUES):
            k = v/1000
            tx = "%dk" % k
            d = {"fill" : cfill,
                 "foreground" : cforeground,
                 "outline" : coutline,
                 "value" : v,
                 "text" : tx}
            msb_filter.define_aspect(i,v,d)
        self.add_control("inputFilter",msb_filter)
        msb_filter.layout((xfilter,y0+25))
        msb_filter.update_aspect()

        msb_gain = MSB(canvas,"inputGain",editor,MAX_INPUT_GAIN_MAGNITUDE)
        for i in range(MAX_INPUT_GAIN_MAGNITUDE):
            j = i+1
            v = 10**i
            tx = "x%d" % j
            d = {"fill" : cfill,
                 "foreground" : cforeground,
                 "outline" : coutline,
                 "value" : v,
                 "text" : tx}
            msb_gain.define_aspect(i,v,d)
        self.add_control("inputGain",msb_gain)
        msb_gain.layout((xfilter,y0+100))
        msb_gain.update_aspect()
        norm_slider("modDepth",xmod)
        linear_slider("attack",(0,4),xattack)
        linear_slider("release",(0,4),xrelease)

        msb_env = ToggleButton(canvas,"envelopeSelect",editor,
                               text=("Follow","ASR"),
                               values = (0,1),
                               fill=cfill,
                               selected_fill = cfill,
                               foreground=cforeground,
                               selected_foreground=cforeground,
                               outline=coutline)
                               
        self.add_control("envelopeSelect",msb_env)
        msb_env.layout((xattack+8,y0+200))
        msb_env.update_aspect()
        volume_slider("dryAmp",xdry)
        volume_slider("wetAmp",xwet)
Example #21
0
File: editor.py Project: kaos/Llia
 def __init__(self, editor):
     frame = editor.create_tab(self.NAME, self.TAB_FILE)
     frame.config(background=factory.bg())
     canvas = factory.canvas(frame,1000,600,self.IMAGE_FILE)
     canvas.pack()
     TkSubEditor.__init__(self, canvas, editor, self.NAME)
     editor.add_child_editor(self.NAME, self)
     tumbler = Tumbler(canvas,"clkFreq",editor,digits=5, scale=0.001)
     s_clk_pw = cf.normalized_slider(canvas, "clkPw", editor)
     s_saw_ratio = cf.discrete_slider(canvas, "sawRatio", editor,
                                      values = RATIOS)
     s_saw_slew = cf.normalized_slider(canvas, "sawSlew", editor)
     s_saw_amp = cf.linear_slider(canvas, "sawAmp", editor, range_=(0,4))
     s_saw_bleed = cf.normalized_slider(canvas, "sawBleed", editor)
     s_saw_bias = cf.linear_slider(canvas, "sawBias", editor, range_=(-4,4))
     s_pulse_ratio = cf.discrete_slider(canvas, "pulseRatio", editor,
                                        values = RATIOS)
     s_pulse_width = cf.normalized_slider(canvas, "pulseWidth", editor)
     s_pulse_amp = cf.linear_slider(canvas, "pulseAmp", editor, range_=(0,4))
     s_pulse_bleed = cf.normalized_slider(canvas, "pulseBleed", editor)
     s_pulse_bias = cf.linear_slider(canvas, "pulseBias", editor, range_=(-4,4))
     s_lag = cf.normalized_slider(canvas, "lag", editor)
     self.add_control("clkFreq", tumbler)
     self.add_control("clkPw", s_clk_pw)
     self.add_control("sawRatio", s_saw_ratio)
     self.add_control("sawSlew", s_saw_slew)
     self.add_control("sawAmp", s_saw_amp)
     self.add_control("sawBleed", s_saw_amp)
     self.add_control("sawBias", s_saw_bias)
     self.add_control("pulseRatio", s_pulse_ratio)
     self.add_control("pulseWidth", s_pulse_width)
     self.add_control("pulseAmp", s_pulse_amp)
     self.add_control("pulseBleed", s_pulse_amp)
     self.add_control("pulseBias", s_pulse_bias)
     self.add_control("lag", s_lag)
     y0 = 90
     x0 = 90
     x1 = x0 + 120
     xsaw = x1 + 90
     x2 = xsaw
     x3 = x2 + 60
     x4 = x3 + 60
     x5 = x4 + 60
     x6 = x5 + 60
     xpulse = x6 + 75
     x7 = xpulse
     x8 = x7 + 60
     x9 = x8 + 60
     x10 = x9 + 60
     x11 = x10 + 60
     xlag = x11 + 75
     tumbler.layout((x0+5,y0+30))
     s_clk_pw.widget().place(x=x1, y=y0, height=200)
     s_saw_ratio.widget().place(x=x2, y=y0, height=200)
     s_saw_slew.widget().place(x=x3, y=y0, height=200)
     s_saw_amp.widget().place(x=x4, y=y0, height=200)
     s_saw_bleed.widget().place(x=x5, y=y0, height=200)
     s_saw_bias.widget().place(x=x6, y=y0, height=200)
     s_pulse_ratio.widget().place(x=x7, y=y0, height=200)
     s_pulse_width.widget().place(x=x8, y=y0, height=200)
     s_pulse_amp.widget().place(x=x9, y=y0, height=200)
     s_pulse_bleed.widget().place(x=x10, y=y0, height=200)
     s_pulse_bias.widget().place(x=x11, y=y0, height=200)
     s_lag.widget().place(x=xlag, y=y0, height=200)
Example #22
0
 def tumbler(param,x,y):
     t = Tumbler(canvas,param,editor,digits=3,scale = 0.01,sign=True)
     self.add_control(param,t)
     t.layout((x,y))
     t.update_aspect()
     return t
Example #23
0
File: editor.py Project: kaos/Llia
    def __init__(self, editor):
        frame = editor.create_tab(self.NAME, self.TAB_FILE)
        frame.config(background=factory.bg())
        canvas = factory.canvas(frame,1018,663,self.IMAGE_FILE)
        canvas.pack()
        TkSubEditor.__init__(self, canvas, editor, self.NAME)
        editor.add_child_editor(self.NAME, self)

        def ratio_msb(param,x,y):
            count = len(HARMONICS)
            msb = MSB(canvas,param,editor,count)
            for i,p in enumerate(HARMONICS):
                v,text = p
                d = _msb_aspect(v,text)
                msb.define_aspect(i,v,d)
            self.add_control(param,msb)
            msb.layout((x,y))
            msb.update_aspect()
            return msb
        tumbler = Tumbler(canvas,"lfoFreq",editor, digits=5, scale=0.001)
        s_scale = cf.linear_slider(canvas, "lfoScale", editor, range_=(0,4))
        s_bias = cf.linear_slider(canvas, "lfoBias", editor, range_=(-4,4))
        s_fm = cf.linear_slider(canvas, "lfoFM", editor, range_=(0, 8))
        s_am = cf.normalized_slider(canvas, "lfoAM", editor)
        s_delay = ExpSlider(canvas, "lfoDelay", editor, range_=8)
        s_attack = ExpSlider(canvas, "lfoAttack", editor, range_=8)
        s_hold = ExpSlider(canvas, "lfoHold", editor, range_=8)
        s_release = ExpSlider(canvas, "lfoRelease", editor, range_=8)
        s_env_fm = cf.linear_slider(canvas, "lfoEnvToFreq", editor, range_=(0,8))
        s_env_bleed = cf.normalized_slider(canvas, "lfoBleed", editor)
        s_amp_a = cf.normalized_slider(canvas, "lfoAmpA", editor)
        s_amp_b = cf.normalized_slider(canvas, "lfoAmpB", editor)
        s_amp_c = cf.normalized_slider(canvas, "lfoAmpC", editor)
        self.add_control("lfoFreq", tumbler)
        self.add_control("lfoScale", s_scale)
        self.add_control("lfoBias", s_bias)
        self.add_control("lfoFM", s_fm)
        self.add_control("lfoAM", s_am)
        self.add_control("lfoDelay", s_delay)
        self.add_control("lfoAttack", s_attack)
        self.add_control("lfoHold", s_hold)
        self.add_control("lfoRelease", s_release)
        self.add_control("lfoEnvToFreq", s_env_fm)
        self.add_control("lfoBleed", s_env_bleed)
        self.add_control("lfoAmpA", s_amp_a)
        self.add_control("lfoAmpB", s_amp_b)
        self.add_control("lfoAmpC", s_amp_c)
        y0, y1 = 90, 350
        x0 = 90
        x1 = x0 + 140
        x2 = x1 + 60
        x_mod = x2 +60
        x_fm = x_mod + 75
        x_am = x_fm + 60
        x_delay = x_am + 90
        x_attack = x_delay + 60
        x_hold = x_attack + 60
        x_release = x_hold + 60
        x_env_fm = x_release + 60
        x_bleed = x_env_fm + 60
        x_a = x0
        x_b = x_a + 150
        x_c = x_b + 150
        ratio_msb("lfoModFreq", x_mod,y0)
        ratio_msb("lfoRatioA", x_a, y1)
        ratio_msb("lfoRatioB", x_b, y1)
        ratio_msb("lfoRatioC", x_c, y1)
        tumbler.layout((x0+13,y0+30))
        s_scale.widget().place(x=x1, y=y0)
        s_bias.widget().place(x=x2, y=y0)
        s_fm.widget().place(x=x_fm, y=y0)
        s_am.widget().place(x=x_am, y=y0)
        s_delay.layout(offset=(x_delay, y0),checkbutton_offset=None)
        s_attack.layout(offset=(x_attack, y0),checkbutton_offset=None)
        s_hold.layout(offset=(x_hold, y0),checkbutton_offset=None)
        s_release.layout(offset=(x_release, y0),checkbutton_offset=None)
        s_env_fm.widget().place(x=x_env_fm, y=y0)
        s_env_bleed.widget().place(x=x_bleed, y=y0)
        s_amp_a.widget().place(x=x_a+75, y=y1)
        s_amp_b.widget().place(x=x_b+75, y=y1)
        s_amp_c.widget().place(x=x_c+75, y=y1)
Example #24
0
 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 = 50
     x0 = 75
     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 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 linear_slider(param,range_,x):
         s = cf.linear_slider(canvas,param,editor,range_=range_)
         self.add_control(param,s)
         s.widget().place(x=x,y=y0)
         return s
     def exp_slider(param,range_,degree=2):
         s = ExpSlider(canvas,param,editor,range_,degree)
         self.add_control(param,s)
         return s
     def env_slider(param,x):
         s = exp_slider(param,6)
         s.layout(offset=(x,y0),checkbutton_offset=None)
         return s
     def msb_aspect(msb,index,text,value):
         d = {"fill" : CFILL,
              "foreground" : CFOREGROUND,
              "outline" : COUTLINE,
              "text" : str(text),
              "value" : value}
         msb.define_aspect(index,value,d)
         return d
     x_osc = x0
     x_delta = 75
     x_port = x_osc
     x_saw = x_port + 75
     x_pulse = x_saw + x_delta
     x_sub = x_pulse + x_delta
     x_noise = x_sub + x_delta
     y_msb = y0+200
     x_msb_offset = -24
     norm_slider("port",x_port)
     norm_slider("sawMix",x_saw)
     norm_slider("pulseMix",x_pulse)
     norm_slider("subMix",x_sub)
     norm_slider("noiseMix",x_noise)
     param = "chorus"
     msb = MSB(canvas,param,editor,2)
     msb_aspect(msb,0,"Off",0)
     msb_aspect(msb,1,"On",1)
     self.add_control(param,msb)
     msb.layout((x_saw+x_msb_offset,y_msb))
     msb.update_aspect()
     param = "subOctave"
     msb = MSB(canvas,param,editor,2)
     msb_aspect(msb,0,"-1",0)
     msb_aspect(msb,1,"-2",1)
     self.add_control(param,msb)
     msb.layout((x_sub+x_msb_offset,y_msb))
     msb.update_aspect()
     param = "noiseSelect"
     msb = MSB(canvas,param,editor,2)
     msb_aspect(msb,0,"White",0)
     msb_aspect(msb,1,"Pink",1)
     self.add_control(param,msb)
     msb.layout((x_noise+x_msb_offset,y_msb))
     msb.update_aspect()
     x_wave = x_noise+x_delta
     x_lfo = x_wave + 60
     x_env = x_lfo + 60
     norm_slider("wave",x_wave)
     norm_slider("waveLFO",x_lfo)
     norm_slider("waveEnv",x_env)
     x_filter = x_env+90
     x_lfo = x_filter + 90
     x_env = x_lfo + 60
     x_x = x_env + 60
     x_res = x_x + 60
     y_hp = y0 + 20
     y_ff = y_hp + 90
     y_track = y_msb
     param = "highPass"
     msb = MSB(canvas,param,editor,len(HIGHPASS_CUTOFF))
     for i,v in enumerate(HIGHPASS_CUTOFF):
         msb_aspect(msb,i,str(v),v)
     self.add_control(param,msb)
     msb.layout((x_filter, y_hp))
     msb.update_aspect()
     param = "filterFreq"
     msb = MSB(canvas,param,editor,len(LOWPASS_CUTOFF))
     for i,v in enumerate(LOWPASS_CUTOFF):
         msb_aspect(msb,i,str(v),v)
     self.add_control(param,msb)
     msb.layout((x_filter,y_ff))
     msb.update_aspect()
     param = "filterTrack"
     msb = MSB(canvas,param,editor,len(LOWPASS_TRACK))
     for i,v in enumerate(LOWPASS_TRACK):
         msb_aspect(msb,i,str(v),v)
     msb.layout((x_filter, y_track))
     msb.update_aspect()
     s = exp_slider("filterLFO",MID_CUTOFF)
     s.layout(offset=(x_lfo,y0),checkbutton_offset=None)
     s = exp_slider("filterEnv",10000)
     s.layout(offset=(x_env,y0))
     s = exp_slider("xFilter",10000)
     s.layout(offset=(x_x,y0))
     norm_slider("filterRes",x_res)
     y0 = 350
     x_lfo = x0
     x_lfo_delay = x_lfo+90
     x_lfo_amp = x_lfo_delay+60
     x_vsens = x_lfo_amp+90
     x_vdepth = x_vsens+60
     x_xpitch = x_vdepth+60
     param = "lfoFreq"
     t = Tumbler(canvas,param,editor,digits=5,scale=0.001)
     self.add_control(param,t)
     t.layout((x_lfo, y0))
     param = "lfoWave"
     msb = MSB(canvas,param,editor,3)
     self.add_control(param,msb)
     msb_aspect(msb,0,"Sine",0)
     msb_aspect(msb,1,"Square",1)
     msb_aspect(msb,2,"Random",2)
     msb.layout((x_lfo,y0+90))
     msb.update_aspect()
     linear_slider("lfoDelay",(0,3),x_lfo_delay)
     norm_slider("lfoAmp",x_lfo_amp)
     norm_slider("vsens",x_vsens)
     norm_slider("vdepth",x_vdepth)
     norm_slider("xPitch",x_xpitch)
     x_env = x_xpitch+90
     env_slider("attack",x_env)
     env_slider("decay",x_env+60)
     norm_slider("sustain",x_env+120)
     env_slider("release",x_env+180)
     x_amp = x_env+180+90
     param = "gateMode"
     msb = MSB(canvas,param,editor,2)
     self.add_control(param,msb)
     msb_aspect(msb,0,"ADSR",0)
     msb_aspect(msb,1,"Gate",1)
     msb.layout((x_amp, y0+90))
     msb.update_aspect()
     volume_slider("amp",x_amp+90)
Example #25
0
File: editor.py Project: kaos/Llia
    def __init__(self, editor):
        frame = editor.create_tab(self.NAME, self.TAB_FILE)
        frame.config(background=factory.bg())
        canvas = factory.canvas(frame, 491, 708,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)
        cfill = 'black'
        cforeground = '#d6dce6'
        cselected = cforeground
        def toggle(param,x,y):
            b = ToggleButton(canvas,param,editor,
                             fill=cfill,
                             foreground=cforeground,
                             outline=cforeground,
                             selected_fill = cfill,
                             selected_foreground = cselected)
            self.add_control(param,b)
            b.layout((x,y))
            b.update_aspect()
            return b

        def norm(param,x,y):
            s = cf.normalized_slider(canvas,param,editor)
            self.add_control(param,s)
            s.widget().place(x=x,y=y)
            return s

        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)
            return s

        def scale_slider(param,x,y):
            return linear_slider(param,(0,4),x,y)

        def bias_slider(param,x,y):
            return linear_slider(param,(-4,4),x,y)

        def bipolar_slider(param,x,y):
            return linear_slider(param,(-1,1),x,y)

        y0 = 75
        yhp = y0+100
        x0 = 75
        xfb = x0+100
        xlag = xfb+60
        xscale = xlag+60
        xbias = xscale+60
        toggle("enableMod",x0,y0)
        toggle("enableHpA",x0,yhp)
        norm("lagA",xlag,y0)
        scale_slider("scaleA",xscale,y0)
        bias_slider("biasA",xbias,y0)
        y1 = y0+250
        yhp = y1+100
        t = Tumbler(canvas,"delay",editor,digits=4,scale=0.001,
                    fill=cfill,foreground=cforeground,outline=cforeground,
                    range_=(0,4000))
        self.add_control("delay",t)
        t.layout((x0,y1))
        toggle("enableHpDelay",x0,yhp)
        bipolar_slider("feedback",xfb,y1)
        norm("lagDelay",xlag,y1)
        scale_slider("scaleDelay",xscale,y1)
        bias_slider("biasDelay",xbias,y1)
Example #26
0
File: editor.py Project: kaos/Llia
 def tumbler(param,digits,scale,x,y):
     t = Tumbler(canvas,param,editor,digits=digits,scale=scale)
     self.add_control(param,t)
     t.layout((x,y))
     t.update_aspect()
     return t
Example #27
0
File: editor.py Project: kaos/Llia
 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 = 50
     x0 = 75
     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 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 linear_slider(param,range_,x):
         s = cf.linear_slider(canvas,param,editor,range_=range_)
         self.add_control(param,s)
         s.widget().place(x=x,y=y0)
         return s
     def exp_slider(param,range_,degree=2):
         s = ExpSlider(canvas,param,editor,range_,degree)
         self.add_control(param,s)
         return s
     def env_slider(param,x):
         s = exp_slider(param,6)
         s.layout(offset=(x,y0),checkbutton_offset=None)
         return s
     def msb_aspect(msb,index,text,value):
         d = {"fill" : CFILL,
              "foreground" : CFOREGROUND,
              "outline" : COUTLINE,
              "text" : str(text),
              "value" : value}
         msb.define_aspect(index,value,d)
         return d
     x_osc = x0
     x_delta = 75
     x_port = x_osc
     x_saw = x_port + 75
     x_pulse = x_saw + x_delta
     x_sub = x_pulse + x_delta
     x_noise = x_sub + x_delta
     y_msb = y0+200
     x_msb_offset = -24
     norm_slider("port",x_port)
     norm_slider("sawMix",x_saw)
     norm_slider("pulseMix",x_pulse)
     norm_slider("subMix",x_sub)
     norm_slider("noiseMix",x_noise)
     param = "chorus"
     msb = MSB(canvas,param,editor,2)
     msb_aspect(msb,0,"Off",0)
     msb_aspect(msb,1,"On",1)
     self.add_control(param,msb)
     msb.layout((x_saw+x_msb_offset,y_msb))
     msb.update_aspect()
     param = "subOctave"
     msb = MSB(canvas,param,editor,2)
     msb_aspect(msb,0,"-1",0)
     msb_aspect(msb,1,"-2",1)
     self.add_control(param,msb)
     msb.layout((x_sub+x_msb_offset,y_msb))
     msb.update_aspect()
     param = "noiseSelect"
     msb = MSB(canvas,param,editor,2)
     msb_aspect(msb,0,"White",0)
     msb_aspect(msb,1,"Pink",1)
     self.add_control(param,msb)
     msb.layout((x_noise+x_msb_offset,y_msb))
     msb.update_aspect()
     x_wave = x_noise+x_delta
     x_lfo = x_wave + 60
     x_env = x_lfo + 60
     norm_slider("wave",x_wave)
     norm_slider("waveLFO",x_lfo)
     norm_slider("waveEnv",x_env)
     x_filter = x_env+90
     x_lfo = x_filter + 90
     x_env = x_lfo + 60
     x_x = x_env + 60
     x_res = x_x + 60
     y_hp = y0 + 20
     y_ff = y_hp + 90
     y_track = y_msb
     param = "highPass"
     msb = MSB(canvas,param,editor,len(HIGHPASS_CUTOFF))
     for i,v in enumerate(HIGHPASS_CUTOFF):
         msb_aspect(msb,i,str(v),v)
     self.add_control(param,msb)
     msb.layout((x_filter, y_hp))
     msb.update_aspect()
     param = "filterFreq"
     msb = MSB(canvas,param,editor,len(LOWPASS_CUTOFF))
     for i,v in enumerate(LOWPASS_CUTOFF):
         msb_aspect(msb,i,str(v),v)
     self.add_control(param,msb)
     msb.layout((x_filter,y_ff))
     msb.update_aspect()
     param = "filterTrack"
     msb = MSB(canvas,param,editor,len(LOWPASS_TRACK))
     for i,v in enumerate(LOWPASS_TRACK):
         msb_aspect(msb,i,str(v),v)
     msb.layout((x_filter, y_track))
     msb.update_aspect()
     s = exp_slider("filterLFO",MID_CUTOFF)
     s.layout(offset=(x_lfo,y0),checkbutton_offset=None)
     s = exp_slider("filterEnv",10000)
     s.layout(offset=(x_env,y0))
     s = exp_slider("xFilter",10000)
     s.layout(offset=(x_x,y0))
     norm_slider("filterRes",x_res)
     y0 = 350
     x_lfo = x0
     x_lfo_delay = x_lfo+90
     x_lfo_amp = x_lfo_delay+60
     x_vsens = x_lfo_amp+90
     x_vdepth = x_vsens+60
     x_xpitch = x_vdepth+60
     param = "lfoFreq"
     t = Tumbler(canvas,param,editor,digits=5,scale=0.001)
     self.add_control(param,t)
     t.layout((x_lfo, y0))
     param = "lfoWave"
     msb = MSB(canvas,param,editor,3)
     self.add_control(param,msb)
     msb_aspect(msb,0,"Sine",0)
     msb_aspect(msb,1,"Square",1)
     msb_aspect(msb,2,"Random",2)
     msb.layout((x_lfo,y0+90))
     msb.update_aspect()
     linear_slider("lfoDelay",(0,3),x_lfo_delay)
     norm_slider("lfoAmp",x_lfo_amp)
     norm_slider("vsens",x_vsens)
     norm_slider("vdepth",x_vdepth)
     norm_slider("xPitch",x_xpitch)
     x_env = x_xpitch+90
     env_slider("attack",x_env)
     env_slider("decay",x_env+60)
     norm_slider("sustain",x_env+120)
     env_slider("release",x_env+180)
     x_amp = x_env+180+90
     param = "gateMode"
     msb = MSB(canvas,param,editor,2)
     self.add_control(param,msb)
     msb_aspect(msb,0,"ADSR",0)
     msb_aspect(msb,1,"Gate",1)
     msb.layout((x_amp, y0+90))
     msb.update_aspect()
     volume_slider("amp",x_amp+90)
Example #28
0
    def __init__(self, editor):
        frame = editor.create_tab(self.NAME, self.TAB_FILE)
        frame.config(background=factory.bg())
        canvas = factory.canvas(frame, 491, 708, 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)
        cfill = 'black'
        cforeground = '#d6dce6'
        cselected = cforeground

        def toggle(param, x, y):
            b = ToggleButton(canvas,
                             param,
                             editor,
                             fill=cfill,
                             foreground=cforeground,
                             outline=cforeground,
                             selected_fill=cfill,
                             selected_foreground=cselected)
            self.add_control(param, b)
            b.layout((x, y))
            b.update_aspect()
            return b

        def norm(param, x, y):
            s = cf.normalized_slider(canvas, param, editor)
            self.add_control(param, s)
            s.widget().place(x=x, y=y)
            return s

        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)
            return s

        def scale_slider(param, x, y):
            return linear_slider(param, (0, 4), x, y)

        def bias_slider(param, x, y):
            return linear_slider(param, (-4, 4), x, y)

        def bipolar_slider(param, x, y):
            return linear_slider(param, (-1, 1), x, y)

        y0 = 75
        yhp = y0 + 100
        x0 = 75
        xfb = x0 + 100
        xlag = xfb + 60
        xscale = xlag + 60
        xbias = xscale + 60
        toggle("enableMod", x0, y0)
        toggle("enableHpA", x0, yhp)
        norm("lagA", xlag, y0)
        scale_slider("scaleA", xscale, y0)
        bias_slider("biasA", xbias, y0)
        y1 = y0 + 250
        yhp = y1 + 100
        t = Tumbler(canvas,
                    "delay",
                    editor,
                    digits=4,
                    scale=0.001,
                    fill=cfill,
                    foreground=cforeground,
                    outline=cforeground,
                    range_=(0, 4000))
        self.add_control("delay", t)
        t.layout((x0, y1))
        toggle("enableHpDelay", x0, yhp)
        bipolar_slider("feedback", xfb, y1)
        norm("lagDelay", xlag, y1)
        scale_slider("scaleDelay", xscale, y1)
        bias_slider("biasDelay", xbias, y1)
Example #29
0
File: editor.py Project: kaos/Llia
    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)

        y = [50,275]
        x0 = 100
        xdelay = x0 + 180
        xmod = xdelay+90
        xfeedback = xmod+120
        xeq = xfeedback+60
        xmixer = xeq+150
        
        def add_slider(param,s,x,y,width=14,height=150):
            self.add_control(param,s)
            s.widget().place(x=x,y=y,width=width,height=height)
        
        def amp_slider(param,x,y):
            s = cf.volume_slider(canvas,param,editor)
            add_slider(param,s,x,y)

        def bipolar_slider(param,x,y, width=14, height=150):
            s = cf.bipolar_slider(canvas,param,editor)
            add_slider(param,s,x,y,width,height)

        def eq_slider(param,x,y):
            s = cf.third_octave_slider(canvas,param,editor)
            add_slider(param,s,x,y)

        def norm_slider(param,x,y):
            s = cf.normalized_slider(canvas,param,editor)
            add_slider(param,s,x,y)

        def linear_slider(param,x,y,range_=(0.0,1.0)):
            s = cf.linear_slider(canvas,param,editor,range_=range_)
            add_slider(param,s,x,y)
            
        for i in (0,1):
            n = i+1
            for j, p in enumerate(('d%dDry1In','d%dDry2In')):
                x = x0 + j*60
                param = p % n
                amp_slider(param,x,y[i])
            amp_slider('d2Delay1In',x0+60*2, y[1])
            param = 'd%dDelayTime' % n
            tumbler_delay = Tumbler(canvas, param, editor,
                                    sign=False, digits=4,scale = 0.001,
                                    range_ = (0,2000))
            self.add_control(param,tumbler_delay)
            tumbler_delay.layout((xdelay, y[i]))
            param = 'd%dLfoRatio' % n
            msb_lfo_ratio = MSB(canvas,param,editor,len(LFO_RATIOS))
            self.add_control(param, msb_lfo_ratio)
            for k,pair in enumerate(LFO_RATIOS):
                adict = {'text' : pair[0],
                         'font' : ('Times', 12),
                         'fill' : 'black',
                         'foreground' : 'white',
                         'outline' : 'white',
                         'active-fill' : 'black',
                         'active-foreground' : 'yellow',
                         'active-outline' : 'yellow'}
                msb_lfo_ratio.define_aspect(k,pair[1],adict)
                msb_lfo_ratio.layout((xdelay, y[i]+75))
                msb_lfo_ratio.update_aspect()
            norm_slider('d%dLfoModDepth' % n, xmod,y[i])
            norm_slider('d%dExternalModDepth' % n, xmod+60,y[i]) 
            bipolar_slider('d%dFeedback' % n, xfeedback,y[i])
            eq_slider('d%dLowpass' % n, xeq,y[i])
            eq_slider('d%dHighpass' % n, xeq+60,y[i])

        # Mixer
        amp_slider("dry1Amp", xmixer, y[0])
        amp_slider("dry2Amp", xmixer+60, y[0])
        amp_slider("d1Amp", xmixer+120, y[0])
        amp_slider("d2Amp", xmixer+180, y[0])

        bipolar_slider("dry1Pan", xmixer, y[1],height=75)
        bipolar_slider("dry2Pan", xmixer+60, y[1],height=75)
        bipolar_slider("d1Pan", xmixer+120, y[1],height=75)
        bipolar_slider("d2Pan", xmixer+180, y[1],height=75)

        msb_lfo_preset = MSB(canvas,"",None,7)
        for i in range(len(msb_lfo_preset)):
            adict = {'fill' : 'black',
                     'foreground' : 'white',
                     'outline' : 'white',
                     'active-fill' : 'black',
                     'active-foregeround' : 'yellow',
                     'active-outline' : 'yellow',
                     'text' : str(i+1),
                     'fomt' : ('Times', 8)}
            msb_lfo_preset.define_aspect(i,i+1,adict)
        msb_lfo_preset.layout((xmixer+160, y[1]+143),width=18,height=18)
        msb_lfo_preset.update_aspect()
        def lfo_preset_freq(*_):
            v = msb_lfo_preset.value()
            synth = self.editor.synth
            synth.x_param_change("lfoCommonFreq",v)
            synth.bank()[None]["lfoCommonFreq"] = float(v)
            tumbler_lfo.value(v)
        msb_lfo_preset.tag_bind("<Button-1>", lfo_preset_freq)
        msb_lfo_preset.tag_bind("<Button-3>", lfo_preset_freq)
            
        tumbler_lfo = Tumbler(canvas,"lfoCommonFreq",editor,
                              sign=False,digits=5, scale=0.001,
                              range_=(0,16999))
        self.add_control("lfoCommonFreq", tumbler_lfo)
        tumbler_lfo.layout((xmixer+60, y[1]+143))
Example #30
0
    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)
        y0 = 75
        y1 = y0+60
        y2 = y1+60 
        y3 = y2+70
        x0=90
        x1 = x0+100
        x2 = x1+60
        x3 = x2+60
        x4 = x3+60
        x5 = x4+75
        x6 = x5+60
        xlfo = x6+75
        xmix = x6+196
        
        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)
            return s

        def bipolar_slider(param, x, y, height=150):
            s = cf.bipolar_slider(canvas, param, editor)
            self.add_control(param,s)
            s.widget().place(x=x,y=y,height=height)
            return s
            
        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)
            return s

        def linear_slider(param, x, y, range_):
            s = cf.linear_slider(canvas, param, editor, range_=range_)
            self.add_control(param,s)
            s.widget().place(x=x,y=y)
            return s
     
        msb_xover = MSB(canvas,"xover",editor,len(xcon.CROSSOVER_FREQUENCIES))
        for i,v in enumerate(xcon.CROSSOVER_FREQUENCIES):
            d = _msb_aspect(v,str(v))
            msb_xover.define_aspect(i,v,d)
        self.add_control("xover", msb_xover)
        msb_xover.layout((x0,y0))
        msb_xover.update_aspect()
        msb_maxxover = MSB(canvas,"maxXover",editor,len(xcon.CROSSOVER_FREQUENCIES))
        for i,v in enumerate(xcon.CROSSOVER_FREQUENCIES):
            d = _msb_aspect(v,str(v))
            msb_maxxover.define_aspect(i,v,d)
        self.add_control("maxXover", msb_maxxover)
        msb_maxxover.layout((x0,y1))
        msb_maxxover.update_aspect()
        msb_minxover = MSB(canvas,"minXover",editor,len(xcon.CROSSOVER_FREQUENCIES))
        for i,v in enumerate(xcon.CROSSOVER_FREQUENCIES):
            d = _msb_aspect(v,str(v))
            msb_minxover.define_aspect(i,v,d)
        self.add_control("minXover",msb_minxover)
        msb_minxover.layout((x0,y2))
        msb_minxover.update_aspect()
        norm_slider("lfoToXover", x1,y0)
        msb_lforatio = MSB(canvas,"lfo2Ratio",editor,len(xcon.LFO_RATIOS))
        for i,p in enumerate(xcon.LFO_RATIOS):
            ratio, text = p
            d = _msb_aspect(ratio,text)
            msb_lforatio.define_aspect(i,ratio,d)
        self.add_control("lfo2Ratio", msb_lforatio)
        msb_lforatio.layout((x1-22,y3))
        msb_lforatio.update_aspect()
        norm_slider("lfo2Wave",x2,y0)
        norm_slider("externToXover",x3,y0)
        norm_slider("res",x4,y0)
        norm_slider("filterBMix",x5,y0)
        norm_slider("filterBLag",x6,y0)
        msb_b_ratio = MSB(canvas,"filterBRatio",editor,len(xcon.FILTER_B_RATIOS))
        for i,p in enumerate(xcon.FILTER_B_RATIOS):
            ratio,text = p
            d = _msb_aspect(ratio,text)
            msb_b_ratio.define_aspect(i,ratio,d)
        self.add_control("filterBRatio", msb_b_ratio)
        msb_b_ratio.layout((x5+6,y3))
        msb_b_ratio.update_aspect()
        tumbler = Tumbler(canvas,"lfoFreq",editor,digits=4,scale=0.01)
        self.add_control("lfoFreq", tumbler)
        tumbler.layout((xlfo, y1))
        msb_lfo_enable = ToggleButton(canvas,"lfoEnable",editor,
                                      fill='',foreground='#c29378',outline='#c29378',
                                      active_color='yellow',
                                      selected_fill='#825151', selected_foreground='white')
        self.add_control("lfoEnable",msb_lfo_enable)
        msb_lfo_enable.layout((xlfo, y2))
        msb_lfo_enable.update_aspect()
        amp_slider("dryAmp", xmix, y0)
        amp_slider("filterAAmp", xmix+60, y0)
        amp_slider("filterBAmp", xmix+120, y0)
        amp_slider("amp", xmix+180,y0)
        bipolar_slider("dryPan", xmix, y3)
        bipolar_slider("filterAPan", xmix+60, y3)
        bipolar_slider("filterBPan", xmix+120, y3)
        linear_slider("xscale", xlfo-7, y3, (0,4))
        linear_slider("xbias", xlfo+53, y3, (-4,4))
Example #31
0
 def tumbler(param,x,y,digits=5,scale=0.001):
     t = Tumbler(canvas,param,editor,digits=digits,scale=scale)
     self.add_control(param,t)
     t.layout((x,y))
     return t
Example #32
0
File: editor.py Project: kaos/Llia
 def tumbler(param, x, y=yfreq):
     t = Tumbler(canvas, param, editor, digits=5, scale=1)
     self.add_control(param, t)
     t.layout((x, y))
     return t
Example #33
0
 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