melhorando a leitura de projetos no mmpCreator
This commit is contained in:
1 parent
4f2d1410e0
commit
2ff26bc493
1 file changed
+2
-14
@@ -591,23 +591,11 @@ export function startSongPatternPlaybackOnTransport() {
|
|||||||
if (patt.steps[hit.localStep]) {
|
if (patt.steps[hit.localStep]) {
|
||||||
// SAMPLER
|
// SAMPLER
|
||||||
if (track.type === "sampler" && track.player) {
|
if (track.type === "sampler" && track.player) {
|
||||||
// Tone.Player é monofônico por padrão; sem retrigger, hits rápidos "morrem".
|
track.player.restart = true; // baterias precisam retrigger
|
||||||
if ("retrigger" in track.player) track.player.retrigger = true;
|
|
||||||
|
|
||||||
try {
|
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);
|
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)
|
// PLUGIN (step sem piano roll)
|
||||||
else if (track.type === "plugin" && track.instrument) {
|
else if (track.type === "plugin" && track.instrument) {
|
||||||
const hasNotes = patt.notes && patt.notes.length > 0;
|
const hasNotes = patt.notes && patt.notes.length > 0;
|
||||||
|
|||||||
Reference in new issue
Block a user