midi working

This commit is contained in:
henne 2020-04-28 18:23:49 +02:00
parent a4d69fae6f
commit 685656d9b7
2 changed files with 10 additions and 6 deletions

View File

@ -46,9 +46,11 @@
</head>
<body>
<div id="room-selector">
<input type="text" id="room-name" placeholder="Room name"/><br />
<input type="text" id="room-password" placeholder="Room Password" />
<button onclick="connect()" disabled id="room-name-button">Connect</button>
<form onsubmit="connect(event)">
<input type="text" id="room-name" placeholder="Room name"/><br />
<input type="text" id="room-password" placeholder="Room Password" />
<button disabled id="room-name-button">Connect</button>
</form>
</div>
<div style="display: none" id="room">
<div class="container-fluid">

View File

@ -56,8 +56,8 @@ function onMIDISuccess(midiData) {
// when a MIDI value is received call the onMIDIMessage function
input.value.onmidimessage = (messageData ) => {
if(messageData.data[0] != 176) return;
midiSetLevel(messageData.data[1], Math.round(messageData[2]/127))
console.log(messageData.data);
if(messageData.data[1] > 7) messageData.data[1] -= 8;
midiSetLevel(messageData.data[1], messageData.data[2]/127);
};
}
}
@ -275,7 +275,8 @@ function disconnect() {
/**
* Connects the interface to a conference room, sets up the listeners..
*/
function connect() {
function connect(e) {
e.preventDefault()
const roomName = $('#room-name').val();
room = connection.initJitsiConference(roomName, confOptions);
@ -328,6 +329,7 @@ function setLevel(id, level) {
* @param level
*/
function midiSetLevel(id, level) {
console.log(id, level);
if(id >= remoteMappingName.length) {
return;
}