• {% assign display_name = instrument.instrument_name %} {% assign plugin_name = instrument.instrument_name | downcase %} {% assign is_sample = false %} {% if plugin_name == 'audiofileprocessor' or instrument.audiofileprocessor %}{% assign is_sample = true %}{% endif %} {% if is_sample %} {% if display_name contains "audiofileprocessor" and instrument.patterns %} {% assign first_pattern = instrument.patterns | first %} {% if first_pattern.name %}{% assign display_name = first_pattern.name %}{% endif %} {% elsif instrument.audiofileprocessor.src %} {% assign src_parts = instrument.audiofileprocessor.src | split: '/' %} {% assign display_name = src_parts | last %} {% endif %} {% assign display_name = display_name | remove: ".ogg" | remove: ".wav" %} {% endif %} {% assign instrument_slug = display_name | replace: ' ', '+' %} {{ display_name }} {% unless is_sample %} (Synth 🎹){% endunless %}
    {% for pattern in instrument.patterns %} {% assign pattern_steps = pattern.steps %} {% if pattern_steps and pattern_steps.size > 0 %}
    {% assign total_steps = pattern_steps.size %} {% assign chunk_size = 4 %} {% assign num_chunks = total_steps | divided_by: chunk_size %} {% assign remainder = total_steps | modulo: chunk_size %} {% if remainder > 0 %}{% assign num_chunks = num_chunks | plus: 1 %}{% endif %} {% for i in (0..num_chunks) %} {% assign start_index = i | times: chunk_size %} {% assign current_chunk_array = pattern_steps | slice: start_index, chunk_size %} {% if current_chunk_array.size > 0 %} {% 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 %}
    {% for step_active in current_chunk_array %}
    {% endfor %}
    {% endif %} {% endfor %}
    {% endif %} {% endfor %}
    {% if is_sample %} {% assign sample_src = instrument.audiofileprocessor.src | default: "" | strip %} {% if sample_src != "" %} {% assign audio_filename_with_path = 'src/samples/' | append: sample_src %} {% endif %} {% else %} {% endif %}