You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is it impossible to pause when using noteon noteoff instead of player #252
Your question doesn't make any sense. If you are using noteon/noteoff then you are responsible for timing, so you can pause in your code.
Thanks for your reply,I didn't describe it clearly
I add two buttons in my page, play and pause, when click play button ,I put some notes to a notearray, and use noteon/noteoff to play sounds in circle, and when click pause button, I don't know how to pause these sound
Below is logic in play button: var song = Util.convertToMidiPianoFormat(that.beatArray,that.selectedKey);
var delay = 0;
var velocity = 10; // how hard the note hits
for(let i in song){
MIDI.noteOn(0, song[i][0], velocity, delay);
delay = delay + song[i][1];
MIDI.noteOff(0, song[i][0], delay);
}
Activity
hmoffatt commentedon Mar 27, 2020
Your question doesn't make any sense. If you are using noteon/noteoff then you are responsible for timing, so you can pause in your code.
ysfgmissbless commentedon Mar 27, 2020
Thanks for your reply,I didn't describe it clearly
I add two buttons in my page, play and pause, when click play button ,I put some notes to a notearray, and use noteon/noteoff to play sounds in circle, and when click pause button, I don't know how to pause these sound
Below is logic in play button:
var song = Util.convertToMidiPianoFormat(that.beatArray,that.selectedKey);
var delay = 0;
var velocity = 10; // how hard the note hits
for(let i in song){
MIDI.noteOn(0, song[i][0], velocity, delay);
delay = delay + song[i][1];
MIDI.noteOff(0, song[i][0], delay);
}
shivrajsa commentedon Jun 22, 2021
@ysfgmissbless You may try this ugly solution :-). Call this function on click of pause button. If required you can increase the maximum loop value.