Esempio n. 1
0
 def __init__(self, scales=SCALES, init_scale=0):
     self.scales = scales
     self.scale_index = init_scale
     self.scale = scales[init_scale]
     self.on_scale_change, self.on_scale_change_emit = observable_factory(
         self.scale)
     self.ws_msg_producer, self.emit = observable_factory(
         msg_maker(init_scale))
Esempio n. 2
0
 def __init__(self, cbs={}):
     """
     cbs are a dict, keyed by a string name
     the callback takes a single value
     """
     self.cbs = cbs
     self.obs, self.emit = observable_factory()
Esempio n. 3
0
 def __init__(self,
              base_do=BASE_DO,
              pitchIndices=[0, 0, 0, 0],
              scale=ionian,
              rhythm=[-1] * 16):
     self.pitchIndices = pitchIndices
     self.base_do = base_do
     self.scale = scale
     self.length = len(rhythm)
     self.rhythm = rhythm
     self.real_notes = [0] * len(rhythm)
     self.update_notes()
     self.obs, self.emit = observable_factory(self.msg_maker())
Esempio n. 4
0
    def __init__(self,
                 scale_cube,
                 base_do=60,
                 length=16):
        self.scale_cube = scale_cube

        # optimization
        self._prev_scale = scale_cube.scale

        self.base_do = base_do
        self.length = length

        # the rhythm of the colors
        # -1 is rest, 0 hold, 1+ different colors
        self.rhythm = [-1] * length
        self._real_notes = [base_do] * length
        self.obs, self.emit = observable_factory(self.msg_maker())
Esempio n. 5
0
 def __init__(self, init_bpm, on_change_cb):
     self.on_change_cb = on_change_cb
     self.obs, self.emit = observable_factory(msg_maker(init_bpm))
Esempio n. 6
0
 def __init__(self, drummer):
     self.drummer = drummer
     self.obs, self.emit = observable_factory(self.msg())
Esempio n. 7
0
 def __init__(self, patch_cube):
     self.patch_cube = patch_cube
     self.obs, self.emit = observable_factory(self.msg_maker())
Esempio n. 8
0
 def __init__(self, instruments=[]):
     self.patch = 0
     self.instruments = instruments
     self.on_change, self.on_change_emit = observable_factory(self.patch)
Esempio n. 9
0
 def __init__(self, scale_cube):
     self.scale_cube = scale_cube
     self.obs, self.emit = observable_factory(
         msg_maker(scale_cube.scale_index))
Esempio n. 10
0
 def __init__(self):
     self.obs, self.emit = observable_factory()