melhorando a leitura de projetos no mmpCreator
Deploy / Deploy (push) Successful in 2m3s Details

This commit is contained in:
JotaChina 2025-12-25 16:07:32 -03:00
parent 4d2468b12d
commit acfebc8f8b
1 changed files with 3 additions and 15 deletions

View File

@ -591,23 +591,11 @@ export function startSongPatternPlaybackOnTransport() {
if (patt.steps[hit.localStep]) {
// SAMPLER
if (track.type === "sampler" && track.player) {
// Tone.Player é monofônico por padrão; sem retrigger, hits rápidos "morrem".
if ("retrigger" in track.player) track.player.retrigger = true;
track.player.restart = true; // baterias precisam retrigger
try {
// preferível: restart() (método) retrigga sem depender do estado atual
if (typeof track.player.restart === "function") {
track.player.restart(time);
} else {
track.player.start(time);
} catch {}
}
} catch (e) {
// fallback (p/ versões diferentes do Tone)
try { track.player.stop(time); } catch {}
try { track.player.start(time); } catch {}
}
}
// PLUGIN (step sem piano roll)
else if (track.type === "plugin" && track.instrument) {
const hasNotes = patt.notes && patt.notes.length > 0;