Namespace: webmidi

music21. webmidi

webmidi -- for connecting with external midi devices

Uses either the webmidi API or the Jazz plugin

Properties:
Name Type Description
storedPlugin JazzObject | undefined

reference to the Jazz object from the plugin; cached from createPlugin.

selectedJazzInterface string

the currently connected interface (note that we can only use one right now)

Source:

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
midiSelectDiv JQueryDOMObject | DOMObject <optional>
document.body

object to append the select to

options object <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
appendElement DOMObject <optional>
document.body

where to place this hidden object (does not really matter)

override Boolean <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
$midiSelectDiv JQueryDOMObject | DOMObject <optional>
$('body')

object to append the select to

options object <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
t byte

timing information

a byte

data 1

b byte

data 2

c byte

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 JazzMIDI

Calls 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
midiMessageEvent MidiMessageEvent

midi Information

Source:
Music21j, Copyright © 2013-2018 Michael Scott Cuthbert and cuthbertLab.
Documentation generated by JSDoc 3.5.5 on Wed Jul 4th 2018 using the DocStrap template.