melhorando a leitura de projetos no mmpCreator
This commit is contained in:
1 parent
b1efb7d51c
commit
4f2d1410e0
1 file changed
+4
-2
@@ -977,6 +977,8 @@ async function handleActionBroadcast(action) {
|
||||
});
|
||||
|
||||
try {
|
||||
const stepsPerBar = 16; // 4/4 em 1/16
|
||||
|
||||
const maxSteps = appState.pattern.tracks
|
||||
.filter(t => t.type !== "bassline")
|
||||
.map(t => t.patterns?.[patternIndex]?.steps?.length || 0)
|
||||
@@ -984,11 +986,11 @@ async function handleActionBroadcast(action) {
|
||||
|
||||
const barsEl = document.getElementById("bars-input");
|
||||
if (barsEl && maxSteps > 0) {
|
||||
// assumindo 16 steps por compasso (4/4 em 1/16)
|
||||
barsEl.value = Math.max(1, Math.ceil(maxSteps / 16));
|
||||
barsEl.value = Math.max(1, Math.ceil(maxSteps / stepsPerBar));
|
||||
}
|
||||
} catch {}
|
||||
|
||||
|
||||
// Mostra o toast (só uma vez)
|
||||
if (!isFromSelf) {
|
||||
const who = actorOf(action);
|
||||
|
||||
Reference in new issue
Block a user