def suitable_next_track_count(self, key): _key = KeyFactory.new(key) same = self.count_for[str(KeyFactory.new(key))] higher = self.count_for[_key.up_fifth] lower = self.count_for[_key.down_fifth] relative = self.count_for[_key.relative] return same + higher + lower + relative
def add_track(self, track): self.append(track) self.count_for[str(KeyFactory.new(track.key))] += 1 try: self.tempos[track.bpm] += 1 except AttributeError: pass