-
{% for track in page.tracks %}
{% assign tem_instr = false %}
@@ -104,89 +105,41 @@ title: "{{ page.file }}"
{% endif %}
{% if tem_instr %}
-
-
-
- {% assign instrument_slug = instrument.instrument_name | replace: ' ', '+' %}
+
-
+ {% for instrument in track.instruments %}
+ {% if instrument.instrument_name %}
+
-
+
+ {% assign instrument_slug = instrument.instrument_name | replace: ' ', '+' %}
+
+
{{ instrument.instrument_name }}+ - -{{ instrument.instrument_name }}- - - {% if page.tracks and page.tracks.size > 0 %} --
-🎚️ Instrumentos- --
- {% for track in page.tracks %}
- {% assign tem_instr = false %}
- {% if track.instruments and track.instruments.size > 0 %}
- {% assign tem_instr = true %}
- {% endif %}
-
- {% if track.bassline_name or tem_instr %}
-
-
- {% if track.bassline_name %}
-
🎼 {{ track.bassline_name }}
- {% endif %} - - {% if tem_instr %} --
- {% for instrument in track.instruments %}
- {% if instrument.instrument_name %}
-
-
-
- {% assign instrument_slug = instrument.instrument_name | replace: ' ', '+' %}
-
-
{{ instrument.instrument_name }}- - - - {% assign base_path = "/usr/share/lmms/" %} - {% assign found_audio = false %} - - - {% assign subfolders = "instrumentos/sintetizadores, instrumentos/bateria, outros" | split: ", " %} - - {% for folder in subfolders %} - {% assign audio_file_path = base_path | append: folder | append: "/" | append: instrument.instrument_name | append: ".wav" %} - - - {% if audio_file_path %} - {% assign found_audio = true %} -- -- {% break %} - {% endif %} - {% endfor %} - - {% if found_audio == false %} -Áudio não encontrado para este instrumento.
- {% endif %} - -
- {% endif %}
- {% endfor %}
-
- {% endif %}
- {% endfor %}
- -
-
- {% assign instrument_slug = instrument.instrument_name | replace: ' ', '+' %}
-
-
+- - {% endif %} - + {% break %} + {% endif %} + {% endfor %} + + {% if found_audio == false %} +Áudio não encontrado para este instrumento.
{% endif %} - {% endfor %} - + + + {% endif %} + {% endfor %} + {% endif %} {% endif %} diff --git a/scripts/handler/src_instruments.py b/scripts/handler/src_instruments.py new file mode 100644 index 0000000..6a0af68 --- /dev/null +++ b/scripts/handler/src_instruments.py @@ -0,0 +1,28 @@ +import os +import json + +# Caminho base onde os arquivos .wav estão localizados +base_dir = "/usr/share/lmms/" + +# Caminho para salvar o arquivo JSON na pasta metadata (na raiz do seu site) +output_file = "metadata/src_audio_files.json" # Substitua com o caminho correto + +# Função para percorrer o diretório e suas subpastas +def find_audio_files(base_dir): + audio_files = [] + for root, dirs, files in os.walk(base_dir): + for file in files: + if (file.endswith(".wav") or file.endswith(".ogg") or + file.endswith(".flac") or file.endswith(".mp3")): + # Adiciona o caminho completo do arquivo + audio_files.append(os.path.join(root, file)) + return audio_files + +# Chama a função para encontrar os arquivos +audio_files = find_audio_files(base_dir) + +# Salva a lista de arquivos encontrados em um arquivo JSON +with open(output_file, "w") as f: + json.dump(audio_files, f, indent=4) + +print(f"Arquivo JSON gerado com sucesso em: {output_file}") -
- {% if track.bassline_name %}
-
-
+
+ {% assign instrument_slug = instrument.instrument_name | replace: ' ', '+' %}
+
+
-
- {% for instrument in track.instruments %}
- {% if instrument.instrument_name %}
-