class_docstr: Stores a polyphonic sequence as a stream of single-note events.
  
  Events are PolyphonicEvent tuples that encode event type and pitch.
class_docstr_tok: ["Stores","a","polyphonic","sequence","as","a","stream","of","single-note","events",".","Events","are","PolyphonicEvent","tuples","that","encode","event","type","and","pitch","."]
docstr: Construct a PolyphonicSequence.
  
  Either quantized_sequence or steps_per_quarter should be supplied.
  
  Args:
    quantized_sequence: a quantized NoteSequence proto.
    steps_per_quarter: how many steps a quarter note represents.
    start_step: The offset of this sequence relative to the
        beginning of the source sequence. If a quantized sequence is used as
        input, only notes starting after this step will be considered.
docstr_tok: ["Construct","a","PolyphonicSequence",".","Either","quantized_sequence","or","steps_per_quarter","should","be","supplied",".","Args",":","quantized_sequence",":","a","quantized","NoteSequence","proto",".","steps_per_quarter",":","how","many","steps","a","quarter","note","represents",".","start_step",":","The","offset","of","this","sequence","relative","to","the","beginning","of","the","source","sequence",".","If","a","quantized","sequence","is","used","as","input",",","only","notes","starting","after","this","step","will","be","considered","."]
code: def __init__(
      self,
      quantized_sequence=None,
      steps_per_quarter=None,
      start_step=0,
  ):
      """Construct a PolyphonicSequence.
  
      Either quantized_sequence or steps_per_quarter should be supplied.
  
      Args:
        quantized_sequence: a quantized NoteSequence proto.
        steps_per_quarter: how many steps a quarter note represents.
        start_step: The offset of this sequence relative to the
            beginning of the source sequence. If a quantized sequence is used as
            input, only notes starting after this step will be considered.
      """
      assert (quantized_sequence, steps_per_quarter).count(None) == 1
  
      if quantized_sequence:
          sequences_lib.assert_is_relative_quantized_sequence(
              quantized_sequence
          )
          self._events = self._from_quantized_sequence(
              quantized_sequence, start_step
          )
          self._steps_per_quarter = (
              quantized_sequence.quantization_info.steps_per_quarter
          )
      else:
          self._events = [
              PolyphonicEvent(
                  event_type=PolyphonicEvent.START, pitch=None
              )
          ]
          self._steps_per_quarter = steps_per_quarter
  
      self._start_step = start_step
  
imports: from __future__ import division
  import collections
  import copy
  from magenta.pipelines import statistics
  from note_seq import constants
  from note_seq import events_lib
  from note_seq import sequences_lib
  from note_seq.protobuf import music_pb2
  from six.moves import range
  import tensorflow.compat.v1
label_desc: Use image node_id 1 to create a new PolyphonicSequence object from inherited base classes: events_lib with example: obj = PolyphonicSequence(quantized_sequence, steps_per_quarter, start_step)