(self, input_sequence, zero_time, response_start_time,
                response_end_time)
return adjust_sequence_times(response_sequence, zero_time)
Generates a response sequence with the currently-selected generator.

    Args:
      input_sequence: The NoteSequence to use as a generation seed.
      zero_time: The float time in seconds to treat as the start of the input.
      response_start_time: The float time in seconds for the start of
          generation.
      response_end_time: The float time in seconds for the end of generation.

    Returns:
      The generated NoteSequence.
Generates a response sequence with the currently-selected generator.
Generates a response sequence with the currently - selected generator .
def _generate(self, input_sequence, zero_time, response_start_time,
                response_end_time):
    """Generates a response sequence with the currently-selected generator.

    Args:
      input_sequence: The NoteSequence to use as a generation seed.
      zero_time: The float time in seconds to treat as the start of the input.
      response_start_time: The float time in seconds for the start of
          generation.
      response_end_time: The float time in seconds for the end of generation.

    Returns:
      The generated NoteSequence.
    """
    # Generation is simplified if we always start at 0 time.
    response_start_time -= zero_time
    response_end_time -= zero_time

    generator_options = generator_pb2.GeneratorOptions()
    generator_options.input_sections.add(
        start_time=0,
        end_time=response_start_time)
    generator_options.generate_sections.add(
        start_time=response_start_time,
        end_time=response_end_time)

    # Get current temperature setting.
    generator_options.args['temperature'].float_value = self._temperature()

    # Generate response.
    tf.logging.info(
        "Generating sequence using '%s' generator.",
        self._sequence_generator.details.id)
    tf.logging.debug('Generator Details: %s',
                     self._sequence_generator.details)
    tf.logging.debug('Bundle Details: %s',
                     self._sequence_generator.bundle_details)
    tf.logging.debug('Generator Options: %s', generator_options)
    response_sequence = self._sequence_generator.generate(
        adjust_sequence_times(input_sequence, -zero_time), generator_options)
    response_sequence = note_seq.trim_note_sequence(response_sequence,
                                                    response_start_time,
                                                    response_end_time)
    return adjust_sequence_times(response_sequence, zero_time)
def _generate ( self , input_sequence , zero_time , response_start_time , response_end_time ) : # Generation is simplified if we always start at 0 time. response_start_time -= zero_time response_end_time -= zero_time generator_options = generator_pb2 . GeneratorOptions ( ) generator_options . input_sections . add ( start_time = 0 , end_time = response_start_time ) generator_options . generate_sections . add ( start_time = response_start_time , end_time = response_end_time ) # Get current temperature setting. generator_options . args [ 'temperature' ] . float_value = self . _temperature ( ) # Generate response. tf . logging . info ( "Generating sequence using '%s' generator." , self . _sequence_generator . details . id ) tf . logging . debug ( 'Generator Details: %s' , self . _sequence_generator . details ) tf . logging . debug ( 'Bundle Details: %s' , self . _sequence_generator . bundle_details ) tf . logging . debug ( 'Generator Options: %s' , generator_options ) response_sequence = self . _sequence_generator . generate ( adjust_sequence_times ( input_sequence , - zero_time ) , generator_options ) response_sequence = note_seq . trim_note_sequence ( response_sequence , response_start_time , response_end_time ) return adjust_sequence_times ( response_sequence , zero_time )