def read_lab_chords(filename): chords = [] with open(filename) as f: chord_lines = f.readlines() chords = [] for line in chord_lines: line = line.strip() if not line: continue start, end, chord = line.split(' ') start = float(start) end = float(end) chord = Chord.from_string(chord) chords.append(TimedData(start, end, chord.get_number())) return chords