Esempio n. 1
0
 def __init__(self,
              group,
              min=None,
              max=None,
              step=None,
              steps=None,
              param_name='freq',
              sticky=True,
              value=None):
     self.group = group
     self.min = min
     self.max = max
     assert step or steps and not (step and steps)
     if step is None:
         step = float(max - min) / steps
     self.step = step
     self.param_name = param_name
     self.sticky = sticky
     if self.min is not None and self.max is not None:
         self.check_range = self._check_min_max
     elif self.min is not None:
         self.check_range = self._check_min
     elif self.max is not None:
         self.check_range = self._check_max
     if sticky:
         core.Synth.synths.event_listeners[self.group].add(self)
     self.value = value
     gui.register(self)
Esempio n. 2
0
    def __init__(self, group,
                 min=0.20, max=1.80, start_vel=0, param_name='freq'):
        self.group = group
        self.div = 127. / (max - min)
        self.min = min
        self.param_name = param_name
        self.vel = start_vel
        core.Synth.synths.event_listeners[self.group].add(self)

        # `self.max` and `self.step` exist solely to support the GUI
        self.max = max
        self.step = (max - min) / 127.
        gui.register(self)
Esempio n. 3
0
    def __init__(self,
                 group,
                 min=0.20,
                 max=1.80,
                 start_vel=0,
                 param_name='freq'):
        self.group = group
        self.div = 127. / (max - min)
        self.min = min
        self.param_name = param_name
        self.vel = start_vel
        core.Synth.synths.event_listeners[self.group].add(self)

        # `self.max` and `self.step` exist solely to support the GUI
        self.max = max
        self.step = (max - min) / 127.
        gui.register(self)
Esempio n. 4
0
 def __init__(self, group, min=None, max=None, step=None, steps=None,
              param_name='freq', sticky=True, value=None):
     self.group = group
     self.min = min
     self.max = max
     assert step or steps and not (step and steps)
     if step is None:
         step = float(max - min) / steps
     self.step = step
     self.param_name = param_name
     self.sticky = sticky
     if self.min is not None and self.max is not None:
         self.check_range = self._check_min_max
     elif self.min is not None:
         self.check_range = self._check_min
     elif self.max is not None:
         self.check_range = self._check_max
     if sticky:
         core.Synth.synths.event_listeners[self.group].add(self)
     self.value = value
     gui.register(self)