Upgrade interface do MMPSearch
Deploy / Deploy (push) Successful in 1m18s Details

This commit is contained in:
JotaChina 2025-11-30 18:14:25 -03:00
parent 7abfb7f1ea
commit 5c851aae88
12 changed files with 2974 additions and 0 deletions

25
pages/404.md Normal file
View File

@ -0,0 +1,25 @@
---
permalink: /404.html
layout: default
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>

130
pages/automation.md Normal file
View File

@ -0,0 +1,130 @@
---
layout: default
title: Projetos com a tag Automation
permalink: /automation/
---
<meta charset="utf-8" />
<main class="main-content">
<div class="publication">{% include sidebar.html %}</div>
<div class="container">
<div class="columns is-mobile is-vcentered" style="margin-bottom: 2rem">
<!-- Título -->
<div class="column is-auto">
<h2 class="title is-4">
<code>Projetos que possuem a tag automation:</code>
</h2>
</div>
<!-- Botão Limpar Filtro -->
<div class="column is-auto">
<button id="clearFilterButton" class="button is-small is-light">
Limpar filtro
</button>
</div>
</div>
<!-- Projetos -->
<div id="project-list" class="columns is-multiline">
{% for projeto in site.data.all %} {% if projeto.tags.TAG contains
"automation" %}
<div
class="column is-6 project-item"
data-automation="{{ projeto.tags.automation | join: ',' }}"
>
<div class="box">
<!-- Botão do projeto -->
{% assign file_url = projeto.file | downcase | replace: ' ', '-' |
replace: 'ç', 'c' | replace: 'ã', 'a' | replace: 'á', 'a' | replace:
'â', 'a' | replace: 'é', 'e' | replace: 'ê', 'e' | replace: 'í', 'i' |
replace: 'ó', 'o' | replace: 'ô', 'o' | replace: 'õ', 'o' | replace:
'ú', 'u' %}
<a
href="../mmp_pages/{{ file_url }}.html"
class="button is-link is-fullwidth"
>
{{ projeto.file }}
</a>
<!-- Lista de automations clicáveis -->
{% if projeto.tags.automation and projeto.tags.automation.size > 0 %}
<div style="margin-top: 1rem">
<p><strong>Automation:</strong></p>
<ul style="list-style-type: disc; padding-left: 1.25rem">
{% for automation in projeto.tags.automation %} {% if automation
!= "" %}
<li>
<a
href="#"
class="automation-item"
data-automation="{{ automation }}"
>{{ automation }}</a
>
</li>
{% endif %} {% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>
{% endif %} {% endfor %}
</div>
</div>
</main>
<script>
document.addEventListener("DOMContentLoaded", function () {
const projects = document.querySelectorAll(".project-item");
// Função para aplicar filtro por automation
function filterByAutomation(automationName) {
projects.forEach((project) => {
const projectAutomations = project
.getAttribute("data-automation")
.split(",");
if (projectAutomations.includes(automationName)) {
project.style.display = "block";
} else {
project.style.display = "none";
}
});
}
// Lê a automation da URL se houver
const urlParams = new URLSearchParams(window.location.search);
const automationFromUrl = urlParams.get("automation");
if (automationFromUrl) {
filterByAutomation(automationFromUrl);
}
// Ao clicar numa automation na lista
const automationItems = document.querySelectorAll(".automation-item");
automationItems.forEach((item) => {
item.addEventListener("click", function (event) {
event.preventDefault();
const selectedAutomation = item.getAttribute("data-automation");
filterByAutomation(selectedAutomation);
// Atualiza a URL sem recarregar a página
const newUrl = new URL(window.location.href);
newUrl.searchParams.set("automation", selectedAutomation);
window.history.replaceState({}, "", newUrl);
});
});
// Botão para limpar filtro
const clearFilterButton = document.querySelector("#clearFilterButton");
clearFilterButton.addEventListener("click", function () {
projects.forEach((project) => {
project.style.display = "block";
});
// Remove o filtro da URL
const newUrl = new URL(window.location.href);
newUrl.searchParams.delete("automation");
window.history.replaceState({}, "", newUrl);
});
});
</script>

138
pages/bassline.md Normal file
View File

@ -0,0 +1,138 @@
---
layout: default
title: Projetos com a tag Bassline
permalink: /bassline/
---
<meta charset="utf-8" />
<main class="main-content">
<div class="publication">{% include sidebar.html %}</div>
<div class="container">
<div class="columns is-mobile is-vcentered" style="margin-bottom: 2rem">
<!-- Título -->
<div class="column is-auto">
<h2 class="title is-4">
<code>Projetos que possuem a tag bassline:</code>
</h2>
</div>
<!-- Botão Limpar Filtro -->
<div class="column is-auto">
<button id="clearFilterButton" class="button is-small is-light">
Limpar filtro
</button>
</div>
</div>
<!-- Projetos -->
<div id="project-list" class="columns is-multiline">
{% for projeto in site.data.all %} {% if projeto.tags.TAG contains
"bassline" %}
<div
class="column is-6 project-item"
data-bassline="{{ projeto.tags.bassline | join: ',' }}"
>
<div class="box">
<!-- Botão do projeto -->
{% assign file_url = projeto.file | downcase | replace: ' ', '-' |
replace: 'ç', 'c' | replace: 'ã', 'a' | replace: 'á', 'a' | replace:
'â', 'a' | replace: 'é', 'e' | replace: 'ê', 'e' | replace: 'í', 'i' |
replace: 'ó', 'o' | replace: 'ô', 'o' | replace: 'õ', 'o' | replace:
'ú', 'u' %}
<a
href="../mmp_pages/{{ file_url }}.html"
class="button is-link is-fullwidth"
>
{{ projeto.file }}
</a>
<!-- Lista de Basslines clicáveis -->
{% if projeto.tags.bassline and projeto.tags.bassline.size > 0 %}
<div style="margin-top: 1rem">
<p><strong>Bassline:</strong></p>
<ul style="list-style-type: disc; padding-left: 1.25rem">
{% for bassline in projeto.tags.bassline %} {% if bassline != ""
%}
<li>
<a href="#" class="bassline-item" data-bassline="{{ bassline }}"
>{{ bassline }}</a
>
</li>
{% endif %} {% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>
{% endif %} {% endfor %}
</div>
</div>
</main>
<script>
document.addEventListener("DOMContentLoaded", function () {
const projects = document.querySelectorAll(".project-item");
// Função para aplicar filtro por bassline
function filterByBassline(basslineName) {
projects.forEach((project) => {
const projectBasslines = project
.getAttribute("data-bassline")
.split(",");
if (projectBasslines.includes(basslineName)) {
project.style.display = "block";
} else {
project.style.display = "none";
}
});
}
// Lê o parâmetro bassline da URL (se houver)
const urlParams = new URLSearchParams(window.location.search);
let basslineFromUrl = urlParams.get("bassline");
// Substituir "+" por " " (espaços)
if (basslineFromUrl) {
basslineFromUrl = basslineFromUrl.replace(/\+/g, " ");
filterByBassline(basslineFromUrl);
}
// Ao clicar numa bassline na lista
const basslineItems = document.querySelectorAll(".bassline-item");
if (basslineItems.length > 0) {
basslineItems.forEach((item) => {
item.addEventListener("click", function (event) {
event.preventDefault();
const selectedBassline = item.getAttribute("data-bassline");
// Substitui espaços por "+"
const basslineForUrl = selectedBassline.replace(/ /g, "+");
filterByBassline(selectedBassline);
// Atualiza a URL sem recarregar a página
const newUrl = new URL(window.location.href);
newUrl.searchParams.set("bassline", basslineForUrl);
window.history.replaceState({}, "", newUrl);
});
});
}
// Botão para limpar filtro
const clearFilterButton = document.querySelector("#clearFilterButton");
if (clearFilterButton) {
clearFilterButton.addEventListener("click", function () {
projects.forEach((project) => {
project.style.display = "block";
});
// Remove o parâmetro bassline da URL
const newUrl = new URL(window.location.href);
newUrl.searchParams.delete("bassline");
window.history.replaceState({}, "", newUrl);
});
}
});
</script>

678
pages/creation.md Normal file
View File

@ -0,0 +1,678 @@
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MMPCreator</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
/>
<link rel="stylesheet" href="assets/css/creator.css" />
<style>
/* Estilo para clipes de pattern */
.timeline-clip.pattern-clip {
background: linear-gradient(to bottom, #4a4f57, #3b3f45);
height: 70px; /* Mais alto para ver as notas */
overflow: hidden;
}
/* Container para as notas do pattern */
.pattern-clip-view {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 2px 0;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-around;
gap: 1px;
}
/* Linha de trilha dentro do clipe */
.pattern-clip-track-row {
position: relative;
width: 100%;
height: 100%;
}
/* Cada "nota" (bloco branco) */
.pattern-step-note {
position: absolute;
background-color: rgba(255, 255, 255, 0.9);
border-left: 1px solid #333;
border-bottom: 1px solid #333;
border-radius: 1px;
box-sizing: border-box;
}
/* Menu de contexto */
#timeline-context-menu .menu-divider {
height: 1px;
background-color: var(--border-color);
margin: 4px 0;
padding: 0;
}
#timeline-context-menu div#delete-clip:hover {
background-color: var(--accent-red);
color: white;
}
#timeline-context-menu div#paste-clip.disabled {
color: var(--text-dark);
cursor: default;
background-color: transparent;
}
#timeline-context-menu div#paste-clip.disabled:hover {
color: var(--text-dark);
background-color: transparent;
}
</style>
</head>
<body>
<aside class="sample-browser">
<div class="browser-header">Navegador de Samples</div>
<div class="browser-content" id="browser-content"></div>
</aside>
<button id="sidebar-toggle"><i class="fa-solid fa-caret-left"></i></button>
<div class="app-container">
<header class="global-toolbar">
<div class="control-group">
<i
class="fa-solid fa-file"
id="new-project-btn"
title="Novo Projeto"
></i>
<span style="margin-left: 8px">Novo projeto</span>
<i
class="fa-solid fa-folder-open"
id="open-mmp-btn"
title="Abrir Projeto do Servidor"
></i>
<span style="margin-left: 8px">Abrir projetos</span>
<i
class="fa-solid fa-save"
id="save-mmp-btn"
title="Salvar Projeto (.mmp)"
></i>
<span style="margin-left: 8px">Salvar projeto</span>
<i
class="fa-solid fa-upload"
id="upload-sample-btn"
title="Carregar Sample do Computador"
></i>
<span style="margin-left: 8px">Enviar sample</span>
</div>
<div class="divider"></div>
<div class="control-group">
<button id="record-btn" class="transport-btn" title="Gravar">
<i class="fa-solid fa-circle-dot"></i>
<span style="margin-left: 8px">Gravar</span>
</button>
</div>
<div class="divider"></div>
<div class="info-display-group">
<div class="info-display">
<div class="interactive-input-container">
<button class="adjust-btn" data-target="bpm" data-step="-1">
-
</button>
<input
type="text"
class="value-input"
id="bpm-input"
value="140"
data-min="20"
data-max="400"
/>
<button class="adjust-btn" data-target="bpm" data-step="1">
+
</button>
</div>
<div class="label">ANDAMENTO/BPM</div>
</div>
<div class="info-display">
<div class="interactive-input-container">
<button class="adjust-btn" data-target="bars" data-step="-1">
-
</button>
<input
type="text"
class="value-input"
id="bars-input"
value="1"
data-min="1"
data-max="64"
/>
<button class="adjust-btn" data-target="bars" data-step="1">
+
</button>
</div>
<div class="label">COMPASSOS</div>
</div>
<div class="info-display">
<div class="interactive-input-container">
<div class="compasso-group">
<button
class="adjust-btn"
data-target="compasso-a"
data-step="-1"
>
-
</button>
<input
type="text"
class="value-input compasso-input"
id="compasso-a-input"
value="4"
data-min="1"
data-max="16"
/>
<button
class="adjust-btn"
data-target="compasso-a"
data-step="1"
>
+
</button>
</div>
<span class="compasso-separator">/</span>
<div class="compasso-group">
<button
class="adjust-btn"
data-target="compasso-b"
data-step="-1"
>
-
</button>
<input
type="text"
class="value-input compasso-input"
id="compasso-b-input"
value="4"
data-min="1"
data-max="16"
/>
<button
class="adjust-btn"
data-target="compasso-b"
data-step="1"
>
+
</button>
</div>
</div>
<div class="label">COMPASSO</div>
</div>
<div class="info-display">
<div
id="timer-display"
class="interactive-input-container"
style="font-size: 0.7rem; color: var(--text-dark)"
>
00:00:00
</div>
<div class="label">MIN:SEC:MSEC</div>
</div>
</div>
<div class="control-group">
<button id="metronome-btn" title="Metrônomo On/Off">Metrônomo</button>
<button
id="create-room-btn"
class="transport-btn"
title="Criar ou entrar em uma sala compartilhada"
>
<i class="fa-solid fa-users"></i>
<span style="margin-left: 8px">Criar Sala</span>
</button>
<button id="toggle-mixer-btn" class="control-btn" title="Abrir Mixer (Futuro)">
<i class="fa-solid fa-sliders"></i>
<span style="margin-left: 8px">Abrir Mixer</span>
</button>
</div>
<div class="spacer"></div>
<div class="control-group master-controls">
<div class="knob-container">
<div class="knob" id="master-volume-knob">
<div class="knob-indicator"></div>
</div>
<span>VOL MASTER</span>
</div>
<div class="knob-container">
<div class="knob" id="master-pan-knob">
<div class="knob-indicator"></div>
</div>
<span>PAN MASTER</span>
</div>
</div>
</header>
<main class="main-content">
<div class="beat-editor">
<div class="editor-toolbar">
<div class="editor-header">
<div class="toolbar-group">
<button id="play-btn" class="control-btn" title="Play Patterns"><i class="fa-solid fa-play"></i></button>
<button id="stop-btn" class="control-btn" title="Stop"><i class="fa-solid fa-stop"></i></button>
<div class="toolbar-divider"></div>
<select id="global-pattern-selector" title="Selecionar Pattern Ativo">
<option value="0">Pattern 1</option>
<option value="1">Pattern 2</option>
<option value="2">Pattern 3</option>
<option value="3">Pattern 4</option>
</select>
<button class="control-btn" id="add-pattern-btn" title="Novo Pattern (Não implementado no JS ainda)"><i class="fa-solid fa-plus"></i></button>
<button class="control-btn" id="remove-pattern-btn" title="Remover Pattern (Não implementado no JS ainda)"><i class="fa-solid fa-minus"></i></button>
<div class="toolbar-divider"></div>
<button id="send-pattern-to-playlist-btn" class="control-btn" title="Renderizar para Áudio">
<i class="fa-solid fa-arrow-right-to-bracket"></i> <span style="margin-left:5px;">Enviar p/ Playlist</span>
</button>
</div>
<div class="toolbar-group">
<div class="toolbar-divider"></div>
<button id="add-instrument-btn" class="control-btn" title="Adicionar Instrumento">
<i class="fa-solid fa-music"></i> <i class="fa-solid fa-plus" style="font-size: 0.7em; margin-left: 3px;"></i>
<span style="margin-left: 8px">Adicionar Instrumento</span>
</button>
<button id="remove-instrument-btn" class="control-btn" title="Remover Instrumento Selecionado">
<i class="fa-solid fa-trash"></i>
<span style="margin-left: 8px">Remover Instrumento</span>
</button>
</div>
</div>
<div id="sequencer-grid" class="sequencer-container">
</div>
<div class="tool-icons">
</div>
<div id="timeline-context-menu">
<div id="copy-clip">Copiar</div>
<div id="cut-clip">Recortar</div>
<div id="paste-clip">Colar</div>
<div class="menu-divider"></div>
<div id="delete-clip" style="color: var(--accent-red)">
Excluir Clipe
</div>
</div>
<div id="ruler-context-menu">
<div id="ruler-set-loop-start">Definir Início do Loop</div>
<div id="ruler-set-loop-end">Definir Fim do Loop</div>
</div>
</div>
<div id="track-container"></div>
</div>
<div class="piano-roll-editor" id="piano-roll-editor" style="display: none;">
<div class="editor-header">
<span>Piano Roll - <span id="piano-roll-instrument-name">Instrumento 1</span></span>
<div class="window-controls">
<i class="fa-solid fa-xmark" id="close-piano-roll-btn"></i>
</div>
</div>
<div class="piano-roll-toolbar">
<div class="playback-controls">
<i class="fa-solid fa-pencil active" title="Draw Tool"></i>
<i class="fa-solid fa-eraser" title="Erase Tool"></i>
</div>
<div class="snap-controls">
<label>Snap:</label>
<select>
<option>1/4</option>
<option>1/8</option>
<option selected>1/16</option>
</select>
</div>
</div>
<div class="piano-roll-workspace">
<div class="piano-keys-container" id="piano-keys-container">
<canvas id="piano-keys-canvas"></canvas>
</div>
<div class="piano-grid-container" id="piano-grid-container">
<canvas id="piano-grid-canvas"></canvas>
</div>
</div>
</div>
<div class="audio-editor">
<div class="editor-header" id="audio-editor-header">
<div class="toolbar-group">
<span class="panel-title" style="margin-right: 10px;"><i class="fa-solid fa-wave-square"></i> Playlist</span>
<div class="toolbar-divider"></div>
<button id="audio-editor-play-btn" class="control-btn" title="Play Playlist">
<i class="fa-solid fa-play"></i>
</button>
<button id="audio-editor-stop-btn" class="control-btn" title="Stop Playlist">
<i class="fa-solid fa-stop"></i>
</button>
<button id="audio-editor-loop-btn" class="control-btn" title="Loop Mode">
<i class="fa-solid fa-repeat"></i>
<span style="margin-left: 8px">Loop</span>
</button>
</div>
<div class="toolbar-group">
<button id="slice-tool-btn" class="control-btn" title="Ferramenta Corte (Slice)">
<i class="fa-solid fa-scissors"></i>
<span style="margin-left: 8px">Cortar</span>
</button>
<button id="resize-tool-trim" class="control-btn active" title="Redimensionar (Trim)">
<i class="fa-solid fa-arrows-left-right-to-line"></i>
<span style="margin-left: 8px">Redimensionar</span>
</button>
<button id="resize-tool-stretch" class="control-btn" title="Esticar (Stretch)">
<i class="fa-solid fa-expand"></i>
<span style="margin-left: 8px">Esticar</span>
</button>
<button id="delete-clip" class="control-btn" title="Excluir Clip Selecionado">
<i class="fa-solid fa-trash"></i>
<span style="margin-left: 8px">Rem. Instrumento</span>
</button>
<div class="toolbar-divider"></div>
<button id="zoom-out-btn" class="control-btn" title="Zoom Out">
<i class="fa-solid fa-magnifying-glass-minus"></i>
</button>
<button id="zoom-in-btn" class="control-btn" title="Zoom In">
<i class="fa-solid fa-magnifying-glass-plus"></i>
</button>
<div class="toolbar-divider"></div>
<button id="add-audio-track-btn" class="control-btn" title="Adicionar Pista">
<i class="fa-solid fa-plus"></i>
<span style="margin-left: 8px">Add Track</span>
</button>
<button id="remove-audio-track-btn" class="control-btn" title="Remover Última Pista">
<i class="fa-solid fa-minus"></i>
<span style="margin-left: 8px">Rem. Track</span>
</button>
</div>
</div>
<div class="audio-tracks-wrapper">
<div id="audio-timeline-ruler" class="timeline-ruler"></div>
<div id="loop-region" class="loop-region"></div>
<div id="playhead" class="playhead"></div>
<div id="audio-track-container" class="track-container"></div>
</div>
</div>
</main>
</div>
<input
type="file"
id="mmp-file-input"
accept=".mmp, .mmpz"
style="display: none"
/>
<input
type="file"
id="sample-file-input"
accept=".wav,.flac,.ogg,.mp3"
style="display: none"
/>
<div class="modal-overlay" id="open-project-modal">
<div class="modal-content">
<button class="modal-close" id="open-modal-close-btn">&times;</button>
<h2 class="modal-title">Abrir Projeto</h2>
<div class="modal-section">
<h3>Projetos no Servidor</h3>
<div id="server-projects-list"><p>Carregando...</p></div>
</div>
<div class="modal-section">
<h3>Carregar do Computador</h3>
<button class="modal-button" id="load-from-computer-btn">
<i class="fa-solid fa-desktop"></i> Selecionar arquivo .mmp ou .mmpz
</button>
</div>
</div>
</div>
<script>
// Verifica se a página está sendo carregada com o parâmetro &embed=true
const isEmbed = new URLSearchParams(window.location.search).get("embed");
if (isEmbed === "true") {
document.body.classList.add("embed-mode");
}
</script>
<script type="module">
// Importamos o estado global para ler/salvar notas reais
import { appState } from "./assets/js/creations/state.js"; // Ajuste o caminho se necessário
import { sendAction } from "./assets/js/creations/socket.js";
import { renderAll } from "./assets/js/creations/ui.js";
import * as Tone from "https://esm.sh/tone";
// Variáveis de Controle
let currentTrackId = null;
const CONSTANTS = {
NOTE_HEIGHT: 20,
KEY_WIDTH: 60,
BEAT_WIDTH: 40,
TOTAL_KEYS: 84, // 7 oitavas
START_NOTE: 24, // C1
TICKS_PER_PIXEL: 0 // Calculado dinamicamente
};
const pianoRollEditor = document.getElementById('piano-roll-editor');
const keysCanvas = document.getElementById('piano-keys-canvas');
const gridCanvas = document.getElementById('piano-grid-canvas');
const keysCtx = keysCanvas.getContext('2d');
const gridCtx = gridCanvas.getContext('2d');
const gridContainer = document.getElementById('piano-grid-container');
const keysContainer = document.getElementById('piano-keys-container');
// Sintetizador de preview
const previewSynth = new Tone.PolySynth(Tone.Synth).toDestination();
previewSynth.volume.value = -10;
// --- FUNÇÃO GLOBAL PARA ABRIR O EDITOR ---
window.openPianoRoll = function(trackId) {
const track = appState.pattern.tracks.find(t => t.id === trackId);
if (!track) return;
currentTrackId = trackId;
document.getElementById('piano-roll-instrument-name').textContent = track.name;
// Mostra o editor
pianoRollEditor.style.display = 'flex';
// Redimensiona e desenha
resizeCanvas();
// Centraliza o scroll vertical (C5)
const middleY = (CONSTANTS.TOTAL_KEYS / 2) * CONSTANTS.NOTE_HEIGHT;
gridContainer.scrollTop = middleY - 200;
};
// --- DESENHO E LÓGICA ---
function resizeCanvas() {
const totalHeight = CONSTANTS.TOTAL_KEYS * CONSTANTS.NOTE_HEIGHT;
// 64 compassos * 192 ticks / (ticks por beat) * largura... simplificando:
// Vamos fixar uma largura grande por enquanto
const totalWidth = 3000;
keysCanvas.width = CONSTANTS.KEY_WIDTH;
keysCanvas.height = totalHeight;
gridCanvas.width = totalWidth;
gridCanvas.height = totalHeight;
// Importante: Sincronizar a conversão de Pixel <-> Tick
// 1 Beat = 48 ticks (em 16th) ou 192 ticks por bar?
// No seu file.js: ticksPerStep = 12 (1/16).
// Então BEAT_WIDTH (40px) = 4 steps = 48 ticks.
CONSTANTS.TICKS_PER_PIXEL = 48 / CONSTANTS.BEAT_WIDTH;
drawKeys();
drawGrid();
drawNotes();
}
function drawKeys() {
keysCtx.clearRect(0, 0, keysCanvas.width, keysCanvas.height);
for (let i = 0; i < CONSTANTS.TOTAL_KEYS; i++) {
const midiNote = CONSTANTS.START_NOTE + (CONSTANTS.TOTAL_KEYS - 1 - i);
const y = i * CONSTANTS.NOTE_HEIGHT;
const isBlack = isBlackKey(midiNote);
keysCtx.fillStyle = isBlack ? '#333' : '#eee';
keysCtx.fillRect(0, y, CONSTANTS.KEY_WIDTH, CONSTANTS.NOTE_HEIGHT);
keysCtx.strokeStyle = '#555';
keysCtx.strokeRect(0, y, CONSTANTS.KEY_WIDTH, CONSTANTS.NOTE_HEIGHT);
if (midiNote % 12 === 0) {
keysCtx.fillStyle = isBlack ? '#fff' : '#333';
keysCtx.font = '10px Arial';
keysCtx.fillText('C' + (Math.floor(midiNote / 12) - 1), 35, y + 14);
}
}
}
function drawGrid() {
gridCtx.fillStyle = '#292929';
gridCtx.fillRect(0, 0, gridCanvas.width, gridCanvas.height);
// Linhas das notas
for (let i = 0; i < CONSTANTS.TOTAL_KEYS; i++) {
const midiNote = CONSTANTS.START_NOTE + (CONSTANTS.TOTAL_KEYS - 1 - i);
const y = i * CONSTANTS.NOTE_HEIGHT;
const isBlack = isBlackKey(midiNote);
gridCtx.fillStyle = isBlack ? '#222' : '#2a2a2a';
gridCtx.fillRect(0, y, gridCanvas.width, CONSTANTS.NOTE_HEIGHT);
gridCtx.strokeStyle = '#333';
gridCtx.beginPath(); gridCtx.moveTo(0, y); gridCtx.lineTo(gridCanvas.width, y); gridCtx.stroke();
}
// Linhas verticais (Tempo)
for (let x = 0; x < gridCanvas.width; x += CONSTANTS.BEAT_WIDTH) {
gridCtx.beginPath();
gridCtx.strokeStyle = (x % (CONSTANTS.BEAT_WIDTH * 4) === 0) ? '#666' : '#383838';
gridCtx.moveTo(x, 0); gridCtx.lineTo(x, gridCanvas.height); gridCtx.stroke();
}
}
function drawNotes() {
if (!currentTrackId) return;
const track = appState.pattern.tracks.find(t => t.id === currentTrackId);
if (!track) return;
const pattern = track.patterns[track.activePatternIndex];
const notes = pattern.notes || [];
gridCtx.fillStyle = '#ffbb00'; // Cor Laranja
gridCtx.strokeStyle = '#000';
notes.forEach(note => {
// Converter MIDI para Y (Invertido)
const keyIndex = (CONSTANTS.TOTAL_KEYS - 1) - (note.key - CONSTANTS.START_NOTE);
const y = keyIndex * CONSTANTS.NOTE_HEIGHT;
// Converter Ticks (pos) para X
// Se 48 ticks = BEAT_WIDTH (40px) -> pos / 1.2
const x = note.pos / CONSTANTS.TICKS_PER_PIXEL;
const width = note.len / CONSTANTS.TICKS_PER_PIXEL;
gridCtx.fillRect(x + 1, y + 1, width - 2, CONSTANTS.NOTE_HEIGHT - 2);
gridCtx.strokeRect(x + 1, y + 1, width - 2, CONSTANTS.NOTE_HEIGHT - 2);
});
}
// --- INTERAÇÃO: CRIAR NOTAS ---
gridCanvas.addEventListener('mousedown', (e) => {
if (!currentTrackId) return;
const rect = gridCanvas.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
// 1. Calcular Nota (Y)
const keyIndex = Math.floor(y / CONSTANTS.NOTE_HEIGHT);
const midiNote = CONSTANTS.START_NOTE + (CONSTANTS.TOTAL_KEYS - 1 - keyIndex);
// 2. Calcular Posição (X) e Snap
// Snap padrão 1/16 = 12 ticks
const snapTicks = 12;
const rawTicks = x * CONSTANTS.TICKS_PER_PIXEL;
const quantizedPos = Math.floor(rawTicks / snapTicks) * snapTicks;
// 3. Criar Objeto Nota
const newNote = {
pos: quantizedPos,
len: 48, // Duração padrão (1 beat/seminima) - ajuste conforme desejar
key: midiNote,
vol: 100,
pan: 0
};
// 4. Atualizar Estado e Redesenhar
const track = appState.pattern.tracks.find(t => t.id === currentTrackId);
if (track) {
const pattern = track.patterns[track.activePatternIndex];
// Se não existir array de notas, cria
if (!pattern.notes) pattern.notes = [];
pattern.notes.push(newNote);
// Toca som
const noteName = Tone.Frequency(midiNote, "midi").toNote();
previewSynth.triggerAttackRelease(noteName, "8n");
// Redesenha Piano Roll
drawNotes();
// IMPORTANTE: Atualizar a UI da lista de trilhas (para aparecer a miniatura)
// E enviar via Socket para colaboradores
renderAll();
sendAction({
type: "UPDATE_PATTERN_NOTES",
trackId: currentTrackId,
patternIndex: track.activePatternIndex,
notes: pattern.notes
});
}
});
// Scroll Sync
gridContainer.addEventListener('scroll', () => {
keysContainer.scrollTop = gridContainer.scrollTop;
});
// Fechar
document.getElementById('close-piano-roll-btn').addEventListener('click', () => {
pianoRollEditor.style.display = 'none';
currentTrackId = null;
});
function isBlackKey(note) {
const n = note % 12;
return (n === 1 || n === 3 || n === 6 || n === 8 || n === 10);
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tone/14.7.77/Tone.js"></script>
<script src="assets/js/creations/main.js" type="module"></script>
<script src="https://cdn.socket.io/4.7.5/socket.io.min.js"></script>
<script src="assets/js/creations/socket.js" type="module"></script>
</body>
</html>

306
pages/instruments.md Normal file
View File

@ -0,0 +1,306 @@
---
layout: default
title: Projetos por Instrumento
permalink: /instruments/
---
<meta charset="utf-8" />
<main class="main-content">
<div class="publication">
<div class="container">
<br />
<div class="tabs is-centered is-boxed is-medium mb-6">
{% include sidebar.html %}
</div>
<details class="box mb-5 p-0 collapse-card" open
style="border: 1px solid #cfe8fc; overflow: hidden; background-color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.05); height: fit-content !important; min-height: unset;">
<summary class="p-4 is-flex is-justify-content-space-between is-align-items-center"
style="cursor: pointer; background-color: #f0f8ff; transition: background-color 0.2s; user-select: none;">
<div class="is-flex is-align-items-center">
<span class="icon has-text-info mr-2"><i class="fa-solid fa-guitar"></i></span>
<span class="has-text-grey-dark has-text-weight-bold">Todos os Instrumentos Disponíveis</span>
<span id="filter-counter" class="tag is-info is-light ml-3 is-hidden">0 selecionados</span>
</div>
<span class="icon has-text-grey-light chevron-icon"><i class="fa-solid fa-chevron-down"></i></span>
</summary>
<div class="p-4" style="background-color: #fff; border-top: 1px solid #cfe8fc;">
<div class="tags is-centered are-medium mb-0">
{% assign all_instruments_string = "" %}
{% for p in site.data.all %}
{% for track in p.tracks %}
{% if track.instruments %}
{% for inst in track.instruments %}
{% if inst.instrument_name and inst.instrument_name != "" %}
{% unless all_instruments_string contains inst.instrument_name %}
{% assign all_instruments_string = all_instruments_string | append: inst.instrument_name | append: "|||" %}
{% endunless %}
{% endif %}
{% endfor %}
{% elsif track.instrument_name and track.instrument_name != "" %}
{% unless all_instruments_string contains track.instrument_name %}
{% assign all_instruments_string = all_instruments_string | append: track.instrument_name | append: "|||" %}
{% endunless %}
{% endif %}
{% endfor %}
{% endfor %}
{% assign unique_instruments = all_instruments_string | split: "|||" | sort %}
{% for item in unique_instruments %}
{% if item != "" %}
<a href="#" class="tag is-white filter-item clickable-tag"
data-value="{{ item }}"
style="border: 1px solid #deeaf6; color: #5b7da3; margin-bottom: 0.5rem; transition: all 0.2s;">
{{ item }}
</a>
{% endif %}
{% endfor %}
</div>
<div class="has-text-centered mt-3">
<p class="help has-text-grey">Clique para filtrar.</p>
</div>
</div>
</details>
<div class="columns is-mobile is-vcentered mb-5">
<div class="column is-auto">
<h2 class="title is-4 has-text-grey-dark">
<span class="icon has-text-info mr-2"><i class="fa-solid fa-filter"></i></span>
Filtro: <code id="filter-display-name" style="color: #d63384;">(todos)</code>
</h2>
</div>
<div class="column is-narrow">
<button id="clearFilterButton" class="button is-small is-danger is-light">
<span class="icon is-small"><i class="fa-solid fa-xmark"></i></span>
<span>Limpar Tudo</span>
</button>
</div>
</div>
<div id="project-list" class="columns is-multiline">
{% for projeto in site.data.all %}
{% assign project_insts = "" %}
{% for track in projeto.tracks %}
{% if track.instruments %}
{% for inst in track.instruments %}
{% assign project_insts = project_insts | append: inst.instrument_name | append: "," %}
{% endfor %}
{% elsif track.instrument_name %}
{% assign project_insts = project_insts | append: track.instrument_name | append: "," %}
{% endif %}
{% endfor %}
<div class="column is-12-mobile is-6-tablet is-4-desktop is-3-widescreen project-item"
data-instruments="{{ project_insts }}">
<div class="card project-card" style="height: 100%; background-color: #f0f8ff; border: 1px solid #cfe8fc; border-radius: 12px; display: flex; flex-direction: column;">
{% assign file_url = projeto.file | downcase | replace: ' ', '-' | replace: 'ç', 'c' | replace: 'ã', 'a' | replace: 'á', 'a' | replace: 'â', 'a' | replace: 'é', 'e' | replace: 'ê', 'e' | replace: 'í', 'i' | replace: 'ó', 'o' | replace: 'ô', 'o' | replace: 'õ', 'o' | replace: 'ú', 'u' %}
{% assign page_url = '../mmp_pages/' | append: file_url | append: '.html' %}
<a href="{{ page_url }}" style="text-decoration: none; flex: 1; display: flex; flex-direction: column;">
<div class="card-content has-text-centered p-4" style="flex: 1; display: flex; flex-direction: column;">
<div style="width: 50px; height: 50px; background-color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.5rem auto; box-shadow: 0 2px 5px rgba(0,0,0,0.05);">
<span class="icon" style="color: #3273dc;"><i class="fa-solid fa-music fa-lg"></i></span>
</div>
<p class="title is-6 mb-2" style="color: #205081; word-break: break-word; font-weight: 700; line-height: 1.2;">
{{ projeto.file }}
</p>
{% if projeto.bpm %}
<div class="mb-3">
<span class="tag is-dark is-rounded is-light" style="font-size: 0.7rem; font-weight: bold; border: 1px solid #ccc;">
🎵 {{ projeto.bpm }} BPM
</span>
</div>
{% else %}
<div class="mb-3" style="height: 24px;"></div>
{% endif %}
<div style="flex: 1;"></div>
{% assign unique_proj_insts = project_insts | split: "," | uniq %}
{% if unique_proj_insts.size > 0 %}
<div class="tags is-centered is-gapless mb-0 mt-2" style="gap: 4px; justify-content: center;">
{% for item in unique_proj_insts %}
{% if item != "" %}
<span class="tag is-white filter-item clickable-tag" data-value="{{ item }}"
style="font-size: 0.65rem; border: 1px solid #deeaf6; color: #5b7da3; padding: 0 6px; height: 1.5em; text-decoration: none; cursor: pointer;">
{{ item | truncate: 15 }}
</span>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
</a>
<footer class="card-footer" style="border-top: 1px solid #cfe8fc; background-color: #fff; border-radius: 0 0 12px 12px; overflow: hidden;">
<a href="#" class="card-footer-item js-open-modal" data-target-url="{{ page_url }}" data-modal-title="Detalhes: {{ projeto.file }}" data-full-btn-text="Ir para Página" data-full-btn-link="{{ page_url }}" style="color: #5b7da3; font-size: 0.8rem; font-weight: 600; border-right: 1px solid #eee; transition: background 0.2s;">Ver</a>
{% assign creation_url = '/mmpSearch/creation.html?project=' | append: projeto.file %}
{% assign embed_url = creation_url | append: '&embed=true' %}
<a href="#" class="card-footer-item js-open-modal" data-target-url="{{ embed_url }}" data-modal-title="Editor: {{ projeto.file }}" data-full-btn-text="Abrir Editor" data-full-btn-link="{{ creation_url }}" style="color: #3273dc; font-size: 0.8rem; font-weight: 600;">Editar</a>
</footer>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</main>
<div id="preview-modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card" style="width: 90%; max-width: 800px;">
<header class="modal-card-head" style="background-color: #f0f8ff; border-bottom: 1px solid #cfe8fc;">
<p class="modal-card-title" id="modal-title" style="color: #205081; font-weight: bold;">Preview</p>
<button class="delete" aria-label="close"></button>
</header>
<section class="modal-card-body p-0" style="height: 500px; background-color: #fff;">
<iframe id="preview-iframe" src="" style="width: 100%; height: 100%; border: none;"></iframe>
</section>
<footer class="modal-card-foot" style="justify-content: flex-end; background-color: #fff; border-top: 1px solid #cfe8fc;">
<button class="button" id="close-modal-btn">Fechar</button>
<a href="#" id="full-edit-btn" target="_blank" class="button is-info">Abrir</a>
</footer>
</div>
</div>
<style>
.project-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(50, 115, 220, 0.15); border-color: #3273dc !important; background-color: #fff !important; }
.clickable-tag:hover { background-color: #e3effd !important; color: #3273dc !important; border-color: #3273dc !important; transform: scale(1.05); }
.tag.is-active-filter { background-color: #3273dc !important; color: #fff !important; border-color: #3273dc !important; font-weight: bold; box-shadow: 0 2px 5px rgba(50, 115, 220, 0.3); }
.collapse-card summary { list-style: none; transition: background 0.2s; }
.collapse-card summary::-webkit-details-marker { display: none; }
.collapse-card[open] summary .chevron-icon { transform: rotate(180deg); }
.chevron-icon { transition: transform 0.3s ease; }
</style>
<script>
document.addEventListener('DOMContentLoaded', function () {
const projects = document.querySelectorAll('.project-item');
const filterDisplayName = document.getElementById('filter-display-name');
const filterCounter = document.getElementById('filter-counter');
let activeFilters = [];
function applyFilters() {
if (activeFilters.length > 0) {
filterDisplayName.textContent = activeFilters.join(" + ");
filterCounter.textContent = activeFilters.length + " selecionados";
filterCounter.classList.remove('is-hidden');
} else {
filterDisplayName.textContent = "(todos)";
filterCounter.classList.add('is-hidden');
}
// Atualiza visual das tags
document.querySelectorAll('.filter-item').forEach(tag => {
const val = tag.getAttribute('data-value');
if (activeFilters.includes(val)) {
tag.classList.add('is-active-filter');
} else {
tag.classList.remove('is-active-filter');
}
});
projects.forEach(project => {
const projectInstStr = project.getAttribute('data-instruments');
// Cria array de instrumentos deste projeto
const projectInsts = projectInstStr.split(',').map(s => s.trim());
if (activeFilters.length === 0) {
project.style.display = 'block';
} else {
// Lógica OR: Se tiver pelo menos um dos instrumentos filtrados, exibe
const hasMatch = activeFilters.some(filter => projectInsts.includes(filter));
project.style.display = hasMatch ? 'block' : 'none';
}
});
const newUrl = new URL(window.location.href);
if (activeFilters.length > 0) {
newUrl.searchParams.set('instrument', activeFilters.join(','));
} else {
newUrl.searchParams.delete('instrument');
}
window.history.replaceState({}, '', newUrl);
}
function toggleFilter(val) {
const index = activeFilters.indexOf(val);
if (index > -1) activeFilters.splice(index, 1);
else activeFilters.push(val);
applyFilters();
}
// Inicializa
const urlParams = new URLSearchParams(window.location.search);
const instParam = urlParams.get('instrument');
if (instParam) {
activeFilters = instParam.split(',').map(s => s.trim()).filter(s => s !== "");
applyFilters();
}
// Eventos
document.querySelectorAll('.filter-item').forEach(tag => {
tag.addEventListener('click', function(e) {
e.preventDefault();
e.stopPropagation(); // Evita clique no card se for dentro dele
const val = this.getAttribute('data-value');
toggleFilter(val);
});
});
document.querySelector('#clearFilterButton').addEventListener('click', function () {
activeFilters = [];
applyFilters();
});
// Modal
const modal = document.getElementById('preview-modal');
const iframe = document.getElementById('preview-iframe');
const modalTitle = document.getElementById('modal-title');
const fullEditBtn = document.getElementById('full-edit-btn');
const closeButtons = document.querySelectorAll('.modal-background, .modal-card-head .delete, #close-modal-btn');
function openModal(url, title, btnText, btnLink) {
modalTitle.textContent = title;
iframe.src = url;
fullEditBtn.textContent = btnText;
fullEditBtn.href = btnLink;
modal.classList.add('is-active');
document.documentElement.classList.add('is-clipped');
}
function closeModal() {
modal.classList.remove('is-active');
document.documentElement.classList.remove('is-clipped');
iframe.src = "";
}
document.querySelectorAll('.js-open-modal').forEach(btn => {
btn.addEventListener('click', (e) => {
e.preventDefault();
openModal(btn.dataset.targetUrl, btn.dataset.modalTitle, btn.dataset.fullBtnText, btn.dataset.fullBtnLink);
});
});
iframe.addEventListener('load', () => { try {
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
const style = iframeDoc.createElement('style');
style.textContent = `.tabs, .navbar, .sidebar-wrapper, .main-header { display: none !important; } .publication { padding-top: 0 !important; } body { background-color: #fff !important; }`;
iframeDoc.head.appendChild(style);
} catch(e){} });
closeButtons.forEach(el => el.addEventListener('click', closeModal));
document.addEventListener('keydown', (e) => { if (e.key === "Escape") closeModal(); });
});
</script>

264
pages/mmp_pages.md Normal file
View File

@ -0,0 +1,264 @@
---
layout: default
title: Arquivos MMP
permalink: /mmp_pages/
---
<div class="publication">
<div class="container">
<br />
<div class="tabs is-centered is-boxed is-medium mb-6">
{% include sidebar.html %}
</div>
<div class="has-text-centered mb-6">
<h1 class="title is-3 has-text-grey-dark">📁 Projetos Disponíveis</h1>
<p class="subtitle is-6 has-text-grey">
Explore, ouça e reutilize projetos da comunidade LMMS.
</p>
<div style="width: 60px; height: 4px; background-color: #3273dc; margin: 1rem auto; border-radius: 2px;"></div>
</div>
<div class="columns is-multiline">
{% assign mmp_pages = site.pages | where_exp: "page", "page.path contains 'mmp_pages/'" | sort: "title" %}
{% for page in mmp_pages %}
{% if page.url != '/mmp_pages/' %}
<div class="column is-12-mobile is-6-tablet is-4-desktop is-3-widescreen">
<div class="card project-card"
style="height: 100%; background-color: #f0f8ff; border: 1px solid #cfe8fc; border-radius: 12px; display: flex; flex-direction: column; position: relative;">
<a href="{{ page.url | relative_url }}" style="text-decoration: none; flex: 1; display: flex; flex-direction: column;">
<div class="card-content has-text-centered p-4" style="flex: 1; display: flex; flex-direction: column;">
<div style="width: 50px; height: 50px; background-color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.5rem auto; box-shadow: 0 2px 5px rgba(0,0,0,0.05);">
<span class="icon" style="color: #3273dc;">
<i class="fa-solid fa-music fa-lg"></i>
</span>
</div>
<p class="title is-6 mb-2" style="color: #205081; word-break: break-word; font-weight: 700; line-height: 1.2;">
{{ page.title | default: page.name | replace: '.html', '' }}
</p>
{% if page.bpm %}
<div class="mb-3">
<span class="tag is-dark is-rounded is-light" style="font-size: 0.7rem; font-weight: bold; border: 1px solid #ccc;">
🎵 {{ page.bpm }} BPM
</span>
</div>
{% else %}
<div class="mb-3" style="height: 24px;"></div>
{% endif %}
<div style="flex: 1;"></div>
{% if page.tags %}
<div class="mt-auto pt-2" style="width: 100%; border-top: 1px dashed #eef6fc;">
{% for category in page.tags %}
{% assign cat_name = category[0] %}
{% assign cat_items = category[1] %}
{% assign ignore_cat = false %}
{% if cat_name == 'TAG' or cat_name == 'tag' %}{% assign ignore_cat = true %}{% endif %}
{% assign has_items = false %}
{% for item in cat_items %}{% if item != "" %}{% assign has_items = true %}{% endif %}{% endfor %}
{% if ignore_cat == false and has_items %}
<details class="category-reveal mb-1" style="width: 100%;">
<summary class="tag is-white"
style="width: 100%; justify-content: space-between; cursor: pointer; border: 1px solid #deeaf6; color: #5b7da3; padding: 2px 8px; min-height: 22px; margin-bottom: 2px;">
<div style="display: flex; align-items: center; gap: 6px;">
<span style="font-size: 0.7rem;">
{% if cat_name == 'plugin' %}🔌
{% elsif cat_name == 'sample' %}🎤
{% elsif cat_name == 'bassline' %}🎹
{% elsif cat_name == 'automation' %}🎚️
{% else %}🏷️
{% endif %}
</span>
<span style="font-weight: 700; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.5px;">
{{ cat_name }}
</span>
</div>
<span class="icon is-small" style="font-size: 0.6rem; opacity: 0.7;">
<i class="fa-solid fa-chevron-down"></i>
</span>
</summary>
<div class="tags is-centered mt-1 mb-2 px-1" style="gap: 3px;">
{% for tag in cat_items %}
{% if tag != "" %}
{% assign tag_slug = tag | replace: ' ', '+' %}
{% assign search_url = '/search/?q=' | append: tag_slug | relative_url %}
{% if cat_name == 'plugin' %}{% assign search_url = '/plugin/?plugin=' | append: tag_slug | relative_url %}{% endif %}
{% if cat_name == 'sample' %}{% assign search_url = '/sample/?sample=' | append: tag_slug | relative_url %}{% endif %}
{% if cat_name == 'bassline' %}{% assign search_url = '/bassline/?bassline=' | append: tag_slug | relative_url %}{% endif %}
{% if cat_name == 'automation' %}{% assign search_url = '/automation/?automation=' | append: tag_slug | relative_url %}{% endif %}
<a href="{{ search_url }}"
class="tag is-light is-info clickable-tag"
style="font-size: 0.6rem; height: 1.5em; border: 1px solid #cfe8fc; text-decoration: none; padding: 0 6px;">
{{ tag | truncate: 18 }}
</a>
{% endif %}
{% endfor %}
</div>
</details>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
</a>
<footer class="card-footer" style="border-top: 1px solid #cfe8fc; background-color: #fff; border-radius: 0 0 12px 12px; overflow: hidden;">
<a href="#" class="card-footer-item js-open-modal"
data-target-url="{{ page.url | relative_url }}"
data-modal-title="Detalhes: {{ page.file }}"
data-full-btn-text="Ir para Página"
data-full-btn-link="{{ page.url | relative_url }}"
style="color: #5b7da3; font-size: 0.8rem; font-weight: 600; border-right: 1px solid #eee; transition: background 0.2s;">
Ver
</a>
{% assign creation_url = '/mmpSearch/creation.html?project=' | append: page.file %}
{% assign embed_url = creation_url | append: '&embed=true' %}
<a href="#" class="card-footer-item js-open-modal"
data-target-url="{{ embed_url }}"
data-modal-title="Editor: {{ page.file }}"
data-full-btn-text="Abrir Editor"
data-full-btn-link="{{ creation_url }}"
style="color: #3273dc; font-size: 0.8rem; font-weight: 600; transition: background 0.2s;">
Editar
</a>
</footer>
</div>
</div>
{% endif %}
{% endfor %}
</div>
<br><br>
</div>
</div>
<div id="preview-modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card" style="width: 90%; max-width: 800px;">
<header class="modal-card-head" style="background-color: #f0f8ff; border-bottom: 1px solid #cfe8fc;">
<p class="modal-card-title" id="modal-title" style="color: #205081; font-weight: bold;">Preview</p>
<button class="delete" aria-label="close"></button>
</header>
<section class="modal-card-body p-0" style="height: 500px; background-color: #fff;">
<iframe id="preview-iframe" src="" style="width: 100%; height: 100%; border: none;"></iframe>
</section>
<footer class="modal-card-foot" style="justify-content: flex-end; background-color: #fff; border-top: 1px solid #cfe8fc;">
<button class="button" id="close-modal-btn">Fechar</button>
<a href="#" id="full-edit-btn" target="_blank" class="button is-info">
<span>Abrir</span>
<span class="icon is-small ml-1"><i class="fa-solid fa-up-right-from-square"></i></span>
</a>
</footer>
</div>
</div>
<style>
.project-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(50, 115, 220, 0.15);
border-color: #3273dc !important;
background-color: #fff !important;
}
.project-card:hover .title {
color: #3273dc !important;
}
.category-reveal summary {
list-style: none;
transition: all 0.2s ease;
}
.category-reveal summary::-webkit-details-marker { display: none; }
.category-reveal summary:hover {
background-color: #f8fbff;
border-color: #3273dc;
}
.category-reveal[open] summary {
background-color: #eef6fc !important;
border-color: #3273dc !important;
color: #3273dc !important;
}
.category-reveal[open] summary .fa-chevron-down { transform: rotate(180deg); }
.category-reveal summary .fa-chevron-down { transition: transform 0.2s ease; }
.clickable-tag { transition: all 0.2s ease; }
.clickable-tag:hover {
background-color: #3273dc !important;
color: #fff !important;
border-color: #3273dc !important;
transform: translateY(-1px);
}
</style>
<script>
document.addEventListener('DOMContentLoaded', () => {
const modal = document.getElementById('preview-modal');
const iframe = document.getElementById('preview-iframe');
const modalTitle = document.getElementById('modal-title');
const fullEditBtn = document.getElementById('full-edit-btn');
const closeButtons = document.querySelectorAll('.modal-background, .modal-card-head .delete, #close-modal-btn');
function openModal(url, title, btnText, btnLink) {
if(!modal) return;
modalTitle.textContent = title;
iframe.src = url;
fullEditBtn.textContent = btnText;
fullEditBtn.href = btnLink;
modal.classList.add('is-active');
document.documentElement.classList.add('is-clipped');
}
function closeModal() {
if(!modal) return;
modal.classList.remove('is-active');
document.documentElement.classList.remove('is-clipped');
iframe.src = "";
}
document.querySelectorAll('.js-open-modal').forEach(btn => {
btn.addEventListener('click', (e) => {
e.preventDefault();
const url = btn.dataset.targetUrl;
const title = btn.dataset.modalTitle;
const btnText = btn.dataset.fullBtnText;
const btnLink = btn.dataset.fullBtnLink;
openModal(url, title, btnText, btnLink);
});
});
// Tenta esconder o menu dentro do iframe para não duplicar
iframe.addEventListener('load', () => {
try {
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
const style = iframeDoc.createElement('style');
style.textContent = `
.tabs, .navbar, .sidebar-wrapper, .main-header { display: none !important; }
.publication { padding-top: 0 !important; }
body { background-color: #fff !important; }
`;
iframeDoc.head.appendChild(style);
} catch(e) { }
});
closeButtons.forEach(el => el.addEventListener('click', closeModal));
document.addEventListener('keydown', (e) => {
if (e.key === "Escape") closeModal();
});
});
</script>

574
pages/pattern.md Normal file
View File

@ -0,0 +1,574 @@
---
layout: default
title: Projetos por Pattern Rítmico
permalink: /pattern/
---
<meta charset="utf-8" />
<main class="main-content">
<div class="publication">
<div class="container">
<br />
<div class="tabs is-centered is-boxed is-medium mb-6">
{% include sidebar.html %}
</div>
<div class="columns is-centered">
<div class="column is-8">
<div
class="box has-background-white-ter has-text-centered shadow-sm"
style="border: 1px solid #cfe8fc"
>
<h2 class="title is-5 has-text-grey-dark mb-3">
<span class="icon has-text-info"
><i class="fa-solid fa-drum"></i
></span>
Busca por Pattern Rítmico
</h2>
<p class="subtitle is-7 has-text-grey mb-4">
Desenhe um ritmo (16 steps) abaixo ou clique nos patterns dos
instrumentos:
</p>
<div
id="pattern-search-box"
style="
display: flex;
gap: 6px;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 1rem;
"
>
{% for i in (0..15) %} {% assign mod = i | modulo: 4 %} {% if i >
0 and mod == 0 %}
<div style="width: 8px"></div>
{% endif %}
<div
class="search-step"
data-index="{{i}}"
title="Step {{ i | plus: 1 }}"
style="
width: 25px;
height: 45px;
background: #e8e8e8;
border: 1px solid #ccc;
border-radius: 4px;
cursor: pointer;
transition: all 0.1s;
"
></div>
{% endfor %}
</div>
<button
id="clearFilterButton"
class="button is-small is-danger is-light is-rounded"
>
<span class="icon"><i class="fa-solid fa-trash"></i></span>
<span>Limpar Desenho</span>
</button>
</div>
</div>
</div>
<div id="project-list" class="columns is-multiline">
{% for projeto in site.data.all %} {% assign project_patterns_flat = ""
| split: "," %} {% for track in projeto.tracks %} {% if
track.instruments %} {% for instrument in track.instruments %} {% if
instrument.patterns %} {% 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 %} {% unless project_patterns_flat contains chunk_string %} {%
assign project_patterns_flat = project_patterns_flat | push:
chunk_string %} {% endunless %} {% endif %} {% endfor %} {% endif %} {%
endfor %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% if
project_patterns_flat.size > 0 %} {% assign project_patterns_string =
project_patterns_flat | join: ',' %}
<div
class="column is-12-mobile is-6-tablet is-4-desktop is-3-widescreen project-item"
data-patterns="{{ project_patterns_string }}"
>
<div
class="card project-card"
style="
height: 100%;
background-color: #f0f8ff;
border: 1px solid #cfe8fc;
border-radius: 12px;
display: flex;
flex-direction: column;
"
>
{% assign file_url = projeto.file | downcase | replace: ' ', '-' |
replace: 'ç', 'c' | replace: 'ã', 'a' | replace: 'á', 'a' | replace:
'â', 'a' | replace: 'é', 'e' | replace: 'ê', 'e' | replace: 'í', 'i'
| replace: 'ó', 'o' | replace: 'ô', 'o' | replace: 'õ', 'o' |
replace: 'ú', 'u' %} {% assign page_url = '../mmp_pages/' | append:
file_url | append: '.html' %}
<a
href="{{ page_url }}"
style="text-decoration: none; display: block"
>
<div class="card-content has-text-centered p-4 pb-0">
<div
style="
width: 40px;
height: 40px;
background-color: #fff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 0.5rem auto;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
"
>
<span class="icon" style="color: #3273dc"
><i class="fa-solid fa-music"></i
></span>
</div>
<p
class="title is-6 mb-3"
style="color: #205081; word-break: break-word"
>
{{ projeto.file }}
</p>
</div>
</a>
<div class="card-content px-4 pb-4 pt-2" style="flex: 1">
<div
class="patterns-visualizer p-3"
style="
background: #fff;
border-radius: 8px;
border: 1px dashed #cfe8fc;
text-align: left;
"
>
<p
class="is-size-7 has-text-grey mb-2 filter-status-label"
style="font-weight: 600; text-align: center"
>
Patterns por Instrumento:
</p>
<div style="display: flex; flex-direction: column; gap: 8px">
{% for track in projeto.tracks %} {% if track.instruments %}
{% for instrument in track.instruments %} {% if
instrument.patterns %} {% assign inst_patterns = "" | split:
"," %} {% 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 %} {% if chunk_string != "0000" %} {% unless
inst_patterns contains chunk_string %} {% assign inst_patterns
= inst_patterns | push: chunk_string %} {% endunless %} {%
endif %} {% endif %} {% endfor %} {% endif %} {% endfor %} {%
if inst_patterns.size > 0 %}
<div
class="instrument-row"
style="
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #f5f5f5;
padding-bottom: 4px;
"
>
{% assign instrument_slug = instrument.instrument_name |
replace: ' ', '+' %}
<a
href="{{ '/instruments/?instrument=' | append: instrument_slug | relative_url }}"
class="tag is-white is-light instrument-link"
style="
font-size: 0.6rem;
color: #555;
max-width: 85px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-decoration: none;
border: 1px solid transparent;
"
title="Ver projetos com {{ instrument.instrument_name }}"
>
{{ instrument.instrument_name }}
</a>
<div style="display: flex; gap: 3px">
{% for p_str in inst_patterns %}
<div
class="pattern-mini-grid js-pattern-trigger"
data-pattern-val="{{ p_str }}"
title="Filtrar por: {{ p_str }}"
>
{% assign bits = p_str | split: '' %} {% for bit in bits
%}
<div
style="width: 4px; height: 8px; background-color: {% if bit == '1' %}#4caf50{% else %}#eee{% endif %};"
></div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
{% endif %} {% endif %} {% endfor %} {% endif %} {% endfor %}
</div>
</div>
</div>
<footer
class="card-footer"
style="
border-top: 1px solid #cfe8fc;
background-color: #fff;
border-radius: 0 0 12px 12px;
overflow: hidden;
"
>
<a
href="#"
class="card-footer-item js-open-modal"
data-target-url="{{ page_url }}"
data-modal-title="Detalhes: {{ projeto.file }}"
data-full-btn-text="Ir para Página"
data-full-btn-link="{{ page_url }}"
style="
color: #5b7da3;
font-size: 0.8rem;
font-weight: 600;
border-right: 1px solid #eee;
"
>Ver</a
>
{% assign creation_url = '/mmpSearch/creation.html?project=' |
append: projeto.file %} {% assign embed_url = creation_url |
append: '&embed=true' %}
<a
href="#"
class="card-footer-item js-open-modal"
data-target-url="{{ embed_url }}"
data-modal-title="Editor: {{ projeto.file }}"
data-full-btn-text="Abrir Editor"
data-full-btn-link="{{ creation_url }}"
style="color: #3273dc; font-size: 0.8rem; font-weight: 600"
>Editar</a
>
</footer>
</div>
</div>
{% endif %} {% endfor %}
</div>
</div>
</div>
</main>
<style>
.search-step.is-active {
background-color: #4caf50 !important;
border-color: #388e3c !important;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}
.pattern-mini-grid {
display: flex;
gap: 1px;
padding: 2px;
border: 1px solid #ddd;
border-radius: 2px;
cursor: pointer;
transition: all 0.2s ease;
background-color: #fafafa;
}
.pattern-mini-grid:hover {
transform: scale(1.2);
border-color: #3273dc;
z-index: 10;
}
.pattern-mini-grid.match-highlight {
border-color: #4caf50 !important;
background-color: #e8f5e9;
box-shadow: 0 0 0 1px #4caf50;
}
.instrument-link:hover {
background-color: #eef6fc !important;
color: #3273dc !important;
border-color: #3273dc !important;
}
</style>
<div id="preview-modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card" style="width: 90%; max-width: 800px">
<header
class="modal-card-head"
style="background-color: #f0f8ff; border-bottom: 1px solid #cfe8fc"
>
<p
class="modal-card-title"
id="modal-title"
style="color: #205081; font-weight: bold"
>
Preview
</p>
<button class="delete" aria-label="close"></button>
</header>
<section
class="modal-card-body p-0"
style="height: 500px; background-color: #fff"
>
<iframe
id="preview-iframe"
src=""
style="width: 100%; height: 100%; border: none"
></iframe>
</section>
<footer
class="modal-card-foot"
style="
justify-content: flex-end;
background-color: #fff;
border-top: 1px solid #cfe8fc;
"
>
<button class="button" id="close-modal-btn">Fechar</button>
<a href="#" id="full-edit-btn" target="_blank" class="button is-info"
>Abrir</a
>
</footer>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const projects = document.querySelectorAll(".project-item");
const clearFilterButton = document.querySelector("#clearFilterButton");
const searchSteps = document.querySelectorAll(".search-step");
let activeChunks = [];
function getChunksFromSearchBox() {
let fullPattern = "";
searchSteps.forEach(
(step) =>
(fullPattern += step.classList.contains("is-active") ? "1" : "0")
);
return fullPattern.match(/.{1,4}/g) || [];
}
function setSearchBoxFromChunks(chunks) {
let fullPattern = (chunks || []).join("").padEnd(16, "0");
const bits = fullPattern.split("");
searchSteps.forEach((step, index) => {
if (bits[index] === "1") step.classList.add("is-active");
else step.classList.remove("is-active");
});
}
// --- FUNÇÃO CRUCIAL: FILTRA PROJETOS E RESUME O CONTEÚDO INTERNO ---
function filterByPattern(chunks) {
const effectiveChunks = chunks.filter((c) => c !== "0000");
// RESET GLOBAL (Se não há filtro)
if (effectiveChunks.length === 0) {
projects.forEach((project) => {
project.style.display = "block";
// Mostra tudo dentro do card
project
.querySelectorAll(".instrument-row")
.forEach((row) => (row.style.display = "flex"));
project.querySelectorAll(".pattern-mini-grid").forEach((grid) => {
grid.style.display = "flex";
grid.classList.remove("match-highlight");
});
// Reseta label
const label = project.querySelector(".filter-status-label");
if (label) label.textContent = "Patterns por Instrumento:";
});
return;
}
// COM FILTRO ATIVO
projects.forEach((project) => {
const projectPatternsStr = project.getAttribute("data-patterns");
const projectPatterns = projectPatternsStr.split(",");
// 1. O projeto tem TODOS os patterns buscados?
const isMatch = effectiveChunks.every((chunk) =>
projectPatterns.includes(chunk)
);
if (!isMatch) {
project.style.display = "none";
} else {
project.style.display = "block";
// 2. Filtragem Interna: Mostrar apenas o que bateu
const rows = project.querySelectorAll(".instrument-row");
let matchCount = 0;
rows.forEach((row) => {
const grids = row.querySelectorAll(".pattern-mini-grid");
let rowHasVisible = false;
grids.forEach((grid) => {
const val = grid.dataset.patternVal;
// Se o pattern faz parte da busca, mostra. Se não, esconde.
if (effectiveChunks.includes(val)) {
grid.style.display = "flex";
grid.classList.add("match-highlight");
rowHasVisible = true;
} else {
grid.style.display = "none";
grid.classList.remove("match-highlight");
}
});
// Se a linha do instrumento não tem nenhum pattern visível, esconde a linha toda
row.style.display = rowHasVisible ? "flex" : "none";
if (rowHasVisible) matchCount++;
});
// Atualiza label para dar feedback
const label = project.querySelector(".filter-status-label");
if (label) label.textContent = "Patterns encontrados:";
}
});
}
function updateUrl(chunks) {
const newUrl = new URL(window.location.href);
const effectiveChunks = chunks.filter((c) => c !== "0000");
if (effectiveChunks.length > 0)
newUrl.searchParams.set("p", effectiveChunks.join(","));
else newUrl.searchParams.delete("p");
window.history.replaceState({}, "", newUrl);
}
function runFilter() {
const chunksFromBox = getChunksFromSearchBox();
activeChunks = chunksFromBox.filter((c) => c !== "0000");
filterByPattern(activeChunks);
updateUrl(activeChunks);
}
// --- TRIGGERS ---
document.querySelectorAll(".js-pattern-trigger").forEach((trigger) => {
trigger.addEventListener("click", function (e) {
e.preventDefault();
e.stopPropagation();
const pattern = this.dataset.patternVal;
let currentChunks = getChunksFromSearchBox().filter(
(c) => c !== "0000"
);
if (currentChunks.includes(pattern))
currentChunks = currentChunks.filter((c) => c !== pattern);
else {
if (currentChunks.length < 4) currentChunks.push(pattern);
}
activeChunks = currentChunks;
setSearchBoxFromChunks(activeChunks);
filterByPattern(activeChunks);
updateUrl(activeChunks);
});
});
searchSteps.forEach((step) => {
step.addEventListener("click", function () {
step.classList.toggle("is-active");
runFilter();
});
});
clearFilterButton.addEventListener("click", function () {
activeChunks = [];
setSearchBoxFromChunks([]);
filterByPattern([]);
updateUrl([]);
});
const urlParams = new URLSearchParams(window.location.search);
let patternFromUrl = urlParams.get("p");
if (patternFromUrl) {
activeChunks = patternFromUrl.split(",");
setSearchBoxFromChunks(activeChunks);
filterByPattern(activeChunks);
}
// Modal logic (igual)
const modal = document.getElementById("preview-modal");
const iframe = document.getElementById("preview-iframe");
const modalTitle = document.getElementById("modal-title");
const fullEditBtn = document.getElementById("full-edit-btn");
const closeButtons = document.querySelectorAll(
".modal-background, .modal-card-head .delete, #close-modal-btn"
);
function openModal(url, title, btnText, btnLink) {
if (!modal) return;
modalTitle.textContent = title;
iframe.src = url;
fullEditBtn.textContent = btnText;
fullEditBtn.href = btnLink;
modal.classList.add("is-active");
document.documentElement.classList.add("is-clipped");
}
function closeModal() {
modal.classList.remove("is-active");
document.documentElement.classList.remove("is-clipped");
iframe.src = "";
}
document.querySelectorAll(".js-open-modal").forEach((btn) => {
btn.addEventListener("click", (e) => {
e.preventDefault();
openModal(
btn.dataset.targetUrl,
btn.dataset.modalTitle,
btn.dataset.fullBtnText,
btn.dataset.fullBtnLink
);
});
});
iframe.addEventListener("load", () => {
try {
const iframeDoc =
iframe.contentDocument || iframe.contentWindow.document;
const style = iframeDoc.createElement("style");
style.textContent = `.tabs, .navbar, .sidebar-wrapper, .main-header { display: none !important; } .publication { padding-top: 0 !important; } body { background-color: #fff !important; }`;
iframeDoc.head.appendChild(style);
} catch (e) {}
});
closeButtons.forEach((el) => el.addEventListener("click", closeModal));
document.addEventListener("keydown", (e) => {
if (e.key === "Escape") closeModal();
});
});
</script>

504
pages/plugin.md Normal file
View File

@ -0,0 +1,504 @@
---
layout: default
title: Projetos com a tag Plugin
permalink: /plugin/
---
<meta charset="utf-8" />
<main class="main-content">
<div class="publication">
<div class="container">
<br />
<div class="tabs is-centered is-boxed is-medium mb-6">
{% include sidebar.html %}
</div>
<details
class="box mb-5 p-0 collapse-card"
open
style="
border: 1px solid #cfe8fc;
overflow: hidden;
background-color: #fff;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
height: fit-content !important;
min-height: unset;
"
>
<summary
class="p-4 is-flex is-justify-content-space-between is-align-items-center"
style="cursor: pointer; background-color: #f8fbff; user-select: none"
>
<div class="is-flex is-align-items-center">
<span class="icon has-text-info mr-2"
><i class="fa-solid fa-list"></i
></span>
<span class="has-text-grey-dark has-text-weight-bold"
>Todos os Plugins Disponíveis</span
>
<span
id="filter-counter"
class="tag is-info is-light ml-3 is-hidden"
>0 selecionados</span
>
</div>
<span class="icon has-text-grey-light chevron-icon"
><i class="fa-solid fa-chevron-down"></i
></span>
</summary>
<div
class="p-4"
style="background-color: #fff; border-top: 1px solid #cfe8fc"
>
<div class="tags is-centered are-medium mb-0">
{% assign all_items_string = "" %} {% for p in site.data.all %} {%
if p.tags.plugin %} {% for item in p.tags.plugin %} {% if item != ""
%} {% unless all_items_string contains item %} {% assign
all_items_string = all_items_string | append: item | append: "|||"
%} {% endunless %} {% endif %} {% endfor %} {% endif %} {% endfor %}
{% assign unique_items = all_items_string | split: "|||" | sort %}
{% for item in unique_items %} {% if item != "" %}
<a
href="#"
class="tag is-white plugin-filter-item clickable-tag"
data-value="{{ item }}"
style="
border: 1px solid #deeaf6;
color: #5b7da3;
margin-bottom: 0.5rem;
transition: all 0.2s;
"
>
{{ item }}
</a>
{% endif %} {% endfor %}
</div>
</div>
</details>
<div class="columns is-mobile is-vcentered mb-5">
<div class="column is-auto">
<h2 class="title is-4 has-text-grey-dark">
<span class="icon has-text-info mr-2"
><i class="fa-solid fa-filter"></i
></span>
Filtro:
<code id="filter-display-name" style="color: #d63384">(todos)</code>
</h2>
</div>
<div class="column is-narrow">
<button
id="clearFilterButton"
class="button is-small is-danger is-light"
>
<span class="icon is-small"><i class="fa-solid fa-xmark"></i></span>
<span>Limpar Tudo</span>
</button>
</div>
</div>
<div id="project-list" class="columns is-multiline">
{% for projeto in site.data.all %} {% if projeto.tags.TAG contains
"plugin" %}
<div
class="column is-12-mobile is-6-tablet is-4-desktop is-3-widescreen project-item"
data-plugins="{{ projeto.tags.plugin | join: ',' }}"
>
<div
class="card project-card"
style="
height: 100%;
background-color: #f0f8ff;
border: 1px solid #cfe8fc;
border-radius: 12px;
display: flex;
flex-direction: column;
position: relative;
"
>
{% assign file_url = projeto.file | downcase | replace: ' ', '-' |
replace: 'ç', 'c' | replace: 'ã', 'a' | replace: 'á', 'a' | replace:
'â', 'a' | replace: 'é', 'e' | replace: 'ê', 'e' | replace: 'í', 'i'
| replace: 'ó', 'o' | replace: 'ô', 'o' | replace: 'õ', 'o' |
replace: 'ú', 'u' %} {% assign page_url = '../mmp_pages/' | append:
file_url | append: '.html' %}
<a
href="{{ page_url }}"
style="
text-decoration: none;
flex: 1;
display: flex;
flex-direction: column;
"
>
<div
class="card-content has-text-centered p-4"
style="flex: 1; display: flex; flex-direction: column"
>
<div
style="
width: 50px;
height: 50px;
background-color: #fff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 0.5rem auto;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
"
>
<span class="icon" style="color: #3273dc"
><i class="fa-solid fa-music fa-lg"></i
></span>
</div>
<p
class="title is-6 mb-2"
style="
color: #205081;
word-break: break-word;
font-weight: 700;
line-height: 1.2;
"
>
{{ projeto.file }}
</p>
{% if projeto.bpm %}
<div class="mb-3">
<span
class="tag is-dark is-rounded is-light"
style="
font-size: 0.7rem;
font-weight: bold;
border: 1px solid #ccc;
"
>
🎵 {{ projeto.bpm }} BPM
</span>
</div>
{% else %}
<div class="mb-3" style="height: 24px"></div>
{% endif %}
<div style="flex: 1"></div>
{% if projeto.tags.plugin and projeto.tags.plugin.size > 0 %}
<div
class="tags is-centered is-gapless mb-0 mt-2"
style="gap: 4px; justify-content: center"
>
{% for item in projeto.tags.plugin %} {% if item != "" %}
<span
class="tag is-white project-tag-item clickable-tag"
data-value="{{ item }}"
style="
font-size: 0.65rem;
border: 1px solid #deeaf6;
color: #5b7da3;
padding: 0 6px;
height: 1.5em;
text-decoration: none;
cursor: pointer;
"
>
{{ item | truncate: 15 }}
</span>
{% endif %} {% endfor %}
</div>
{% endif %}
</div>
</a>
<footer
class="card-footer"
style="
border-top: 1px solid #cfe8fc;
background-color: #fff;
border-radius: 0 0 12px 12px;
overflow: hidden;
"
>
<a
href="#"
class="card-footer-item js-open-modal"
data-target-url="{{ page_url }}"
data-modal-title="Detalhes: {{ projeto.file }}"
data-full-btn-text="Ir para Página"
data-full-btn-link="{{ page_url }}"
style="
color: #5b7da3;
font-size: 0.8rem;
font-weight: 600;
border-right: 1px solid #eee;
transition: background 0.2s;
"
>Ver</a
>
{% assign creation_url = '/mmpSearch/creation.html?project=' |
append: projeto.file %} {% assign embed_url = creation_url |
append: '&embed=true' %}
<a
href="#"
class="card-footer-item js-open-modal"
data-target-url="{{ embed_url }}"
data-modal-title="Editor: {{ projeto.file }}"
data-full-btn-text="Abrir Editor"
data-full-btn-link="{{ creation_url }}"
style="color: #3273dc; font-size: 0.8rem; font-weight: 600"
>Editar</a
>
</footer>
</div>
</div>
{% endif %} {% endfor %}
</div>
</div>
</div>
</main>
<div id="preview-modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card" style="width: 90%; max-width: 800px">
<header
class="modal-card-head"
style="background-color: #f0f8ff; border-bottom: 1px solid #cfe8fc"
>
<p
class="modal-card-title"
id="modal-title"
style="color: #205081; font-weight: bold"
>
Preview
</p>
<button class="delete" aria-label="close"></button>
</header>
<section
class="modal-card-body p-0"
style="height: 500px; background-color: #fff"
>
<iframe
id="preview-iframe"
src=""
style="width: 100%; height: 100%; border: none"
></iframe>
</section>
<footer
class="modal-card-foot"
style="
justify-content: flex-end;
background-color: #fff;
border-top: 1px solid #cfe8fc;
"
>
<button class="button" id="close-modal-btn">Fechar</button>
<a href="#" id="full-edit-btn" target="_blank" class="button is-info"
>Abrir</a
>
</footer>
</div>
</div>
<style>
.project-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(50, 115, 220, 0.15);
border-color: #3273dc !important;
background-color: #fff !important;
}
/* Tag normal */
.clickable-tag:hover {
background-color: #e3effd !important;
color: #3273dc !important;
border-color: #3273dc !important;
transform: scale(1.05);
}
/* Tag ATIVA (Selecionada) */
.tag.is-active-filter {
background-color: #3273dc !important;
color: #fff !important;
border-color: #3273dc !important;
font-weight: bold;
box-shadow: 0 2px 5px rgba(50, 115, 220, 0.3);
}
/* Animação do Accordion */
.collapse-card summary {
list-style: none;
transition: background 0.2s;
}
.collapse-card summary::-webkit-details-marker {
display: none;
}
.collapse-card[open] summary .chevron-icon {
transform: rotate(180deg);
}
.chevron-icon {
transition: transform 0.3s ease;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function () {
const projects = document.querySelectorAll(".project-item");
const filterDisplayName = document.getElementById("filter-display-name");
const filterCounter = document.getElementById("filter-counter");
// --- ESTADO GLOBAL DOS FILTROS ---
let activeFilters = []; // Array de strings
// --- FUNÇÃO PRINCIPAL DE FILTRAGEM ---
function applyFilters() {
// 1. Atualiza Texto do Título
if (activeFilters.length > 0) {
filterDisplayName.textContent = activeFilters.join(" + ");
filterCounter.textContent = activeFilters.length + " selecionados";
filterCounter.classList.remove("is-hidden");
} else {
filterDisplayName.textContent = "(todos)";
filterCounter.classList.add("is-hidden");
}
// 2. Atualiza visual das Tags (Nuvem e Cards)
document.querySelectorAll("[data-value]").forEach((tag) => {
const val = tag.getAttribute("data-value");
if (activeFilters.includes(val)) {
tag.classList.add("is-active-filter");
} else {
tag.classList.remove("is-active-filter");
}
});
// 3. Mostra/Esconde Projetos
projects.forEach((project) => {
const projectPluginsStr = project.getAttribute("data-plugins");
const projectPlugins = projectPluginsStr
.split(",")
.map((s) => s.trim());
if (activeFilters.length === 0) {
// Sem filtro: mostra tudo
project.style.display = "block";
} else {
// Com filtro: Lógica "OU" (Mostra se tiver pelo menos UM dos selecionados)
// Se quiser lógica "E" (tem que ter TODOS), troque .some() por .every()
const hasMatch = activeFilters.some((filter) =>
projectPlugins.includes(filter)
);
project.style.display = hasMatch ? "block" : "none";
}
});
// 4. Atualiza URL
const newUrl = new URL(window.location.href);
if (activeFilters.length > 0) {
newUrl.searchParams.set("plugin", activeFilters.join(","));
} else {
newUrl.searchParams.delete("plugin");
}
window.history.replaceState({}, "", newUrl);
}
// --- GERENCIADOR DE CLIQUES (TOGGLE) ---
function toggleFilter(val) {
const index = activeFilters.indexOf(val);
if (index > -1) {
activeFilters.splice(index, 1); // Remove se já existe
} else {
activeFilters.push(val); // Adiciona se não existe
}
applyFilters();
}
// --- INICIALIZAÇÃO ---
// 1. Lê URL ao carregar
const urlParams = new URLSearchParams(window.location.search);
const pluginParam = urlParams.get("plugin");
if (pluginParam) {
// Suporta ?plugin=a,b,c
activeFilters = pluginParam
.split(",")
.map((s) => s.trim())
.filter((s) => s !== "");
applyFilters();
}
// 2. Eventos de Clique (Nuvem e Cards)
// Usamos event delegation ou selecionamos todos
const allClickableTags = document.querySelectorAll(
".plugin-filter-item, .project-tag-item"
);
allClickableTags.forEach((tag) => {
tag.addEventListener("click", function (e) {
e.preventDefault();
const val = this.getAttribute("data-value");
toggleFilter(val);
});
});
// 3. Botão Limpar
document
.querySelector("#clearFilterButton")
.addEventListener("click", function () {
activeFilters = [];
applyFilters();
});
// --- MODAL (Padrão) ---
const modal = document.getElementById("preview-modal");
const iframe = document.getElementById("preview-iframe");
const modalTitle = document.getElementById("modal-title");
const fullEditBtn = document.getElementById("full-edit-btn");
const closeButtons = document.querySelectorAll(
".modal-background, .modal-card-head .delete, #close-modal-btn"
);
function openModal(url, title, btnText, btnLink) {
modalTitle.textContent = title;
iframe.src = url;
fullEditBtn.textContent = btnText;
fullEditBtn.href = btnLink;
modal.classList.add("is-active");
document.documentElement.classList.add("is-clipped");
}
function closeModal() {
modal.classList.remove("is-active");
document.documentElement.classList.remove("is-clipped");
iframe.src = "";
}
document.querySelectorAll(".js-open-modal").forEach((btn) => {
btn.addEventListener("click", (e) => {
e.preventDefault();
openModal(
btn.dataset.targetUrl,
btn.dataset.modalTitle,
btn.dataset.fullBtnText,
btn.dataset.fullBtnLink
);
});
});
iframe.addEventListener("load", () => {
try {
const iframeDoc =
iframe.contentDocument || iframe.contentWindow.document;
const style = iframeDoc.createElement("style");
style.textContent = `.tabs, .navbar, .sidebar-wrapper, .main-header { display: none !important; } .publication { padding-top: 0 !important; } body { background-color: #fff !important; }`;
iframeDoc.head.appendChild(style);
} catch (e) {}
});
closeButtons.forEach((el) => el.addEventListener("click", closeModal));
document.addEventListener("keydown", (e) => {
if (e.key === "Escape") closeModal();
});
});
</script>

57
pages/projetosPorTrack.md Normal file
View File

@ -0,0 +1,57 @@
---
layout: default
title: Projetos por tipo de track
permalink: /projetosPorTrack/
---
<meta charset="utf-8">
<main class="main-content">
<div class="publication">
<div class="container">
<br>
<div class="tabs is-centered is-boxed is-medium mb-6">
{% include sidebar.html %}
</div>
<div class="columns">
<div class="column is-8 is-offset-2">
<div class="box has-text-centered has-background-white-ter">
<h2 class="title is-4 mb-5">Navegar por Categorias</h2>
<a href="{{ '/instruments/' | relative_url }}" class="button is-link is-outlined is-medium mb-5">
<span class="icon"><i class="fa-solid fa-guitar"></i></span>
<span>BUSCAR POR INSTRUMENTO</span>
</a>
<div class="divider"></div>
<a href="{{ '/pattern/' | relative_url }}" class="button is-link is-outlined is-medium mb-5">
<span class="icon"><i class="fa-solid fa-guitar"></i></span>
<span>BUSCAR POR DESENHO DE PATTERN</span>
</a>
<div class="divider">OU POR TIPO DE TRACK</div>
<div class="tags is-centered are-medium mt-4">
{% assign tags_exibidas = "" %}
{% for item in site.data.all %}
{% for tag in item.tags.TAG %}
{% unless tags_exibidas contains tag %}
{% capture tags_exibidas %}{{ tags_exibidas }},{{ tag }}{% endcapture %}
<a href="../{{ tag | downcase | replace: ' ', '-' }}" class="tag is-white project-card"
style="border: 1px solid #cfe8fc; color: #205081; padding: 1.5rem 1rem;">
{{ tag | upcase }}
</a>
{% endunless %}
{% endfor %}
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
</main>

39
pages/quantasVezes.md Normal file
View File

@ -0,0 +1,39 @@
---
layout: default
title: Quantidade de Repetições de Instrumentos
permalink: /quantasVezesAparecemInstrumentos/
---
<main class="main-content">
<div class="publication">
{% include sidebar.html %}
</div>
<div class="container">
<h2>Quantidade de vezes que cada instrumento é utilizado:</h2>
<ul id="instrument-list">
{% for item in site.data.processed_data %}
<li data-count="{{ item.count }}">{{ item.instrument_name }}: {{ item.count }}</li>
{% endfor %}
</ul>
</div>
</main>
<script>
// Ordenação dos itens em ordem decrescente por contagem
document.addEventListener("DOMContentLoaded", function() {
var instrumentList = document.getElementById('instrument-list');
var items = Array.from(instrumentList.children);
items.sort(function(a, b) {
var countA = parseInt(a.getAttribute('data-count'));
var countB = parseInt(b.getAttribute('data-count'));
return countB - countA; // Ordenação decrescente
});
instrumentList.innerHTML = '';
items.forEach(function(item) {
instrumentList.appendChild(item);
});
});
</script>

127
pages/sample.md Normal file
View File

@ -0,0 +1,127 @@
---
layout: default
title: Projetos com a tag Sample
permalink: /sample/
---
<meta charset="utf-8">
<main class="main-content">
<div class="publication">
<div class="tabs is-centered is-boxed is-medium mb-6">
{% include sidebar.html %}
</div>
<div class="container">
<div class="columns is-mobile is-vcentered" style="margin-bottom: 2rem;">
<!-- Título -->
<div class="column is-auto">
<h2 class="title is-4"><code>Projetos que possuem a tag sample:</code></h2>
</div>
<!-- Botão Limpar Filtro -->
<div class="column is-auto">
<button id="clearFilterButton" class="button is-small is-light">
Limpar filtro
</button>
</div>
</div>
<!-- Projetos -->
<div id="project-list" class="columns is-multiline">
{% for projeto in site.data.all %}
{% if projeto.tags.TAG contains "sample" %}
<div class="column is-6 project-item" data-sample="{{ projeto.tags.sample | join: ',' }}">
<div class="box">
<!-- Botão do projeto -->
{% assign file_url = projeto.file | downcase
| replace: ' ', '-'
| replace: 'ç', 'c'
| replace: 'ã', 'a'
| replace: 'á', 'a'
| replace: 'â', 'a'
| replace: 'é', 'e'
| replace: 'ê', 'e'
| replace: 'í', 'i'
| replace: 'ó', 'o'
| replace: 'ô', 'o'
| replace: 'õ', 'o'
| replace: 'ú', 'u' %}
<a href="../mmp_pages/{{ file_url }}.html" class="button is-link is-fullwidth">
{{ projeto.file }}
</a>
<!-- Lista de samples clicáveis -->
{% if projeto.tags.sample and projeto.tags.sample.size > 0 %}
<div style="margin-top: 1rem;">
<p><strong>Sample:</strong></p>
<ul style="list-style-type: disc; padding-left: 1.25rem;">
{% for sample in projeto.tags.sample %}
{% if sample != "" %}
<li><a href="#" class="sample-item" data-sample="{{ sample }}">{{ sample }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</main>
<script>
document.addEventListener('DOMContentLoaded', function () {
const projects = document.querySelectorAll('.project-item');
// Função para aplicar filtro por sample
function filterBySample(sampleName) {
projects.forEach(project => {
const projectSample = project.getAttribute('data-sample').split(',');
if (projectSample.includes(sampleName)) {
project.style.display = 'block';
} else {
project.style.display = 'none';
}
});
}
// Lê o sample da URL se houver
const urlParams = new URLSearchParams(window.location.search);
const sampleFromUrl = urlParams.get('sample');
if (sampleFromUrl) {
filterBySample(sampleFromUrl);
}
// Ao clicar num sample na lista
const sampleItems = document.querySelectorAll('.sample-item');
sampleItems.forEach(item => {
item.addEventListener('click', function (event) {
event.preventDefault();
const selectedSample = item.getAttribute('data-sample');
filterBySample(selectedSample);
// Atualiza a URL sem recarregar a página
const newUrl = new URL(window.location.href);
newUrl.searchParams.set('sample', selectedSample);
window.history.replaceState({}, '', newUrl);
});
});
// Botão para limpar filtro
const clearFilterButton = document.querySelector('#clearFilterButton');
clearFilterButton.addEventListener('click', function () {
projects.forEach(project => {
project.style.display = 'block';
});
// Remove o filtro da URL
const newUrl = new URL(window.location.href);
newUrl.searchParams.delete('sample');
window.history.replaceState({}, '', newUrl);
});
});
</script>

132
pages/wavFiles.md Normal file
View File

@ -0,0 +1,132 @@
---
layout: default
title: Beats Disponíveis
permalink: /beats/
---
<main class="main-content">
<div class="publication">
<div class="tabs is-centered is-boxed is-medium mb-6">
{% include sidebar.html %}
</div>
<div class="container">
<br>
<h2 class="title is-4 mb-5"><code>🎧 Lista de Beats 🎧</code></h2>
<p>Aqui estão os beats disponíveis.
<br>Clique em um beat para ouvi-lo.</p>
<!-- Lista de Beats -->
<div class="beat-list">
{% assign files = site.static_files %}
{% for file in files %}
{% if file.path contains '/wav/' %}
<div class="beat-item box">
{% assign project_url = "" %}
<!-- Aqui, tentamos encontrar o projeto correspondente com base no nome do arquivo -->
{% assign file_name_without_extension = file.name | remove: '.wav' %}
{% for projeto in site.data.all %}
{% if projeto.file == file_name_without_extension %}
{% assign project_url = "/mmp_pages/"
| append: projeto.file
| downcase
| replace: ' ', '-'
| replace: ' ', '-'
| replace: 'ç', 'c'
| replace: 'ã', 'a'
| replace: 'á', 'a'
| replace: 'â', 'a'
| replace: 'é', 'e'
| replace: 'ê', 'e'
| replace: 'í', 'i'
| replace: 'ó', 'o'
| replace: 'ô', 'o'
| replace: 'õ', 'o'
| replace: 'ú', 'u'
| append: ".html" %}
{% endif %}
{% endfor %}
<p class="beat-name">
{% if project_url %}
<!-- Link para o projeto que originou o arquivo .wav -->
<a href="{{ project_url | relative_url }}" class="project-link">
<code>{{ file.name | replace: '.wav', '' }}</code>
</a>
{% else %}
<!-- Se não encontrar um projeto relacionado, exibe o nome do arquivo -->
{{ file.name | replace: '.wav', '' }}
{% endif %}
</p>
<audio class="audio-player" controls>
<source src="{{ file.path | relative_url }}" type="audio/wav">
Seu navegador não suporta o elemento de áudio.
</audio>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</main>
<style>
.beat-list {
display: flex;
flex-wrap: wrap;
gap: 1rem;
margin-top: 2rem;
}
.beat-item {
background-color: #f9f9f9;
padding: 0.2rem; /* Reduzido o padding para diminuir a altura */
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 250px;
text-align: center;
max-height: 25px; /* Define a altura máxima das divs */
overflow: hidden; /* Garante que conteúdo extra não sobrecarregue a div */
}
.beat-name {
font-size: 0.9rem;
font-weight: bold;
margin-bottom: 0.2rem;
text-overflow: ellipsis; /* Adiciona '...' se o texto for muito grande */
white-space: nowrap; /* Garante que o texto não quebre e adicione '...' */
overflow: hidden; /* Garante que o nome do arquivo longo seja cortado com '...' */
}
.audio-player {
width: 100%;
margin-top: 0.5rem;
}
.project-link {
text-decoration: none;
color: #3273dc;
}
.project-link:hover {
text-decoration: underline;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
const audioPlayers = document.querySelectorAll('.audio-player');
audioPlayers.forEach(audio => {
audio.addEventListener('play', function() {
audioPlayers.forEach(otherAudio => {
if (otherAudio !== audio && !otherAudio.paused) {
otherAudio.pause();
}
});
});
});
});
</script>