def get_score_end_time(score):
    """Return the timestamp just after the final note in the score ends."""
    if not score:
        return 0
    last_event = score[-1]

    if last_event.time_delta is None:
        return last_event.time

    return last_event.time + last_event.time_delta.total_beats()