def _set_non_pad_translated_identifiers(self): visible_drum_pads = self.visible_drum_pads if visible_drum_pads: for button in self.drum_matrix: identifier = self._button_coordinates_to_pad_index(first(visible_drum_pads).note, button.coordinate) if identifier < 128: button.identifier = identifier button.enabled = True self._coordinate_to_pad_map[button.coordinate] = self._all_drum_pads[button.identifier] else: button.enabled = False
def visible_drum_pads(self): if self._visible_drum_pads and self._all_drum_pads: first_pad = first(self._visible_drum_pads) if first_pad: size = self.width * self.height first_note = first_pad.note if first_note > 128 - size: size = 128 - first_note offset = clamp(first_note, 0, 128 - len(self._visible_drum_pads)) return self._all_drum_pads[offset:offset + size] return []
def visible_drum_pads(self): if self._visible_drum_pads and self._all_drum_pads: first_pad = first(self._visible_drum_pads) if first_pad: size = self.width * self.height first_note = first_pad.note if first_note > 128 - size: size = 128 - first_note offset = clamp(first_note, 0, 128 - len(self._visible_drum_pads)) return self._all_drum_pads[offset : offset + size] return []