Arrumando barra de navegação das patterns
This commit is contained in:
1 parent
e10621da17
commit
39a955fbc6
2 files changed
+29
-30
No files matched your search
@@ -67,14 +67,9 @@ export async function parseMmpContent(xmlString) {
|
||||
const totalSteps = getTotalSteps();
|
||||
const newSteps = new Array(totalSteps).fill(false);
|
||||
|
||||
// ==================================================================
|
||||
// (CORREÇÃO DEFINITIVA)
|
||||
// 1. Simplificamos o cálculo: cada step de 1/16 vale 12 ticks.
|
||||
const ticksPerStep = 12;
|
||||
|
||||
// 2. Buscamos TODAS as notas da trilha, não importa em qual pattern elas estejam.
|
||||
trackNode.querySelectorAll("note").forEach((noteNode) => {
|
||||
// ==================================================================
|
||||
const pos = parseInt(noteNode.getAttribute("pos"), 10);
|
||||
const stepIndex = Math.round(pos / ticksPerStep);
|
||||
if (stepIndex < totalSteps) {
|
||||
@@ -205,21 +200,11 @@ function modifyAndSaveExistingMmp() {
|
||||
function createTrackXml(track) {
|
||||
if (!track.samplePath) return "";
|
||||
const totalSteps = track.steps.length || getTotalSteps();
|
||||
const ticksPerStep = 12; // Valor fixo de 12 ticks por step de 1/16
|
||||
const ticksPerStep = 12;
|
||||
const lmmsVolume = Math.round(track.volume * 100);
|
||||
const lmmsPan = Math.round(track.pan * 100);
|
||||
const sampleSrc = track.samplePath.replace("src/samples/", "");
|
||||
const notesXml = track.steps
|
||||
.map((isActive, index) => {
|
||||
if (isActive) {
|
||||
const notePos = Math.round(index * ticksPerStep);
|
||||
return `<note vol="100" len="${NOTE_LENGTH}" pos="${notePos}" pan="0" key="57"/>`;
|
||||
}
|
||||
return "";
|
||||
})
|
||||
.join("\n ");
|
||||
|
||||
// Cria um pattern para cada compasso (16 steps)
|
||||
let patternsXml = '';
|
||||
const stepsPerBar = 16;
|
||||
const numBars = Math.ceil(totalSteps / stepsPerBar);
|
||||
|
||||
Reference in new issue
Block a user