1. ryoyakawai

    No comment

    ryoyakawai
Changes in body
Source | HTML | Preview
@@ -90,11 +90,10 @@
startMIDIAccess();
function startMIDIAccess() {
navigator.requestMIDIAccess({sysex:false}).then(successCallback, errorCallback)
.then(devices => {
- console.log(devices);
setDeviceToList('midiinput', devices.inputs);
setDeviceToList('midioutput', devices.outputs);
})
.then(() => {
//(!!!!....ここに続けて処理を書く....!!!!)
@@ -116,11 +115,10 @@
function errorCallback() {
console.error('[ERROR] requestMIDIAccess()', error);
}
}
function setDeviceToList(elemId, devices) {
- console.log(devices);
let elem = document.querySelector('#' + elemId)
for(let i=0; i<devices.length; i++) {
let option = new Option(devices[i].name, devices[i].id);
elem.appendChild(option);
}