Closed cristianofigo closed 1 year ago
because you are comparing strings like numbers.
Thanks @dirkk0, i've managed to transform the string in a array and choose only the bars that i wanted like this:
clock_global = Tone.Transport.position;
myArray = clock_global.split(":");
let bar = myArray[0];
if (bar > 0 && bar < 1 ) {
console.log("compasso 1");
}
if (bar > 3 && bar < 6) {
console.log("compasso 2");
}
if (bar > 10 && bar < 12) {
console.log("compasso 3");
}
Hello, i'm Trying to schedule some events with Tone.Transport.position and it works, but with some mistakes. My sample code:
The problem is that after "clock_global" crosses "40:0:0" it starts to trigger "compasso 2" in the console, i'm missing something here. My live example is in: https://github.com/cristianofigo/MusicaMovel_waveform_template Thank you!