123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title>MIDI.js - Sequencing in Javascript.</title>
-
-
- <script src="./inc/shim/Base64.js" type="text/javascript"></script>
- <script src="./inc/shim/Base64binary.js" type="text/javascript"></script>
- <script src="./inc/shim/WebAudioAPI.js" type="text/javascript"></script>
- <script src="./inc/shim/WebMIDIAPI.js" type="text/javascript"></script>
-
- <script src="./inc/jasmid/stream.js"></script>
- <script src="./inc/jasmid/midifile.js"></script>
- <script src="./inc/jasmid/replayer.js"></script>
-
- <script src="./js/midi/audioDetect.js" type="text/javascript"></script>
- <script src="./js/midi/gm.js" type="text/javascript"></script>
- <script src="./js/midi/loader.js" type="text/javascript"></script>
- <script src="./js/midi/plugin.audiotag.js" type="text/javascript"></script>
- <script src="./js/midi/plugin.webaudio.js" type="text/javascript"></script>
- <script src="./js/midi/plugin.webmidi.js" type="text/javascript"></script>
- <script src="./js/midi/player.js" type="text/javascript"></script>
- <script src="./js/midi/synesthesia.js" type="text/javascript"></script>
-
- <script src="./js/util/dom_request_xhr.js" type="text/javascript"></script>
- <script src="./js/util/dom_request_script.js" type="text/javascript"></script>
- </head>
- <body>
- <button id="playBtn">播放</button>
- <button id="pauseBtn">暂停</button>
- <button id="stopBtn">跳跃</button>
- <input type="range" id="skipBtn" value="100" min="45" max="200" />
- <script type="text/javascript">
- var midiData = {
- src: '',
- timeWarp: 1,
- }
- var currentTime = 0
- var MIDI = window.MIDI
- MIDI.loadPlugin({
- soundfontUrl: "./soundfont/",
-
- onsuccess: function () {
- console.log(MIDI)
- window.handleRendered && window.handleRendered()
-
-
- }
- });
-
- function playNote(note, delay) {
- MIDI.noteOn(0, note, 100, 0);
- MIDI.noteOff(0, note, delay);
- }
-
-
-
-
-
- var playBtn = document.getElementById('playBtn')
-
-
-
- playBtn.addEventListener('click', () => {
- MIDI.noteOn(0, 50, 50, 0);
- MIDI.noteOff(0, 50, 1);
- MIDI.noteOn(0, 50, 100, 1);
- MIDI.noteOff(0, 50, 2);
- console.log(MIDI)
- })
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </script>
- </body>
- </html>
|