def range(sequence):
    """Returns the note rance in a tuplet (min_note, max_note)"""
    if len(sequence) == 0:
        return (0, 0)

    min_pitch = 999
    max_pitch = 0
    for note in sequence:
        if note.data.pitch < min_pitch:
            min_pitch = note.data.pitch
        if note.data.pitch > max_pitch:
            max_pitch = note.data.pitch

    return (min_pitch, max_pitch)