'Populate self with events from the given quantized NoteSequence object.
Args:
quantized_sequence: A quantized NoteSequence instance.
start_step: Start converting the sequence at this time step.
Assumed to be the beginning of a bar.
min_pitch: The minimum valid pitch value, inclusive.
max_pitch: The maximum valid pitch value, inclusive.
split_repeats: Whether to force repeated notes to have a 0-state step
between them.
Returns:
A list of events.'

@staticmethod
def _from_quantized_sequence(quantized_sequence, start_step, min_pitch, max_pitch, split_repeats):

    piano_roll = np.zeros(((quantized_sequence.total_quantized_steps - start_step), ((max_pitch - min_pitch) + 1)), np.bool)
    for note in quantized_sequence.notes:
        if (note.quantized_start_step < start_step):
            continue
        if (not (min_pitch <= note.pitch <= max_pitch)):
            continue
        note_pitch_offset = (note.pitch - min_pitch)
        note_start_offset = (note.quantized_start_step - start_step)
        note_end_offset = (note.quantized_end_step - start_step)
        if split_repeats:
            piano_roll[((note_start_offset - 1), note_pitch_offset)] = 0
        piano_roll[note_start_offset:note_end_offset, note_pitch_offset] = 1
    events = [tuple(np.where(frame)[0]) for frame in piano_roll]
    return events
