Friday, June 6, 2014

webmidi 9.3 not working in Chrome

It is kind of bullshit source, I should have smelt a rat. so Chrome doesn't conform to basic ins and outs and the code here fails:

The example in section 9.3 is a bit shint, surely an ecma map like Chrome returns is better, whats with the odd looking containers and the abuse of the for in operator w3?

As for working code, Chrome likes the following better (with obligatory web midi enable in chrome:\\flags)

function enumMidiAccess( midiAccess ) {
 var inputs=midiAccess.inputs(); 
 for(var key in inputs) 
  var input=inputs[key];
  console.log( "Input port " + );

 var outputs=midiAccess.outputs();
 for(var key in outputs)
  var output=outputs[key];
  console.log( "Output port " + );

Google+ Chrome webmidi pre-announce