'Converts the ChordProgression to NoteSequence proto.
This doesn\'t generate actual notes, but text annotations specifying the
chord changes when they occur.
Args:
sequence_start_time: A time in seconds (float) that the first chord in
the sequence will land on.
qpm: Quarter notes per minute (float).
Returns:
A NoteSequence proto encoding the given chords as text annotations.'

def to_sequence(self, sequence_start_time=0.0, qpm=120.0):

    seconds_per_step = ((60.0 / qpm) / self.steps_per_quarter)
    sequence = music_pb2.NoteSequence()
    sequence.tempos.add().qpm = qpm
    sequence.ticks_per_quarter = STANDARD_PPQ
    current_figure = NO_CHORD
    for (step, figure) in enumerate(self):
        if (figure != current_figure):
            current_figure = figure
            chord = sequence.text_annotations.add()
            chord.time = ((step * seconds_per_step) + sequence_start_time)
            chord.text = figure
            chord.annotation_type = CHORD_SYMBOL
    return sequence
