xxxxxxxxxx
async function LoadMidi(url)
{
let m = await Midi.fromUrl(url);
MIDIPLAYER = new MidiPlayer(m);
}
function setup() {
createCanvas(windowWidth, windowHeight);
frameRate(2400);
background(100);
MIDIPLAYER = new MidiPlayer(EXAMPLESONG);
InitGUI();
}
function draw() {
clear();
background(20);
if (MIDIPLAYER == null)
{
fill(255);
textAlign(CENTER, CENTER);
text("Load MIDI file to start playback", width/2, height/2);
return;
}
MIDIPLAYER.Draw();
}