class_docstr: Convert between performance event indices and (filenames of) MIDI files.
class_docstr_tok: ["Convert","between","performance","event","indices","and","(","filenames","of",")","MIDI","files","."]
docstr: Transform a MIDI filename into a list of performance event indices.
  
  Args:
    s: Path to the MIDI file.
  
  Returns:
    ids: List of performance event indices.
code: def encode(self, s):
      """Transform a MIDI filename into a list of performance event indices.
  
      Args:
        s: Path to the MIDI file.
  
      Returns:
        ids: List of performance event indices.
      """
      if s:
          ns = note_seq.midi_file_to_sequence_proto(s)
      else:
          ns = note_seq.NoteSequence()
      return self.encode_note_sequence(ns)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tempfile
  import note_seq
  from note_seq import performance_lib
  import pygtrie
  from tensor2tensor.data_generators import text_encoder
label_desc: Use image node_id 4 for calling the MidiPerformanceEncoder obj's underlying member method code with example usage: obj.encode(s) and returns: self