'Construct a Performance.
Either quantized_sequence or steps_per_second should be supplied.
Args:
quantized_sequence: A quantized NoteSequence proto.
steps_per_second: Number of quantized time steps per second.
start_step: The offset of this sequence relative to the
beginning of the source sequence. If a quantized sequence is used as
input, only notes starting after this step will be considered.
num_velocity_bins: Number of velocity bins to use. If 0, velocity events
will not be included at all.
Raises:
ValueError: If `num_velocity_bins` is larger than the number of MIDI
velocity values.'

def __init__(self, quantized_sequence=None, steps_per_second=None, start_step=0, num_velocity_bins=0):

    if ((quantized_sequence, steps_per_second).count(None) != 1):
        raise ValueError('Must    specify    exactly    one    of    quantized_sequence    or    steps_per_second')
    if (num_velocity_bins > ((MAX_MIDI_VELOCITY - MIN_MIDI_VELOCITY) + 1)):
        raise ValueError(('Number    of    velocity    bins    is    too    large:    %d' % num_velocity_bins))
    if quantized_sequence:
        sequences_lib.assert_is_absolute_quantized_sequence(quantized_sequence)
        self._events = self._from_quantized_sequence(quantized_sequence, start_step, num_velocity_bins)
        self._steps_per_second = quantized_sequence.quantization_info.steps_per_second
    else:
        self._events = []
        self._steps_per_second = steps_per_second
    self._start_step = start_step
    self._num_velocity_bins = num_velocity_bins
