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


Groups > comp.lang.javascript > #35576 > unrolled thread

Is the W3 Web Midi Api broken or just deprecated?

Started byJonas Thörnvall <jonas.thornvall@gmail.com>
First post2018-09-11 00:19 -0700
Last post2018-09-11 04:35 -0700
Articles 10 — 2 participants

Back to article view | Back to comp.lang.javascript


Contents

  Is the W3 Web Midi Api broken or just deprecated? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-11 00:19 -0700
    Re: Is the W3 Web Midi Api broken or just deprecated? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-11 00:23 -0700
    Re: Is the W3 Web Midi Api broken or just deprecated? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-11 00:49 -0700
      Re: Is the W3 Web Midi Api broken or just deprecated? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-11 00:51 -0700
    Re: Is the W3 Web Midi Api broken or just deprecated? Julio Di Egidio <julio@diegidio.name> - 2018-09-11 03:56 -0700
      Re: Is the W3 Web Midi Api broken or just deprecated? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-11 04:17 -0700
        Re: Is the W3 Web Midi Api broken or just deprecated? Julio Di Egidio <julio@diegidio.name> - 2018-09-11 04:47 -0700
          Re: Is the W3 Web Midi Api broken or just deprecated? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-11 05:46 -0700
      Re: Is the W3 Web Midi Api broken or just deprecated? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-11 04:30 -0700
        Re: Is the W3 Web Midi Api broken or just deprecated? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-11 04:35 -0700

#35576 — Is the W3 Web Midi Api broken or just deprecated?

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-09-11 00:19 -0700
SubjectIs the W3 Web Midi Api broken or just deprecated?
Message-ID<797b1980-0f32-4bc9-bd28-7a54ca8d9e0b@googlegroups.com>
I try to run the examples in JS fiddle and Code Pen but none of them do "anything", it can't be my OS's? I mean i tried with Vista, 7, 10 and the only ones that output something and seem to work is XP?

Do you get any output / result from running "midi" with these examples below?

https://jsfiddle.net/KeithMcMillenInstruments/zma6pzt9/?utm_source=website&utm_medium=embed&utm_campaign=zma6pzt9

https://www.smashingmagazine.com/2018/03/web-midi-api/

https://codepen.io/Rumyra/pen/NxdbzL

https://code.tutsplus.com/tutorials/introduction-to-web-midi--cms-25220

So is the web midi api broken or just replaced, if replaced could you point me to working examples with newer one?

***RUDIMENTARY*** no i do not wish to use some library just the web midi api in its simplest form.

If it is replaced could i ask why, it seemed to work perfectly for me?
Because now i do not even know where to look for working code examples. Why change something that isn't broken or was it?

This is what i need to know.
Howto Open devices
Howto Listen to message from device/devices
Howto Send message to device/devices

All in one package "JS", after that i manage just fine.

***Just a working example*** of something echoing  in/out and i be on my way.

For some weird reason list the devices still seem to work?  But i can't send anything not even echo input to console log, and none of the examples above work.

[toc] | [next] | [standalone]


#35577

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-09-11 00:23 -0700
Message-ID<2744625f-f1b9-4526-871c-3868b521b774@googlegroups.com>
In reply to#35576
Den tisdag 11 september 2018 kl. 09:19:37 UTC+2 skrev Jonas Thörnvall:
> I try to run the examples in JS fiddle and Code Pen but none of them do "anything", it can't be my OS's? I mean i tried with Vista, 7, 10 and the only ones that output something and seem to work is XP?
> 
> Do you get any output / result from running "midi" with these examples below?
> 
> https://jsfiddle.net/KeithMcMillenInstruments/zma6pzt9/?utm_source=website&utm_medium=embed&utm_campaign=zma6pzt9
> 
> https://www.smashingmagazine.com/2018/03/web-midi-api/
> 
> https://codepen.io/Rumyra/pen/NxdbzL
> 
> https://code.tutsplus.com/tutorials/introduction-to-web-midi--cms-25220
> 
> So is the web midi api broken or just replaced, if replaced could you point me to working examples with newer one?
> 
> ***RUDIMENTARY*** no i do not wish to use some library just the web midi api in its simplest form.
> 
> If it is replaced could i ask why, it seemed to work perfectly for me?
> Because now i do not even know where to look for working code examples. Why change something that isn't broken or was it?
> 
> This is what i need to know.
> Howto Open devices
> Howto Listen to message from device/devices
> Howto Send message to device/devices
> 
> All in one package "JS", after that i manage just fine.
> 
> ***Just a working example*** of something echoing  in/out and i be on my way.
> 
> For some weird reason list the devices still seem to work?  But i can't send anything not even echo input to console log, and none of the examples above work.

I am tired coding in XP, and its better change now then later.

[toc] | [prev] | [next] | [standalone]


#35578

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-09-11 00:49 -0700
Message-ID<3f4fcab8-5955-40d8-8132-cb524476072d@googlegroups.com>
In reply to#35576
Den tisdag 11 september 2018 kl. 09:19:37 UTC+2 skrev Jonas Thörnvall:
> I try to run the examples in JS fiddle and Code Pen but none of them do "anything", it can't be my OS's? I mean i tried with Vista, 7, 10 and the only ones that output something and seem to work is XP?
> 
> Do you get any output / result from running "midi" with these examples below?
> 
> https://jsfiddle.net/KeithMcMillenInstruments/zma6pzt9/?utm_source=website&utm_medium=embed&utm_campaign=zma6pzt9
> 
> https://www.smashingmagazine.com/2018/03/web-midi-api/
> 
> https://codepen.io/Rumyra/pen/NxdbzL
> 
> https://code.tutsplus.com/tutorials/introduction-to-web-midi--cms-25220
> 
> So is the web midi api broken or just replaced, if replaced could you point me to working examples with newer one?
> 
> ***RUDIMENTARY*** no i do not wish to use some library just the web midi api in its simplest form.
> 
> If it is replaced could i ask why, it seemed to work perfectly for me?
> Because now i do not even know where to look for working code examples. Why change something that isn't broken or was it?
> 
> This is what i need to know.
> Howto Open devices
> Howto Listen to message from device/devices
> Howto Send message to device/devices
> 
> All in one package "JS", after that i manage just fine.
> 
> ***Just a working example*** of something echoing  in/out and i be on my way.
> 
> For some weird reason list the devices still seem to work?  But i can't send anything not even echo input to console log, and none of the examples above work.

If W3 themself do not fucking can get a simple loopback to work how is one expected to be able to program to this API????

Can anyone get this to work, i mean it is an example it should work?
Well it give error on entries so i thought it may be a function? I added paragraphs and it pass, listening to nothing, loopback nothing.

But what the fuck???????????


http://webaudio.github.io/web-midi-api/

4.10.6 A Simple Loopback
This example loops all input messages on the first input port to the first output port - including system exclusive messages.

********NO THE FUCK IT DOES NOT*************

EXAMPLE 8
var midi = null;  // global MIDIAccess object
var output = null;

function echoMIDIMessage( event ) {
  if (output) {
    output.send( event.data, event.timestamp );
  }
}

function onMIDISuccess( midiAccess ) {
  console.log( "MIDI ready!" );
  var input = midiAccess.inputs.entries.next();
  if (input)
    input.onmidimessage = echoMIDIMessage;
  output = midiAccess.outputs.values().next().value;
  if (!input || !output)
    console.log("Uh oh! Couldn't get i/o ports.");
}

function onMIDIFailure(msg) {
  console.log( "Failed to get MIDI access - " + msg );
}

navigator.requestMIDIAccess().then( onMIDISuccess, onMIDIFailure );

[toc] | [prev] | [next] | [standalone]


#35579

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-09-11 00:51 -0700
Message-ID<8dfb621c-cfc8-4573-b046-ae46cfbf3172@googlegroups.com>
In reply to#35578
Den tisdag 11 september 2018 kl. 09:50:04 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 11 september 2018 kl. 09:19:37 UTC+2 skrev Jonas Thörnvall:
> > I try to run the examples in JS fiddle and Code Pen but none of them do "anything", it can't be my OS's? I mean i tried with Vista, 7, 10 and the only ones that output something and seem to work is XP?
> > 
> > Do you get any output / result from running "midi" with these examples below?
> > 
> > https://jsfiddle.net/KeithMcMillenInstruments/zma6pzt9/?utm_source=website&utm_medium=embed&utm_campaign=zma6pzt9
> > 
> > https://www.smashingmagazine.com/2018/03/web-midi-api/
> > 
> > https://codepen.io/Rumyra/pen/NxdbzL
> > 
> > https://code.tutsplus.com/tutorials/introduction-to-web-midi--cms-25220
> > 
> > So is the web midi api broken or just replaced, if replaced could you point me to working examples with newer one?
> > 
> > ***RUDIMENTARY*** no i do not wish to use some library just the web midi api in its simplest form.
> > 
> > If it is replaced could i ask why, it seemed to work perfectly for me?
> > Because now i do not even know where to look for working code examples. Why change something that isn't broken or was it?
> > 
> > This is what i need to know.
> > Howto Open devices
> > Howto Listen to message from device/devices
> > Howto Send message to device/devices
> > 
> > All in one package "JS", after that i manage just fine.
> > 
> > ***Just a working example*** of something echoing  in/out and i be on my way.
> > 
> > For some weird reason list the devices still seem to work?  But i can't send anything not even echo input to console log, and none of the examples above work.
> 
> If W3 themself do not fucking can get a simple loopback to work how is one expected to be able to program to this API????
> 
> Can anyone get this to work, i mean it is an example it should work?
> Well it give error on entries so i thought it may be a function? I added paragraphs and it pass, listening to nothing, loopback nothing.
> 
> But what the fuck???????????
> 
> 
> http://webaudio.github.io/web-midi-api/
> 
> 4.10.6 A Simple Loopback
> This example loops all input messages on the first input port to the first output port - including system exclusive messages.
> 
> ********NO THE FUCK IT DOES NOT*************
> 
> EXAMPLE 8
> var midi = null;  // global MIDIAccess object
> var output = null;
> 
> function echoMIDIMessage( event ) {
>   if (output) {
>     output.send( event.data, event.timestamp );
>   }
> }
> 
> function onMIDISuccess( midiAccess ) {
>   console.log( "MIDI ready!" );
>   var input = midiAccess.inputs.entries.next();
>   if (input)
>     input.onmidimessage = echoMIDIMessage;
>   output = midiAccess.outputs.values().next().value;
>   if (!input || !output)
>     console.log("Uh oh! Couldn't get i/o ports.");
> }
> 
> function onMIDIFailure(msg) {
>   console.log( "Failed to get MIDI access - " + msg );
> }
> 
> navigator.requestMIDIAccess().then( onMIDISuccess, onMIDIFailure );

And what the fuck are entries supposed to be?

[toc] | [prev] | [next] | [standalone]


#35585

FromJulio Di Egidio <julio@diegidio.name>
Date2018-09-11 03:56 -0700
Message-ID<b75480d0-2fdf-4b52-8495-3261ada5f349@googlegroups.com>
In reply to#35576
On Tuesday, 11 September 2018 09:19:37 UTC+2, Jonas Thörnvall  wrote:

> I try to run the examples in JS fiddle and Code Pen but none of them
> do "anything",

I opened the first one (in Edge) and got a pretty clear "No MIDI support in
your browser."

> it can't be my OS's? I mean i tried with Vista, 7, 10 and the only ones that
> output something and seem to work is XP?

What has the OS to do with it??  In fact, have you bothered looking at the
documentation at all?

<https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess>

It starts by saying << This is an experimental technology
Check the Browser compatibility table carefully
before using this in production. >>
And what does the browser compatibility table say?

Though, even if the API is supported by the browser, that still does not mean
that necessarily there are MIDI interfaces (ports) available on your system...

Julio

[toc] | [prev] | [next] | [standalone]


#35586

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-09-11 04:17 -0700
Message-ID<195cebb7-9743-4eb4-98ea-b0f2cb6a8148@googlegroups.com>
In reply to#35585
Den tisdag 11 september 2018 kl. 12:56:09 UTC+2 skrev Julio Di Egidio:
> On Tuesday, 11 September 2018 09:19:37 UTC+2, Jonas Thörnvall  wrote:
> 
> > I try to run the examples in JS fiddle and Code Pen but none of them
> > do "anything",
> 
> I opened the first one (in Edge) and got a pretty clear "No MIDI support in
> your browser."
> 
> > it can't be my OS's? I mean i tried with Vista, 7, 10 and the only ones that
> > output something and seem to work is XP?
> 
> What has the OS to do with it??  In fact, have you bothered looking at the
> documentation at all?
> 
> <https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess>
> 
> It starts by saying << This is an experimental technology
> Check the Browser compatibility table carefully
> before using this in production. >>
> And what does the browser compatibility table say?
> 
> Though, even if the API is supported by the browser, that still does not mean
> that necessarily there are MIDI interfaces (ports) available on your system...
> 
> Julio

Well Julio if it fucking works using Windows XP with browsers that aren't up to date, ***WHY ISN'T WORKING ON NEW ONES*** "yeah it works on old chrome and opera" at least using Windows XP. I can't see they say anything changed within interface?

Something is just broken?

Can you get any browser working, with the examples using any OS?
Tell me OS and browser, because i had it working under Vista for a day, next day i started browser "probably autoupdate" it did not work any longer.

output.send(message); is undefined on all up to date browsers i tried to send messages.

[toc] | [prev] | [next] | [standalone]


#35589

FromJulio Di Egidio <julio@diegidio.name>
Date2018-09-11 04:47 -0700
Message-ID<21d9226d-cf0c-464f-a854-c2297c91c5db@googlegroups.com>
In reply to#35586
On Tuesday, 11 September 2018 13:17:15 UTC+2, Jonas Thörnvall  wrote:

> Well Julio if it fucking works using Windows XP with browsers that aren't up
> to date, ***WHY ISN'T WORKING ON NEW ONES***

I don't know why most computer producers dropped built-in support for MIDI
at some point before 2010, at least for Windows machines.  I guess it was
too good a simple, high-level protocol for interprocess communication...
AFAIK, nowadays one usually only gets it with a proper sound card. But
I may be wrong on the whole line, this is far from my field of expertise.

> "yeah it works on old chrome and opera" at least using Windows XP. I can't
> see they say anything changed within interface?

I'll give it a try on my laptop with Chrome on both Win 10 and Ubuntu,
as soon as I manage...

Julio

[toc] | [prev] | [next] | [standalone]


#35592

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-09-11 05:46 -0700
Message-ID<a2e1d179-7af5-45d6-8e90-c942dec155e7@googlegroups.com>
In reply to#35589
Den tisdag 11 september 2018 kl. 13:47:42 UTC+2 skrev Julio Di Egidio:
> On Tuesday, 11 September 2018 13:17:15 UTC+2, Jonas Thörnvall  wrote:
> 
> > Well Julio if it fucking works using Windows XP with browsers that aren't up
> > to date, ***WHY ISN'T WORKING ON NEW ONES***
> 
> I don't know why most computer producers dropped built-in support for MIDI
> at some point before 2010, at least for Windows machines.  I guess it was
> too good a simple, high-level protocol for interprocess communication...
> AFAIK, nowadays one usually only gets it with a proper sound card. But
> I may be wrong on the whole line, this is far from my field of expertise.
> 
> > "yeah it works on old chrome and opera" at least using Windows XP. I can't
> > see they say anything changed within interface?
> 
> I'll give it a try on my laptop with Chrome on both Win 10 and Ubuntu,
> as soon as I manage...
> 
> Julio

Here is a little snippet it do read from in, but nothing goes out.

var midi = null;  // global MIDIAccess object
var output = null;

function onMIDIMessage(notemessage) {
 output = mid.outputs.get(0);
 output.send(noteMessage); 
}

function success (midi) {
   mid=midi;
   inputs = midi.inputs.values();
   outputs = midi.outputs.values();
   // inputs outputs are Iterators
   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;
   } 
}

function failure(msg) {
  console.log( "Failed to get MIDI access - " + msg );
}

[toc] | [prev] | [next] | [standalone]


#35587

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-09-11 04:30 -0700
Message-ID<a2c4d387-ef38-48b9-99cf-114c31d7d6af@googlegroups.com>
In reply to#35585
Den tisdag 11 september 2018 kl. 12:56:09 UTC+2 skrev Julio Di Egidio:
> On Tuesday, 11 September 2018 09:19:37 UTC+2, Jonas Thörnvall  wrote:
> 
> > I try to run the examples in JS fiddle and Code Pen but none of them
> > do "anything",
> 
> I opened the first one (in Edge) and got a pretty clear "No MIDI support in
> your browser."
> 
> > it can't be my OS's? I mean i tried with Vista, 7, 10 and the only ones that
> > output something and seem to work is XP?
> 
> What has the OS to do with it??  In fact, have you bothered looking at the
> documentation at all?
> 
> <https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess>
> 
> It starts by saying << This is an experimental technology
> Check the Browser compatibility table carefully
> before using this in production. >>
> And what does the browser compatibility table say?
> 
> Though, even if the API is supported by the browser, that still does not mean
> that necessarily there are MIDI interfaces (ports) available on your system...
> 
> Julio

Yeah i do read from the API i did try the latest example. Look for loopback
http://webaudio.github.io/web-midi-api/ 

It doesn't work, and i have midiequipment and ports, they work and scripts work just fine using XP.

So something changed in the API but i do not understand what.

[toc] | [prev] | [next] | [standalone]


#35588

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-09-11 04:35 -0700
Message-ID<f684e1a1-1df6-499a-adae-948d5984b8a4@googlegroups.com>
In reply to#35587
Den tisdag 11 september 2018 kl. 13:31:04 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 11 september 2018 kl. 12:56:09 UTC+2 skrev Julio Di Egidio:
> > On Tuesday, 11 September 2018 09:19:37 UTC+2, Jonas Thörnvall  wrote:
> > 
> > > I try to run the examples in JS fiddle and Code Pen but none of them
> > > do "anything",
> > 
> > I opened the first one (in Edge) and got a pretty clear "No MIDI support in
> > your browser."
> > 
> > > it can't be my OS's? I mean i tried with Vista, 7, 10 and the only ones that
> > > output something and seem to work is XP?
> > 
> > What has the OS to do with it??  In fact, have you bothered looking at the
> > documentation at all?
> > 
> > <https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess>
> > 
> > It starts by saying << This is an experimental technology
> > Check the Browser compatibility table carefully
> > before using this in production. >>
> > And what does the browser compatibility table say?
> > 
> > Though, even if the API is supported by the browser, that still does not mean
> > that necessarily there are MIDI interfaces (ports) available on your system...
> > 
> > Julio
> 
> Yeah i do read from the API i did try the latest example. Look for loopback
> http://webaudio.github.io/web-midi-api/ 
> 
> It doesn't work, and i have midiequipment and ports, they work and scripts work just fine using XP.
> 
> So something changed in the API but i do not understand what.

To be honest i would like to make my fucking sequenser work on something that isn't XP with an old browser.

But i just can't, because output not defined.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web