{{ page.file }}
{% if page.file or page.bpm %}
{% if page.file %}
{% endif %}
{% if page.bpm %}
{% endif %}
📁 Arquivo: {{ page.file }}
🎵 BPM: {{ page.bpm }}
{% if page.tags %}
{% assign tags_vazias = true %}
{% for categoria in page.tags %}
{% if categoria[1] and categoria[1].size > 0 %}
{% assign tags_vazias = false %}
{% endif %}
{% endfor %}
{% unless tags_vazias %}
{% endunless %}
{% endif %}
{% if page.tracks and page.tracks.size > 0 %}
{% endif %}
🎚️ 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 display_name = instrument.instrument_name %} {% if display_name contains "audiofileprocessor" and instrument.patterns %} {% assign first_pattern_name = instrument.patterns | map: 'name' | first %} {% if first_pattern_name and first_pattern_name != empty %} {% assign display_name = first_pattern_name | remove: ".ogg" | remove: ".wav" | remove: ".flac" | remove: ".mp3" %} {% elsif instrument.audiofileprocessor.src %} {% assign src_parts = instrument.audiofileprocessor.src | split: '/' %} {% assign file_name = src_parts | last %} {% assign display_name = file_name | remove: ".ogg" | remove: ".wav" | remove: ".flac" | remove: ".mp3" %} {% endif %} {% endif %} {% assign instrument_slug = display_name | replace: ' ', '+' %}{% comment %} LOOP para múltiplos patterns com rótulo P1, P2, P3. {% endcomment %} {% for pattern in instrument.patterns %} {% assign pattern_steps = pattern.steps %} {% if pattern_steps and pattern_steps.size > 0 %}
{{ display_name }}P{{ forloop.index }}: {% comment %} >>> INÍCIO DA LÓGICA DE STEPS CLICÁVEIS (4-steps) <<< (O container agora é 'row' para manter os chunks na horizontal) {% endcomment %}{% endif %} {% endfor %} {% comment %} Player de áudio e condição de sample ausente {% endcomment %} {% assign sample_src = instrument.audiofileprocessor.src | default: "" | strip %} {% if instrument.audiofileprocessor and sample_src != "" %} {% assign audio_filename_with_path = 'src/samples/' | append: sample_src %}{% assign total_steps = pattern_steps.size %} {% assign chunk_size = 4 %} {% comment %} Calcula quantos pedaços de 4 steps teremos {% endcomment %} {% assign num_chunks = total_steps | divided_by: chunk_size %} {% comment %} FIX: Primeiro calculamos o 'resto' e salvamos numa variável {% endcomment %} {% assign remainder = total_steps | modulo: chunk_size %} {% comment %} FIX: Agora sim usamos a variável na comparação {% endcomment %} {% if remainder > 0 %} {% assign num_chunks = num_chunks | plus: 1 %} {% endif %} {% for i in (0..num_chunks) %} {% assign start_index = i | times: chunk_size %} {% comment %} Pega a fatia de 4 steps {% endcomment %} {% assign current_chunk_array = pattern_steps | slice: start_index, chunk_size %} {% if current_chunk_array.size > 0 %} {% comment %} 1. Serializa o chunk (ex: [1,0,0,1] -> "1001") {% endcomment %} {% assign chunk_string = "" %} {% for step in current_chunk_array %} {% if step == true or step == 'true' or step == 1 %} {% assign chunk_string = chunk_string | append: '1' %} {% else %} {% assign chunk_string = chunk_string | append: '0' %} {% endif %} {% endfor %} {% comment %} 2. Cria o link clicável {% endcomment %} {% assign search_url = '/pattern/?p=' | append: chunk_string | relative_url %} {% comment %} 3. Renderiza o visual do step DENTRO do link {% endcomment %}{% comment %} >>> FIM DA LÓGICA DE STEPS CLICÁVEIS <<< {% endcomment %}{% for step_active in current_chunk_array %} {% assign step_color = '#d9d9d9' %} {% if step_active == true or step_active == 'true' or step_active == 1 %} {% assign step_color = '#4caf50' %} {% endif %} {% endfor %} {% comment %} Preenche com steps vazios se o chunk for menor que 4 {% endcomment %} {% assign remaining_steps = chunk_size | minus: current_chunk_array.size %} {% if remaining_steps > 0 %} {% for j in (1..remaining_steps) %} {% endfor %} {% endif %}{% endif %} {% endfor %}{% else %}O sample **não foi enviado** 😢
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
-
🛠️ Abra na Criação Colaborativa
{% comment %} CONSTRUÇÃO DA URL CORRIGIDA PARA AMBIENTES DE TESTE: {% endcomment %} {% assign creation_url = '/~jotachina/mmpSearch/creation.html?project=' | append: page.file %} Abrir no MMPCreator
O link abrirá o projeto em uma nova aba para edição.
Arquivo: {{ page.file }}
{% assign embed_url = creation_url | append: '&embed=true' %}