How to use the webmidi.disable function in webmidi

To help you get started, we’ve selected a few webmidi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cfry / dde / music / note.js View on Github external
if(!WebMidi.enabled){
            WebMidi.enable(function(err) {
                                if (err) { warning("WebMidi couldn't be enabled: " + err) }
                                else {
                                    out("WedMidi enabled")
                                    //out(WebMidi.inputs)
                                    //out(WebMidi.outputs)
                                    inspect({"WebMidi.inputs":  WebMidi.inputs,
                                             "WebMidi.outputs": WebMidi.outputs})
                                }
                             })
            //eval_and_play_button_id.style.display = "inline-block"
        }
        else {
            Midi.all_notes_off()
            WebMidi.disable() //undefines the listeners, maybe other stuff
            setTimeout(Midi.init, 1000)
         }
    }
github ambewas / react-audio-tools / src / lib / components / inputs / MidiController / MidiController.js View on Github external
componentWillUnmount() {
    if (this.canAccessMidi) {
      for (let input in this.inputs) {
        this.inputs[input].removeListener("noteon", "all", this.handleNoteOn);
        this.inputs[input].removeListener("noteoff", "all", this.handleNoteOff);
      }
      webmidi.disable();
    }
  }

webmidi

WEBMIDI.js makes it easy to talk to MIDI instruments from a browser or from Node.js. It simplifies the control of external or virtual MIDI instruments with functions such as playNote(), sendPitchBend(), sendControlChange(), etc. It also allows reacting to

Apache-2.0
Latest version published 16 days ago

Package Health Score

84 / 100
Full package analysis