API Documentation

for 0.0.1
Show:

Midi Class

Gives access to the midi devices. This class requires the Web MIDI API to operate properly.

Constructor

Midi

(
  • params
)

Parameters:

  • params Object

    the parameters object

    • in String

      The Midi IN interface name we want to open.

    • out String

      The Midi OUT interface name we want to open.

    • onMidiIn Function

      The Midi IN callback we want to be called on a midi in event.

Methods

ControlChange

(
  • channel
  • cc
  • val
)

Sends a Control Change MIDI message.

Parameters:

  • channel Number

    MIDI channel [0-15]

  • cc Number

    ControlChange number [0-127]

  • val Number

    ControlChange value [0-127]

Example:

midi.ControlChange(2,11,50);

hookUpMIDI

() private

hookUpMIDI

NoteOff

(
  • channel
  • note
  • vel
)

Sends a NoteOff MIDI message.

Parameters:

  • channel Number

    MIDI channel [0-15]

  • note Number

    Midi Note number [0-127]

  • vel Number

    note MIDI velocity [0-127]

Example:

midi.NoteOff(0,60,0);

NoteOn

(
  • channel
  • note
  • vel
)

Sends a NoteOn MIDI message.

Parameters:

  • channel Number

    MIDI channel [0-15]

  • note Number

    Midi Note number [0-127]

  • vel Number

    note MIDI velocity [0-127]

Example:

midi.NoteOn(0,60,127);

onMIDIInit

(
  • midi
)
private

Web MIDI API success callback.

Parameters:

  • midi Object

onMIDIMessage

(
  • event
)
private

onMIDIMessage

Parameters:

  • event Object

    MIDI event

onMIDIReject

(
  • err
)
private

Web MIDI API failure callback.

Parameters:

  • err Object

Properties

Aftertouch

Number final static

After touch

ControlChange

Number final static

Control change

NoteOff

Number final static

Note Off

NoteOn

Number final static

Note On

ProgramChange

Number final static

Program change