def __init__(self, length=10, section='left'): self.length = length self.section = section self.cycle_start = time.time() self.temp_pixels = np.array([[0.0, 0.0, 0.0]] * self.length) self.logger = logging_handler_setup('face section - %s' % self.section)
def __init__(self): # Dictionary of parameters, useful for higher level code # to be able to retrieve an animation's params self.params = {} # Initialise _fft var. This should only be get/set from the properties below self._fft = np.zeros((14,)) # This defines the layout used for animation self.layout = Layout() self.name = self.__class__.__name__ # Make a logger object self.logger = logging_handler_setup(self.name)
def __init__(self, layout, r=.50, g=0.50, b=0.50): super(Talker, self).__init__() self.layout = layout self.centre = Centre(length=fmap['stats']['c_pixels'], section='centre') self.right = Side(length=fmap['stats']['r_pixels'], section='right') self.left = Side(length=fmap['stats']['l_pixels'], section='left') self.cycle_start = time.time() self.temp_pixels = np.array( [[0.0, 0.0, 0.0]] * (fmap['stats']['c_pixels'] + fmap['stats']['r_pixels'] + fmap['stats']['l_pixels'] + fmap['stats']['cube_pixels'])) self.hue_it = random.uniform(0.0, 1.0) self.hue_step = 0.005 self.blob_length_factor = 10 self.blob_hue_range_offset = 0.3 self.blob_hue_range_factor = 0.03 self.blob_hue_noise_range_offset = 0.05 self.blob_hue_noise_range_factor = 0.03 self.add_param("hue_step", self.hue_step, 0, 0.01) self.add_param("blob_hue_range_offset", self.blob_hue_range_offset, 0, 50) self.add_param("blob_hue_range_offset", self.blob_hue_range_offset, 0, 1) self.add_param("blob_hue_range_factor", self.blob_hue_range_factor, 0, 0.1) self.add_param("blob_hue_noise_range_offset", self.blob_hue_noise_range_offset, 0, 0.1) self.add_param("blob_hue_noise_range_factor", self.blob_hue_noise_range_factor, 0, 0.1) self.beat_range = [2, 4] self.blob_buffer = [] self.logger = logging_handler_setup('Animation Talker')
def run_main(self, *args): self.logger = logging_handler_setup(self.name) self.logger.info("Starting Process %s" % self.name) self.main(*args)