webmidi -- for connecting with external midi devices
Uses either the webmidi API or the Jazz plugin
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
storedPlugin |
JazzObject | undefined | reference to the Jazz object from the plugin; cached from |
selectedJazzInterface |
string | the currently connected interface (note that we can only use one right now) |
Requires
- module:music21/miditools
- module:jquery
Methods
-
<static> createJazzSelector(midiSelectDiv, options) → {DOMObject|undefined}
-
Creates a <select> object for selecting among the MIDI choices in Jazz
Parameters:
Name Type Argument Default Description midiSelectDivJQueryDOMObject | DOMObject <optional>
document.body object to append the select to
optionsobject <optional>
see createSelector for details
- Source:
Returns:
DOM object containing the select tag, or undefined if Jazz cannot be loaded.
- Type
- DOMObject | undefined
-
<static> createPlugin(appendElement, override) → {Jazz|undefined}
-
Create a hidden tiny, <object> tag in the DOM with the
proper classid (CLSID:1ACE1618-1C7D-4561-AEE1-34842AA85E90) to
load the Jazz plugin.It will return the plugin if it can or undefined if it cannot. Caches it in webmidi.storedPlugin.
Parameters:
Name Type Argument Default Description appendElementDOMObject <optional>
document.body where to place this hidden object (does not really matter)
overrideBoolean <optional>
false if this method has been called successfully before return the storedPlugin unless override is true.
- Source:
Returns:
Jazz MIDI plugin object
- Type
- Jazz | undefined
-
<static> createSelector($midiSelectDiv, options) → {DOMObject|undefined}
-
Creates a <select> object for selecting among the MIDI choices in Jazz
The options object has several parameters:
{bool} autoupdate -- should this auto update?
{function} onsuccess -- function to call on all successful port queries
{function} oninputsuccess -- function to call if successful and at least one input device is found
{function} oninputempty -- function to call if successful but no input devices are found.
{bool} existingMidiSelect -- is there already a select tag for MIDI?Parameters:
Name Type Argument Default Description $midiSelectDivJQueryDOMObject | DOMObject <optional>
$('body') object to append the select to
optionsobject <optional>
see above.
- Source:
Returns:
DOM object containing the select tag, or undefined if Jazz cannot be loaded.
- Type
- DOMObject | undefined
-
<static> webmidi.jazzMidiInArrived(t, a, b, c)
-
Called by Jazz MIDI plugin when an event arrives.
Shim to convert the data into WebMIDI API format and then call the WebMIDI API midiInArrived
See the MIDI spec for information on parameters
Parameters:
Name Type Description tbyte timing information
abyte data 1
bbyte data 2
cbyte data 3
- Source:
-
<static> webmidi.midiInArrived(midiMessageEvent)
-
Called directly when a MIDI event arrives from the WebMIDI API, or via a Shim (jazzMidiInArrived)
when MIDI information comes from JazzMIDICalls the 'raw' and 'general callbacks when a raw midi event (four bytes)
arrives.See the MIDI spec for information on the contents of the three parameters.
midiMessageEvent should be an object with two keys: timeStamp (int) and data (array of three int values)
Parameters:
Name Type Description midiMessageEventMidiMessageEvent midi Information
- Source: