Repository

MIDI

Extends:

Component → MIDI

Constructor Summary

Public Constructor
public

Gives access to the MIDI devices.

Member Summary

Public Members
public

access: *

public
public
public

output: *

public

Method Summary

Public Methods
public

ControlChange(channel: Number, cc: Number, val: Number)

Sends a Control Change MIDI message.

public

NoteOff(channel: Number, note: Number, vel: Number)

Sends a NoteOff MIDI message.

public

NoteOn(channel: Number, note: Number, vel: Number)

Sends a NoteOn MIDI message.

Private Methods
private

hookUpMIDI

private

Web MIDI API success callback.

private

onMIDIMessage

private

Web MIDI API failure callback.

Inherited Summary

From class Component
public
public
public

events: *

public

id: *

public

name: *

private

_nexts: *[]

private
public
public

chain(component: Component)

Adds a component to this chained component array

public

Returns the array of attached children components

public

off()

Deactivate the component

public

on()

Activate the component A call to this method calls the setup method if it has not been run yet

public

Run code after the update of all components is run This empty method is usually overriden to perform post-update actions for the component It is called periodically by an internal Mobilizing mechanism

public

preLoad the component This empty method is usually overriden to perform preLoad actions for the component.

public

Run code before the update of all components is run This empty method is usually overriden to perform pre-update actions for the component It is called once per component by an internal Mobilizing mechanism

public

prepare the component This empty method is usually overriden to perform preparation actions for the component, from external process as a server.

public

Set's up the component This empty method is usually overriden to perform setup actions for the component This is where all the initialization (such as adding event listeners)should be done It is called automatically by an internal Mobilizing mechanism and should thus not be called directly

public

Update the component This empty method is usually overriden to perform update actions for the component It is called periodically by an internal Mobilizing mechanism

Public Constructors

public constructor(params: Object) source

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

Override:

Component#constructor

Params:

NameTypeAttributeDescription
paramsObject

Parameters object, given by the constructor.

params.inputNameString

The MIDI IN interface name we want to open.

params.outputNameString

The MIDI OUT interface name we want to open.

params.onMIDIInFunction

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

Public Members

public access: * source

public inputName: * source

public onMIDIIn: * source

public output: * source

public outputName: * source

Public Methods

public ControlChange(channel: Number, cc: Number, val: Number) source

Sends a Control Change MIDI message.

Params:

NameTypeAttributeDescription
channelNumber

MIDI channel [0-15]

ccNumber

ControlChange number [0-127]

valNumber

ControlChange value [0-127]

Example:

MIDI.ControlChange(2,11,50);

public NoteOff(channel: Number, note: Number, vel: Number) source

Sends a NoteOff MIDI message.

Params:

NameTypeAttributeDescription
channelNumber

MIDI channel [0-15]

noteNumber

MIDI Note number [0-127]

velNumber

note MIDI velocity [0-127]

Example:

MIDI.NoteOff(0,60,0);

public NoteOn(channel: Number, note: Number, vel: Number) source

Sends a NoteOn MIDI message.

Params:

NameTypeAttributeDescription
channelNumber

MIDI channel [0-15]

noteNumber

MIDI Note number [0-127]

velNumber

note MIDI velocity [0-127]

Example:

MIDI.NoteOn(0,60,127);

Private Methods

private hookUpMIDI() source

hookUpMIDI

private onMIDIInit(MIDI: Object) source

Web MIDI API success callback.

Params:

NameTypeAttributeDescription
MIDIObject

private onMIDIMessage(event: Object) source

onMIDIMessage

Params:

NameTypeAttributeDescription
eventObject

MIDI event

private onMIDIReject(err: Object) source

Web MIDI API failure callback.

Params:

NameTypeAttributeDescription
errObject