class_docstr: Convert chord symbol sequences to integer indices.
class_docstr_tok: ["Convert","chord","symbol","sequences","to","integer","indices","."]
docstr: Transform a NoteSequence into a list of chord event indices.
  
  Args:
    ns: NoteSequence proto containing the chords to encode (as text
        annotations).
  
  Returns:
    ids: List of chord event indices.
code: def encode_note_sequence(self, ns):
      """Transform a NoteSequence into a list of chord event indices.
  
      Args:
        ns: NoteSequence proto containing the chords to encode (as text
            annotations).
  
      Returns:
        ids: List of chord event indices.
      """
      qns = note_seq.quantize_note_sequence(ns, self._steps_per_quarter)
  
      chords = []
      current_chord = note_seq.NO_CHORD
      current_step = 0
      for ta in sorted(qns.text_annotations, key=lambda ta: ta.time):
          if ta.annotation_type != CHORD_SYMBOL:
              continue
          chords += [current_chord] * (ta.quantized_step - current_step)
          current_chord = ta.text
          current_step = ta.quantized_step
      chords += [current_chord] * (
          qns.total_quantized_steps - current_step
      )
  
      return self._encode_chord_symbols(chords)
  
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 TextChordsEncoder obj's underlying member method code with example usage: obj.encode_note_sequence(ns) and returns: self