'Generate a performance track from a primer performance track.
Args:
num_steps: The integer length in steps of the final track, after
generation. Includes the primer.
primer_sequence: The primer sequence, a Performance object.
temperature: A float specifying how much to divide the logits by
before computing the softmax. Greater than 1.0 makes tracks more
random, less than 1.0 makes tracks less random.
beam_size: An integer, beam size to use when generating tracks via
beam search.
branch_factor: An integer, beam search branch factor to use.
steps_per_iteration: An integer, number of steps to take per beam search
iteration.
note_density: Desired note density of generated performance. If None,
don\'t condition on note density.
pitch_histogram: Desired pitch class histogram of generated performance.
If None, don\'t condition on pitch class histogram.
Returns:
The generated Performance object (which begins with the provided primer
track).
Raises:
ValueError: If both `note_density` and `pitch_histogram` are provided as
conditioning variables.'

def generate_performance(self, num_steps, primer_sequence, temperature=1.0, beam_size=1, branch_factor=1, steps_per_iteration=1, note_density=None, pitch_histogram=None):

    if ((note_density is not None) and (pitch_histogram is not None)):
        control_events = ([(note_density, pitch_histogram)] * num_steps)
    elif (note_density is not None):
        control_events = ([note_density] * num_steps)
    elif (pitch_histogram is not None):
        control_events = ([pitch_histogram] * num_steps)
    else:
        control_events = None
    return self._generate_events(num_steps, primer_sequence, temperature, beam_size, branch_factor, steps_per_iteration, control_events=control_events)
