https://webpack.js.org/guides/getting-started/
https://webpack.js.org/guides/typescript/
https://github.com/Tonejs/Tone.js
npm run build
use:
npm i midi-view
html:
播放
css:
script:
const midiview = var playing = false;var view = documentview = view// view = new midiview.MidiView(view , "light") // default black white blue var btn = document; { try if playing btntextContent = "播放"; view else btntextContent = "暂停"; view finally playing = !playing } btn var select = document;select;
preview:
API:
MidiView
- play
- stop
- loadFromUrl
- loadFromData
- destroy
- setTheme: default,black,blue,light
wheel:
- wheel : y scroll
- SHIFT + wheel : x scroll
- CTRL + wheel : x scale
- ALT + wheel : y scale
- CTRL + ALT + wheel : x、y scale
ref blog: