示例#1
0
 def load_meta(self):
     """
     Loads the metadata from the file into the transcript meta object which is then passed to the transcript object
     """
     transcript_meta = TranscriptMeta(midiformat=self.pattern.format, resolution=self.pattern.resolution)
     start_time = 0
     for event in self.pattern[0]:
         start_time += event.tick
         if MidiUtils.is_key_signature_event(event):
             transcript_meta.key_signature_event = event
         if MidiUtils.is_time_signature_event(event):
             transcript_meta.time_signature_event = event
         if MidiUtils.is_set_tempo_event(event):
             transcript_meta.tempo_dict[start_time] = event
     self.transcript.set_transcript_meta(transcript_meta)