Options
All
  • Public
  • Public/Protected
  • All
Menu

Performance representation with variable step size, consisting of a sequence of NoteOn, NoteOff, TimeShift, and VelocityChange events.

param

An array of performance events.

param

Number of steps in the maximum time shift.

param

The number of quantized MIDI velocity bins to use. If zero, velocities will be ignored.

param

(Optional) The MIDI program to use for these events.

param

(Optional) Whether or not these are drum events.

Hierarchy

  • Performance

Index

Constructors

constructor

  • new Performance(events: PerformanceEvent[], maxShiftSteps: number, numVelocityBins: number, program?: number, isDrum?: boolean): Performance

Properties

events

Optional isDrum

isDrum: boolean

maxShiftSteps

maxShiftSteps: number

numVelocityBins

numVelocityBins: number

Optional program

program: number

Methods

getNumSteps

  • getNumSteps(): number
  • Return the total number of time steps in the performance.

    Returns number

    The total number of steps.

setNumSteps

  • setNumSteps(numSteps: number): void
  • Set the total number of time steps in the performance by either adding time-shift events to the end or truncating.

    Parameters

    • numSteps: number

    Returns void

toNoteSequence

  • toNoteSequence(instrument?: number): INoteSequence
  • Convert this performance representation to NoteSequence.

    Parameters

    • Optional instrument: number

      Instrument value to give each note.

    Returns INoteSequence

    A NoteSequence corresponding to these performance events.

Static fromNoteSequence

  • fromNoteSequence(noteSequence: INoteSequence, maxShiftSteps: number, numVelocityBins: number, instrument?: number): Performance
  • Extract a performance from a NoteSequence.

    Parameters

    • noteSequence: INoteSequence

      NoteSequence from which to extract a performance.

    • maxShiftSteps: number

      Number of steps in maximum time shift.

    • numVelocityBins: number

      Number of velocity bins to use. If zero, ignore note velocities.

    • Optional instrument: number

      (Optional) Instrument to extract. If not specified, extract all instruments.

    Returns Performance

    A Performance created from the NoteSequence.

Generated using TypeDoc