blob: 2f72475dc86e97a093875ba8b2a44638387604b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import xml.etree.ElementTree as xml
import sys
def main(file):
collection = xml.parse(file)
root = collection.getroot()
tracks = []
for track in root.iter("TRACK"):
tempos = track.findall("TEMPO")
if len(tempos) > 1:
bpms = {float(tempo.get("Bpm", "0")) for tempo in tempos}
if len(bpms) > 1:
name = track.get("Name")
tracks.append(name)
for name in tracks:
print(name)
if __name__ == "__main__":
main(str(sys.argv[1]))
|