Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #38227

Re: Web midiAPI get name of sending device

Newsgroups comp.lang.javascript
Date 2020-03-10 00:41 -0700
References <9afba850-7ac7-4341-890d-d072931b2c09@googlegroups.com>
Message-ID <2003c3cb-077d-4ef4-bf99-4311e20eda26@googlegroups.com> (permalink)
Subject Re: Web midiAPI get name of sending device
From Jonas Thörnvall <jonas.thornvall@gmail.com>

Show all headers | View raw


Den tisdag 10 mars 2020 kl. 08:39:24 UTC+1 skrev Jonas Thörnvall:
> When listening to multiple midi Interfaces
> I can't see a way to get the informatioon about what port that actually sent the message, i can see it is due to some idiots implemented some weird next looping structure, where you can not get the index of the fucking port sending the message.
> 
> And i really can not think up a way to circumvent it?
> But there is people more knowledgable then me, basicly i just want pickup and mirror information about what device sent the signal to computer.
> 
> function midiPortsListener(){
>   var x=0;
>   inputs = mid.inputs.values();
>   for (var input = inputs.next(); input && !input.done; input = inputs.next()) {
>    input.value.onmidimessage = null; 
>    var myVar = document.getElementById("inBox" + x).checked;
>    console.log("******"+myVar);
>    if(myVar==false){  }   
>    else if(myVar==true){
>    input.value.onmidimessage = onMIDIMessage;
>    //Here a message fetched and passed to function onMIDIMessage
>    //but input.value.onmidimessage is just the message
>    //so where can i fetch the portname, this next thing scan every port
>    //i've tried to remove null (messages calls) by adding condition
>    // && input.value.onmidimessage != null above but it does not work.
>    
>    }
>    x++;
>    
>   }
> }
> 
> //Here is just how the port names listed into the option list
> function listInPorts(){
>   console.log("***********************listInPorts()");
>   var x=0; portstring="<table border='1' bgcolor=cyan width='199'>";
>   inputs = mid.inputs.values();
>   //List ports in 
>   Lportin = mid.inputs.values();
>   for (listinput = Lportin.next(); listinput && !listinput.done; listinput = Lportin.next()) {
>     var deviceIn = listinput.value.name;
>     var optin = document.createElement("option");
>     optin.text = deviceIn;
> 	//document.getElementById("in_portsel").add(optin);
>     portstring=portstring+"<tr><td align=right><b>"+optin.text+"<input id='inBox"+x+"' type='checkbox' onChange='midiPortsListener()' checked></b></td></tr> ";
> 	x++;
>   }
>    document.getElementById("ports").innerHTML=portstring+"</table>";
> }

By the way i created an open github respitory that can be downloaded and forked.
https://github.com/jonasth/midisequenser

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-10 00:39 -0700
  Re: Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-10 00:41 -0700
  Re: Web midiAPI get name of sending device "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-10 15:21 -0700
    Re: Web midiAPI get name of sending device "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-10 15:43 -0700
      Re: Web midiAPI get name of sending device "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-10 17:15 -0700
        Re: Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-11 14:32 -0700
          Re: Web midiAPI get name of sending device "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-11 15:52 -0700
            Re: Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-12 05:04 -0700
            Re: Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-12 05:21 -0700
            Re: Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-12 05:30 -0700
              Re: Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-12 06:32 -0700
              Re: Web midiAPI get name of sending device "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-12 12:16 -0700
                Re: Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-12 12:55 -0700
                Re: Web midiAPI get name of sending device "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-12 21:11 -0700
                Re: Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-13 02:16 -0700
                Re: Web midiAPI get name of sending device "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-13 13:27 +0100
                Re: Web midiAPI get name of sending device "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-13 13:34 +0100
                Re: Web midiAPI get name of sending device "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-13 12:47 -0700
    Re: Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-11 03:35 -0700
      Re: Web midiAPI get name of sending device Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-03-11 03:44 -0700
        Re: Web midiAPI get name of sending device "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-11 05:21 -0700

csiph-web