Where to enable WebMIDI in Chrome Version 87.0.4280.66 (Official Build) snap (64-bit)

edited November 2020 in Questions & Support

I am new to WebMIDI and the stuff I find seems to be unavailable in newer SNAP packaged Chrome on Ubuntu Studio. Where do I find work in progress to follow progress of the setting now days ?


It was working in Ubuntu Studio 20.04 LTS Chrome Version 86.0.4240.193 (Official Build) (64-bit)


Fails in Ubuntu Studio 20.10 and is grayed out.


Comments

  • Your code uses the Web MIDI API, not the WebMidi.js library. The WebMidi.js library aims to simplify usage of the Web MIDI API. I think you are confusing the two.

  • I watched Scratch 3 replace ScratchX and eliminate Flash dependency. I started looking at GUI using webpack socket in NODE for off line editor. This would add webmidi.js somehow to start to code the NRPN for the Roland Go:Keys as in the ScratchX version. I see your point but not sure if we are that far apart in what we know. I just have to learn the Node.JS tool chain and maybe understand why I am chasing the implementation in the browser rather than the local built editor.

    function sendNRPN(ch, nrpn_msb, nrpn_lsb, data_msb, data_lsb)

    {

    sendMIDI(0xB0 | ch, 0x63, nrpn_msb);

    sendMIDI(0xB0 | ch, 0x62, nrpn_lsb);

    sendMIDI(0xB0 | ch, 0x06, data_msb);

    sendMIDI(0xB0 | ch, 0x26, data_lsb);

    }

    The Roland keyboard is using all 16 MIDI channels assigned as 8 channel parts plus 8 Loop Mix parts


    with Loop MIX feature syncing with MIDI beat clock or MIDI Time clock which may be too much I/O for browser overhead.

    MIDI 2.0 will add even more I/O !

    Will there be a WebMIDI.JS 2.0 with real time and CI behavior ?

  • WebMidi.js is currently at version 2.5.1. I am working on v3. If you want to try it out, it's in the develop branch on GitHub. Version 3 will not include CI because it first needs to make it into the Web MIDI API (no plans have been announced yet).

  • edited December 2020

    Should this HTML work ?


    <head>
    <title>Try to talk to USB MIDI device</title>
    
    
    <script src="https://cdn.jsdelivr.net/npm/webmidi"></script>
    </head>
    <body>
    <script>
    WebMidi.enable(function (err) {
    
    
      if (err) {
        console.log("WebMidi could not be enabled.", err);
      } else {
        console.log("WebMidi enabled!");
      }
      
    });
    </script>
    
    
    <script>
    WebMidi.enable(function (err) {
        console.log(WebMidi.inputs);
        console.log(WebMidi.outputs);
    });
    </script>
    
    
    <script>
    var output = WebMidi.getOutputByName("MPK mini play MIDI 1");
    
    
    output.playNote("C3");
    </script>
    
    
    
    
    </body>
    
    

    I get this output in console !

    _midiOutput: MIDIOutput
    connection: "open"
    id: "920EB641199613EFE4D5BE7D621FF82CEE186A11937CB5E3EB1F8BF59BFF6130"
    manufacturer: "AKAI"
    name: "MPK mini play MIDI 1"
    onstatechange: null
    state: "connected"
    type: "output"
    version: "ALSA library version 1.1.9"
    
    

    I got the console log message WebMIDI enabled ok !


    Instead of playing the note I get that error !

    Am I missing something ?

  • You shouldn't break you code into several <script> blocks. Everything needs to happen after WebMidi has been enabled. You should use something like this:

    <script>
    WebMidi.enable(function (err) {
     
      if (err) {
    
        console.log("WebMidi could not be enabled.", err);
    
      } else {
    
        console.log("WebMidi enabled!");
        console.log(WebMidi.inputs);
        console.log(WebMidi.outputs);
    
        var output = WebMidi.getOutputByName("MPK mini play MIDI 1");
        output.playNote("C3");
    
      }
      
    });
    </script>
    
  • edited December 2020

    I tried your code and it worked !

    I told you I wasn't a programmer. I learn by example. Maybe I can add some working examples in doc, wiki or source tree in github. I did testing and documentation for a computer company in the 80's.

    Thanks for that tutorial though in the Readme.md !

  • With version 3, I plan to add several starter examples. I just haven't had time to work on this yet...

  • edited December 2020

    Update Dec 01, 2020 10 am EST

    Tried the sample you sent on Roland Go:Keys 61k and it had stuck keys so started by downloading V3.0 Alpha 2 zip which has different source than the one you sent in develop branch above.

    CORRECTION: 11:45 am - Not correct tests for V2.5.1 script sourced ! Sorry for not understanding release / develop differences.

    But still want to know about your test set up !

    What is your test setup as I tried to run test/index.html and it failed wanting jazz so I though I should install then restart browser ?



    The console was looking for missing java scripts in node_modules in zip extracted space.


    Did I need Jazz Plug In because I thought my Chrome supports web MIDI ?

  • Update 11:45 am

    Sorry for frequent posts but trying to get Roland to respond like the simple Akai MPK mini play did.

    I change the source to V3 thus

    <title>Try to talk to USB MIDI device</title>
    
    <script src="https://cdn.jsdelivr.net/npm/webmidi@next/dist/webmidi.iife.js"></script>
    </head>
    
    
    

    Now all bets are off and starting to get understanding of tool chain and webmidi.js functionality.

    Have a safe and happy holiday as I may stop posting so often as I learn this object in practice on the two (actually more) MIDI devices I have.

    Lee

  • The version 3 of the library is currently in alpha. It is not meant for production and is intended for knowledgeable users and experimenters. Given that you are new to JavaScript, I strongly suggest that you stick with v2.5.1.

  • edited December 2020

    I have both V2.5.1 and V3 cloned from github. I will be using v2.5.1 which is ok for the simple AKAI as 2 channel and Roland as 16 channel for note on and note off.

    I can see how version 3 is different but since I am already on Ubuntu Studio 20.10 which is also a major deviation from 20.04 LTS it fits to use my Roland on 20.10 Plasma desktop to get into future of the home studio. This is my multi-boot desktop system that I use to do experiments on. It is already a kludged HP Sprout V1 3D workstation that was discontinued by HP as being under-powered. It is running latest Linux and Windows but no 3D workstation software due to being abandoned by HP.

    I have Ubuntu Studio upgraded since 2016 to 2020 in April. It can not be further upgraded so it will remain and connected to simpler Akai MPK mini play for webmidi.js v2.5.1 with Google Chrome, I am also watching MIDI V2.0 on midi.org so waiting to see where that is going. I have same Ubuntu Studio on the HP so I can use it with Roland Go:Keys and Juno 106 with Roland USB UM-ONE. The Juno was made before general midi existed in February 1984.

    Excerpt: http://www.vintagesynth.com/roland/juno106.php

    The Juno-106 was the first MIDI equipped Juno and its implementation is quite good. There are 16 MIDI channels available and MIDI SysEx data can be transmitted/received from all the sliders and buttons for total remote control and sequencing capability. A switch on the back of the keyboard, next to the MIDI ports allows the user to switch between three types of MIDI modes: Keyboard and Hold data only; Keyboard, Hold, Bender, Patch selection data; or All data (including SysEx). Most users simply set it to MIDI Function mode 3 and forget it.