Module: webmidi

webmidi

webmidi -- for connecting with external midi devices

Uses either the webmidi API or the Jazz plugin
See music21.webmidi

Source:

Example

smallest usage of the webmidi toolkit.  see testHTML/midiInRequire.html

<html>
<head>
    <title>MIDI In/Jazz Test for Music21j</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<div>
MIDI Input: <div id="putMidiSelectHere" />
</div>
<div id="svgDiv">
</div>
<script src='music21j.js'></script>
<script>
    s = new music21.stream.Stream();
    music21.webmidi.createSelector($("#putMidiSelectHere"));

    function displayStream(midiEvent) {
        midiEvent.sendToMIDIjs();
        if (midiEvent.noteOn) {
            var m21n = midiEvent.music21Note();
            if (s.length > 7) {
                s.elements = s.elements.slice(1)
            }
            s.append(m21n);
            var $svgDiv = $("#svgDiv");
            $svgDiv.empty();
            var svgDiv = s.appendNewDOM($svgDiv);
        }
    }
    music21.miditools.callBacks.general = displayStream;

</script>
</body>
</html>

Requires

  • module:music21/miditools
  • module:jQuery

Members

<static, constant> webmidi :Object

Type:
  • Object
Source:

Methods

<static> selectionChanged()

Function to be called if the webmidi-api selection changes. (not jazz)

Source:

Type Definitions

Jazz

Type:
  • Object
Properties:
Name Type Description
isJazz boolean
MidiInOpen function
MidiInClose function
MidiInList function
Source:
Music21j, Copyright © 2013-2021 Michael Scott Asato Cuthbert.
Documentation generated by JSDoc 3.6.3 on Wed Jul 31st 2019 using the DocStrap template.