J.S. Bach - Das wohltemperierte Klavier II, BWV 870-893 (1744)
write complete html and javascript to support tonejs midi.
The top H1 tag includes text "J.S. Bach - Das wohltemperierte Klavier II, BWV 870-893 (1744)"
require is not a valid javascript keyword.
load the following scripts: https://unpkg.com/@tonejs/midi, https://unpkg.com/tone@13.4.9, and https://unpkg.com/@tonejs/ui@0.0.8
AudioContext must be resumed (or created) only after a user gesture on the page, in this case a button labeled Play.
AudioContext must be inside Tone's constructor.
Use Midi.fromUrl function to load midi song.
Create a synth for each track using Tone.PolySynth with parameter 1 as 10, parameter 2 Tone.Synth, and parameter 3 as envelope: { attack: 0.02, decay: 0.1, sustain: 0.3, release: 1 } using toMaster().
Schedule all of the events using track.notes.forEach and synth.triggerAttackRelease.
the midi song is located at http://htxml.com/chatgpt/bach_wohltemperierte_klavier_ii_14.mid
Place all of these instructions inside a
tag at the bottom of the body.
Do no write explanations.
Write the whole code inside one unique code block and nothing else.