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


Groups > comp.lang.javascript > #35490

Re: Explain explicity what function does

Newsgroups comp.lang.javascript
Date 2018-08-15 23:13 -0700
References <c33bd026-ee20-4e30-b43b-ee30be5b5fb1@googlegroups.com> <18w04otipui3x$.v7dq6i8d8i0d.dlg@40tude.net> <a10a28f4-04f8-493c-9598-a4672cb16454@googlegroups.com>
Message-ID <69235beb-abf8-47b1-bf63-2eaebe407e15@googlegroups.com> (permalink)
Subject Re: Explain explicity what function does
From Jonas Thörnvall <jonas.thornvall@gmail.com>

Show all headers | View raw


Den torsdag 16 augusti 2018 kl. 06:43:09 UTC+2 skrev Jonas Thörnvall:
> Den torsdag 16 augusti 2018 kl. 01:47:30 UTC+2 skrev JJ:
> > On Wed, 15 Aug 2018 14:52:28 -0700 (PDT), Jonas Thörnvall wrote:
> > > 
> > > Because so it seemed on win XP, not so much on win 7,8 and 10.
> > 
> > MIDI implementation on web browsers is still at an early stage, it seems.
> > 
> > In my Window 7 system, `requestMIDIAccess()` doesn't recognize any port at
> > all, under both FF Quantum and Chromium. The Windows' own Microsoft Virtual
> > GS Wavetable Synth doesn't get listed even if I specifically requested
> > Software synthesizer.
> > 
> > > Don't ask me how message get a value above because i am baffeled myself...
> > 
> > You'll need a MIDI source which is connected to the selected MIDI input
> > port, then play something. If the MIDI input port is a hardware port on your
> > sound card, you'll need a MIDI keyboard connected to that port then play
> > something.
> > 
> > > I really would like to make my rudimentary sequenser, but since i do not
> > > understand the logic of ports above i am stuck in undefined land when i
> > > try.
> > > 
> > > output.send(noteMessage) undefined...
> > 
> > `send()` doesn't return anything. So, the value retrieved from that function
> > call will always be `undefined`.
> 
> Well i have an external USB midi cable attached and i basicly want to return in back to the device, "and thru to a model".
> 
> And i have no problem doing it using win XP and Opera latest version "for XP" and the lates version of Chrome available, but when i run the "code" script on my win 10 machine it seem the output port is undefined?
> 
> output.send(noteMessage) undefined... 
> 
> What do you mean it will be undefined? On my XP machine it takes the input via    
> 
> for (input = inputs.next(); input && !input.done; input = inputs.next()) {
>        // each time there is a midi message call the onMIDIMessage function?
>        input.value.onmidimessage = onMIDIMessage;
>     } 
> 
> And echo it out to the selected port with no undefined message, i have an option list where i select output port. Beside the thing that i can not reach outport "undefined", because it do listen to input port even in win 10.
> 
> I also wonder about the code loop above how can i set a specific port without loop thru with next as above?
> 
> It seem weird that the outport is undefined in win 10 but work fine in win XP, there must be some change to the API between the versions of windows or browser?

This is the string i use to set outport, and it do work in XP outportindex is just an integer initiated to outportindex=0, and it seem to initiate just fine using the following string.

output = mid.outputs.get(outportindex);

But when i try so send messages to it, it is undefined in windows 10?
Can you explain again why, and how i can assign the output?

So that i can use send to 
output port.

output.send(noteMessage)

Because in windows XP, the above work just fine in conjunction with "see below", i really need to understand *WHY* the port is undefined in win 10

function onMIDIMessage (message) {
     playbackPort(message);
} 

function playbackPort(message){
 var noteMessage = [message.data[0], message.data[1], message.data[2]];
 output.send(noteMessage);
} 
 

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


Thread

Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 14:52 -0700
  Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 15:11 -0700
    Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 15:16 -0700
      Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 16:00 -0700
        Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 16:03 -0700
  Re: Explain explicity what function does JJ <jj4public@vfemail.net> - 2018-08-16 06:47 +0700
    Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 21:43 -0700
      Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 23:13 -0700
        Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 23:18 -0700
          Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 23:23 -0700
    Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 23:44 -0700
      Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-15 23:49 -0700
        Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-16 01:26 -0700
          Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-17 01:49 -0700
            Re: Explain explicity what function does Flng Fck <nothanks@invalid.invalid> - 2018-08-17 16:02 +0200
              Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-17 11:29 -0700
                Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-17 11:33 -0700
                Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-17 11:36 -0700
              Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-19 11:22 -0700
                Re: Explain explicity what function does "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-08-19 22:52 +0200
                Re: Explain explicity what function does Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-08-20 00:15 +0200
                Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-19 15:21 -0700
                Re: Explain explicity what function does Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-08-20 00:27 +0200
                Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-19 15:43 -0700
                Re: Explain explicity what function does Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-08-19 15:48 -0700

csiph-web