def METHOD_NAME(self, current_sample: int):
    if self.modulation_msg_indices is not None:
        msg_index = next((i for i, sample in enumerate(self.modulation_msg_indices) if sample >= current_sample),
                         len(self.modulation_msg_indices))
        self.ui.progressBarMessage.setValue(msg_index + 1)