Incorporating MIDI.js into my current project to play a sequence of MIDI notes. See below for the code snippet:
for (var repeat = 0; repeat < melodyrepititions; repeat++)
{
for (var i = 0; i < composition.length; i++)
{
for (var j = 0; j < composition[i].length; j++)
{
if (composition[i][j] != 0)
{
MIDI.noteOn(0, composition[i][j] + scale, velocity,delay );
MIDI.noteOff(0, composition[i][j] + scale, delay+onlynotationsofeachbeatbracketdelay[i][j]);
}
else if (composition[i][j] == 0)
{
MIDI.noteOff(0, composition[i][j] + scale, delay);
}
delay = delay + onlynotationsofeachbeatbracketdelay[i][j];
}
}
}
Seeking assistance on how to integrate MIDI.js player functions in order to control start, pause, and stop actions for playing this musical sequence. Any advice or guidance would be greatly appreciated.