(self, msg)
Handles a single incoming MIDI message during capture.

    Args:
      msg: The mido.Message MIDI message to handle.
Handles a single incoming MIDI message during capture.
Handles a single incoming MIDI message during capture .
def _capture_message(self, msg):
    """Handles a single incoming MIDI message during capture.

    Args:
      msg: The mido.Message MIDI message to handle.
    """
    if msg.type == 'note_off' or (msg.type == 'note_on' and msg.velocity == 0):
      if msg.note not in self._open_notes:
        # This is not a note we're looking for. Drop it.
        return

      self._open_notes[msg.note].end_time = msg.time
      del self._open_notes[msg.note]

    elif msg.type == 'note_on':
      if msg.note in self._open_notes:
        # This is likely just a repeat of the previous message.
        return

      new_note = self._add_note(msg)
      self._open_notes[new_note.pitch] = new_note
def _capture_message ( self , msg ) : if msg . type == 'note_off' or ( msg . type == 'note_on' and msg . velocity == 0 ) : if msg . note not in self . _open_notes : # This is not a note we're looking for. Drop it. return self . _open_notes [ msg . note ] . end_time = msg . time del self . _open_notes [ msg . note ] elif msg . type == 'note_on' : if msg . note in self . _open_notes : # This is likely just a repeat of the previous message. return new_note = self . _add_note ( msg ) self . _open_notes [ new_note . pitch ] = new_note