Correct way to play sequence of notes
See original GitHub issueI have a sequence of notes with delay data.
I trigger this sequence of notes using noteOn function and I loop function noteOn for number of notes.
Manytimes, result is not good and notes do not play as they come in sequence. Some ending notes and some starting notes start playing together when loop is started, because of this result is not good for few seconds in the starting.
Can anybody guide what is correct way to play sequence of notes
Here is code sample
var notes = [67, 78, 67 ,67,90, 56,..,...,....]
var delay = [.........]
for(var i=0; l < notes.length; i++)
{
MIDI.noteOn(channel, notes[i], velocity, delay[i]);
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Sequence Numbers – Game Instructions - JAX Games
PLAY : Beginning with the player to the left of the dealer and moving in a clockwise direction, he/she selects a card of...
Read more >SEQUENCE NUMBERS · GAME INSTRUCTIONS
The dealer should shuffle the cards and deal out the same number of cards to each player (see below for proper number of...
Read more >javascript - AudioContext how to play the notes in a sequence
This way you can control start time and end time for each note in the sequence. var context = new AudioContext(); var notes...
Read more >Sequence (music) - Wikipedia
For the means of triggering musical notes, see Music sequencer. In music, a sequence is the restatement of a motif or longer melodic...
Read more >Beginning Melodic Sequences | StudyBass
To play a melodic sequence you take a short melodic phrase and play it off of each note of a scale or chord...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

How is delay determined?
I’ve found that if delay is replaced with i or
i + MIDI.getContext().currentTime, that will cause the notes to play in sequenceThanks @DoomTay , your solutions works. Here is how I have implemented it.
@rbdedu hope this helps you too.