Class ToneJSMidiOutChannel

The ToneJSMidiOutChannel class represents one particular MIDI channel within the ToneJSMidiOut. It holds a reference to a ToneJS instrument object, and handles the conversion from received MIDI messages into actions to perform on the ToneJS instrument.

Hierarchy

  • ToneJSMidiOutChannel

Constructors

Properties

controlValues: number[]

A collection of current control values. This array is instanciated in the constructor with 128 indices, each one initially set to 0. As control change MIDI messages are received, these values get updated.

onControlChange: ((controlChange: ControlChangeMessage, target: any) => void) = null

Type declaration

    • (controlChange: ControlChangeMessage, target: any): void
    • This property is null by default, but can take a function value which gets called every time the channel receives a new control change message.

      Parameters

      Returns void

Accessors

  • get isPolyphonic(): boolean
  • Stores whether the ToneJS instrument being held is polyphonic. This is mainly for internal purposes, to determine how calls are made to the target.

    Returns boolean

  • get parent(): ToneJSMidiOut
  • The ToneJSMidiOut instance which this channel object belongs to.

    Returns ToneJSMidiOut

  • get target(): any
  • The ToneJS instrument which will be responsible for playback.

    Returns any

  • get typeName(): string
  • Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable.

    Returns string

Methods

  • This method gets called by ToneJSMidiOut whenever a new note needs to be started.

    Parameters

    • note: Note

      The note object that playback is to be started for.

    Returns void

  • This method gets called by ToneJSMidiOut whenever a note needs to be stopped.

    Parameters

    • note: Note

      The note object that playback is to be stopped for.

    Returns void

  • This method gets called by ToneJSMidiOut whenever a pitch bend message is received for this channel. Note, this method will only take action if the attached ToneJS instrument is monophonic. Using pitch bends in conjunction with frequency manipulation through ToneJS's set of tools will lead to weird results

    Returns

    Returns true if any action was taken.

    Parameters

    Returns boolean

Generated using TypeDoc