'Adds the given note to the `events` list.
`start_step` is set to the given pitch. `end_step` is set to NOTE_OFF.
Everything after `start_step` in `events` is deleted before the note is
added. `events`\'s length will be changed so that the last event has index
`end_step`.
Args:
pitch: Midi pitch. An integer between 0 and 127 inclusive.
start_step: A non-negative integer step that the note begins on.
end_step: An integer step that the note ends on. The note is considered to
end at the onset of the end step. `end_step` must be greater than
`start_step`.
Raises:
BadNoteException: If `start_step` does not precede `end_step`.'

def _add_note(self, pitch, start_step, end_step):

    if (start_step >= end_step):
        raise BadNoteException(('Start    step    does    not    precede    end    step:    start=%d,    end=%d' % (start_step, end_step)))
    self.set_length((end_step + 1))
    self._events[start_step] = pitch
    self._events[end_step] = MELODY_NOTE_OFF
    for i in range((start_step + 1), end_step):
        self._events[i] = MELODY_NO_EVENT
