• Need a working example web midi API javascript

    From jonas.thornvall@gmail.com@21:1/5 to All on Tue Sep 11 01:11:20 2018
    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.

    I just need a working example of howto listen to a port and loopback "send" it. I really need help, i been programming using windows XP where examples i find on web still works, i guess the code been updated and replaced.

    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 );

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)