(self)
Loads default MIDI primer file.

    Also assigns the steps per bar of this file to be the model's defaults.
Loads default MIDI primer file.
Loads default MIDI primer file .
def load_primer(self):
    """Loads default MIDI primer file.

    Also assigns the steps per bar of this file to be the model's defaults.
    """

    if not os.path.exists(self.midi_primer):
      tf.logging.warn('ERROR! No such primer file exists! %s', self.midi_primer)
      return

    self.primer_sequence = midi_io.midi_file_to_sequence_proto(self.midi_primer)
    quantized_seq = sequences_lib.quantize_note_sequence(
        self.primer_sequence, steps_per_quarter=4)
    extracted_melodies, _ = melody_pipelines.extract_melodies(
        quantized_seq, min_bars=0, min_unique_pitches=1)
    self.primer = extracted_melodies[0]
    self.steps_per_bar = self.primer.steps_per_bar
def load_primer ( self ) : if not os . path . exists ( self . midi_primer ) : tf . logging . warn ( 'ERROR! No such primer file exists! %s' , self . midi_primer ) return self . primer_sequence = midi_io . midi_file_to_sequence_proto ( self . midi_primer ) quantized_seq = sequences_lib . quantize_note_sequence ( self . primer_sequence , steps_per_quarter = 4 ) extracted_melodies , _ = melody_pipelines . extract_melodies ( quantized_seq , min_bars = 0 , min_unique_pitches = 1 ) self . primer = extracted_melodies [ 0 ] self . steps_per_bar = self . primer . steps_per_bar