Options
All
  • Public
  • Public/Protected
  • All
Menu

Class that records MIDI from any MIDI connected instrument, and converts it to a NoteSequence.

Hierarchy

  • Recorder

Index

Constructors

constructor

  • Recorder constructor.

    Parameters

    • Default value config: RecorderConfig = {} as RecorderConfig
    • Optional callbackObject: BaseRecorderCallback

      An optional BasePlayerCallback, specifies an object that contains run() and stop() methods to invode during playback.

    Returns Recorder

Properties

callbackObject

callbackObject: BaseRecorderCallback

Methods

enablePlayClick

  • enablePlayClick(playClick: boolean): void
  • Whether to play a click track while recording. If the recorder is already recording, changes will not take place until it is restarted.

    Parameters

    • playClick: boolean

      True if it should play a click track.

    Returns void

enablePlayCountIn

  • enablePlayCountIn(countIn: boolean): void
  • Whether to play a count in at the beginning of the recording. If the recorder is already recording, changes will not take place until it is restarted.

    Parameters

    • countIn: boolean

      True if it should play a count in.

    Returns void

getMIDIInputs

  • getMIDIInputs(): MIDIInput[]
  • Returns a list of all the MIDI inputs that are currently available to record.

    Returns MIDIInput[]

getNoteSequence

  • getNoteSequence(): NoteSequence
  • Returns NoteSequence

    a non-quantized NoteSequence containing all the currently recorded notes.

initialize

  • initialize(): Promise<void>
  • Initializes the Recorder by requesting MIDI access from the browser, and connecting to any available MIDI inputs. If MIDI events are emitted, they will be ignored until start() is called.

    Returns Promise<void>

isRecording

  • isRecording(): boolean

midiMessageReceived

  • midiMessageReceived(event: MIDIMessageEvent): void

reset

  • reset(): NoteSequence
  • Resets the notes array to an empty array and stops the recording.

    Returns NoteSequence

    a non-quantized NoteSequence containing all the recorded notes.

setTempo

  • setTempo(qpm: number): void
  • Changes the tempo of the click loop.

    Parameters

    • qpm: number

      The new qpm to use.

    Returns void

start

  • start(midiInputs?: MIDIInput[]): void
  • Starts listening to MIDI events and records any messages received.

    Parameters

    • Optional midiInputs: MIDIInput[]

      An optional list of MIDIInputs, that specifies which inputs to start listening to MIDI messages for to record. If not specified, all available inputs will be used.

    Returns void

stop

  • stop(): NoteSequence
  • Stops listening to MIDI events. Note that all the MIDI inputs will still be connected after calling this method, but any messages received from them will be ignored.

    Returns NoteSequence

    a NoteSequence containing all the recorded notes.

Generated using TypeDoc