class_docstr: Encodes a melody that is flattened into only rhythm (with velocity).
  
  TextMelodyEncoderAbsolute encodes the melody as a sequence of MELODY_NO_EVENT,
  MELODY_NOTE_OFF, and pitch ids. This representation contains no
  MELODY_NOTE_OFF events, and instead of pitch ids, uses velocity-bin ids. To
  take advantage of the MelodyOneHotEncoding, this class passes the velocity bin
  range to the parent __init__ in lieu of min_pitch and max_pitch.
class_docstr_tok: ["Encodes","a","melody","that","is","flattened","into","only","rhythm","(","with","velocity",")",".","TextMelodyEncoderAbsolute","encodes","the","melody","as","a","sequence","of","MELODY_NO_EVENT",",","MELODY_NOTE_OFF",",","and","pitch","ids",".","This","representation","contains","no","MELODY_NOTE_OFF","events",",","and","instead","of","pitch","ids",",","uses","velocity-bin","ids",".","To","take","advantage","of","the","MelodyOneHotEncoding",",","this","class","passes","the","velocity","bin","range","to","the","parent","__init__","in","lieu","of","min_pitch","and","max_pitch","."]
docstr: Transforms melody from a midi_file into a list of melody event indices.
  
  Args:
    s: Path to a MIDI file.
  
  Returns:
    ids: List of encoded melody event indices.
code: def encode(self, s):
      """Transforms melody from a midi_file into a list of melody event indices.
  
      Args:
        s: Path to a MIDI file.
  
      Returns:
        ids: List of encoded melody event indices.
      """
      ns = note_seq.midi_file_to_sequence_proto(s)
      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 3 for calling the FlattenedTextMelodyEncoderAbsolute obj's underlying member method code with example usage: obj.encode(s) and returns: self