How to use the webmidi.guessNoteNumber 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
static pitch_name_to_number(pitch_name){
        if (typeof(pitch_name) == "number") { return pitch_name }
        else {
            if (pitch_name.startsWith("R")) { return -1 } //rest, It might have an octave on it
            if(!is_digit(last(pitch_name))) { pitch_name += "4" } //the oct of middle C
            return WebMidi.guessNoteNumber(pitch_name)
        }
    }

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 4 months ago

Package Health Score

80 / 100
Full package analysis