tentando obter playlist real do projeto mmp
This commit is contained in:
1 parent
f86bc02ba9
commit
aa084edcb2
66 files changed
+4976
-630
No files matched your search
@@ -67,23 +67,18 @@ def parse_mmp_file(file_path):
|
||||
if bassline_info:
|
||||
# 1. Extração dos Clipes para a Playlist (Timeline)
|
||||
playlist_clips = []
|
||||
bbtrack = track.find("bbtrack")
|
||||
if bbtrack is not None:
|
||||
trackcontent = bbtrack.find("trackcontent")
|
||||
if trackcontent is not None:
|
||||
# Estes patterns representam ONDE o bloco "Caixa" aparece na música
|
||||
for pattern in trackcontent.findall("pattern"):
|
||||
playlist_clips.append({
|
||||
"pos": int(pattern.attrib.get("pos", 0)),
|
||||
"len": int(pattern.attrib.get("len", 192)),
|
||||
"steps": int(pattern.attrib.get("steps", 16)),
|
||||
"name": track_name
|
||||
})
|
||||
|
||||
# .findall("bbtco") busca direto nos filhos da track
|
||||
for bbtco in track.findall("bbtco"):
|
||||
playlist_clips.append({
|
||||
"pos": int(bbtco.attrib.get("pos", 0)),
|
||||
"len": int(bbtco.attrib.get("len", 192)),
|
||||
"name": track_name
|
||||
})
|
||||
|
||||
# Injeta a lista de clipes no objeto JSON final
|
||||
bassline_info["playlist_clips"] = playlist_clips
|
||||
|
||||
# Garante metadados corretos
|
||||
# Metadados padrão
|
||||
bassline_info["type"] = "bassline"
|
||||
bassline_info["track_name"] = track_name
|
||||
|
||||
|
||||
Reference in new issue
Block a user