'Returns this sequence restricted to events in the given slice range.'

def __getslice__(self, i, j):

    i = min(max(i, 0), len(self))
    return type(self)(pad_event=self._pad_event, events=self._events[i:j], start_step=(self.start_step + i), steps_per_bar=self.steps_per_bar, steps_per_quarter=self.steps_per_quarter)
