Esempio n. 1
0
 def _init_paste_button(self):
     msb = MSB(self.canvas, '', None, 1)
     a0 = self._msb_aspect("Paste")
     msb.define_aspect(0,0,a0)
     x,y = self.xi0+192, self.y1-50
     msb.layout((x,y))
     msb.update_aspect()
     def paste_callback(*_):
         for k in self.clipboard.keys():
             p = self.params[k]
             v = self.clipboard[k]
             self.set_synth_value(p,v)
         self.sync_ui()
         self.status("Envelope pasted from clipboard")
     msb.client_callback = paste_callback
Esempio n. 2
0
 def _init_copy_button(self):
     msb = MSB(self.canvas, '', None, 1)
     a0 = self._msb_aspect("Copy")
     msb.define_aspect(0,0,a0)
     x,y = self.xi0+128, self.y1-50
     msb.layout((x,y))
     msb.update_aspect()
     def copy_callback(*_):
         program = self.synth.bank()[None]
         for k in self.clipboard.keys():
             p = self.params[k]
             v = program[p]
             self.clipboard[k] = v
         self.status("Envelope copied to clipboard")
     msb.client_callback=copy_callback
Esempio n. 3
0
 def _init_zoom_button(self):
     msb = MSB(self.canvas, "", None, 3)
     a0 = self._msb_aspect("X1")
     a1 = self._msb_aspect("X10")
     a2 = self._msb_aspect("X100")
     msb.define_aspect(0, 1, a0)
     msb.define_aspect(1, 10, a1)
     msb.define_aspect(2, 100, a2)
     x, y = self.xi0 + 256, self.y1-50
     msb.layout((x,y))
     msb.value(1)
     msb.update_aspect()
     def zoom_callback(*_):
         self.zoom = msb.value()
         self.sync_ui()
     msb.client_callback = zoom_callback
Esempio n. 4
0
    def _init_paste_button(self):
        msb = MSB(self.canvas, '', None, 1)
        a0 = self._msb_aspect("Paste")
        msb.define_aspect(0, 0, a0)
        x, y = self.xi0 + 192, self.y1 - 50
        msb.layout((x, y))
        msb.update_aspect()

        def paste_callback(*_):
            for k in self.clipboard.keys():
                p = self.params[k]
                v = self.clipboard[k]
                self.set_synth_value(p, v)
            self.sync_ui()
            self.status("Envelope pasted from clipboard")

        msb.client_callback = paste_callback
Esempio n. 5
0
    def _init_copy_button(self):
        msb = MSB(self.canvas, '', None, 1)
        a0 = self._msb_aspect("Copy")
        msb.define_aspect(0, 0, a0)
        x, y = self.xi0 + 128, self.y1 - 50
        msb.layout((x, y))
        msb.update_aspect()

        def copy_callback(*_):
            program = self.synth.bank()[None]
            for k in self.clipboard.keys():
                p = self.params[k]
                v = program[p]
                self.clipboard[k] = v
            self.status("Envelope copied to clipboard")

        msb.client_callback = copy_callback
Esempio n. 6
0
 def _init_init_button(self):
     msb = MSB(self.canvas, '', None, 1)
     a0 = self._msb_aspect("Init")
     msb.define_aspect(0,0,a0)
     x,y = self.xi0+64, self.y1-50
     msb.layout((x,y))
     msb.update_aspect()
     def init_callback(*_):
         self.set_synth_value(self.params['attack'], 0.0)
         self.set_synth_value(self.params['decay1'], 0.0)
         self.set_synth_value(self.params['decay2'], 0.0)
         self.set_synth_value(self.params['release'], 0.0)
         self.set_synth_value(self.params['breakpoint'], 1.0)
         self.set_synth_value(self.params['sustain'], 1.0)
         self.set_synth_value(self.params['gate-mode'], 0)
         self.sync_ui()
         self.status("Reset envelope")
     msb.client_callback = init_callback 
Esempio n. 7
0
    def _init_zoom_button(self):
        msb = MSB(self.canvas, "", None, 3)
        a0 = self._msb_aspect("X1")
        a1 = self._msb_aspect("X10")
        a2 = self._msb_aspect("X100")
        msb.define_aspect(0, 1, a0)
        msb.define_aspect(1, 10, a1)
        msb.define_aspect(2, 100, a2)
        x, y = self.xi0 + 256, self.y1 - 50
        msb.layout((x, y))
        msb.value(1)
        msb.update_aspect()

        def zoom_callback(*_):
            self.zoom = msb.value()
            self.sync_ui()

        msb.client_callback = zoom_callback
Esempio n. 8
0
    def _init_init_button(self):
        msb = MSB(self.canvas, '', None, 1)
        a0 = self._msb_aspect("Init")
        msb.define_aspect(0, 0, a0)
        x, y = self.xi0 + 64, self.y1 - 50
        msb.layout((x, y))
        msb.update_aspect()

        def init_callback(*_):
            self.set_synth_value(self.params['attack'], 0.0)
            self.set_synth_value(self.params['decay1'], 0.0)
            self.set_synth_value(self.params['decay2'], 0.0)
            self.set_synth_value(self.params['release'], 0.0)
            self.set_synth_value(self.params['breakpoint'], 1.0)
            self.set_synth_value(self.params['sustain'], 1.0)
            self.set_synth_value(self.params['gate-mode'], 0)
            self.sync_ui()
            self.status("Reset envelope")

        msb.client_callback = init_callback