Class ChordProgressionPlayer

The ChordProgressionPlayer facilitates the playing of a chord. It doesn't actually cause the generation of any note on/note off events. Instead it triggers events whenever the chord changes, allowing other objects to easily play/arpeggiate/do whatever they like over a series of changing chords.

Hierarchy

  • ChordProgressionPlayer

Implements

Constructors

Accessors

  • get beatCount(): number
  • How many beats should have passed before the chord progression player stops. The default value is -1, meaning the chord progression player never stops, and continually loops playback of the chord progression.

    Returns number

  • set beatCount(value: number): void
  • Parameters

    • value: number

    Returns void

  • get beatsPassed(): number
  • How many beats have passed since the chord progression player started.

    Returns number

  • get isFinished(): boolean
  • Returns true if the chord progression player has finished playing its chord progression.

    Returns boolean

  • get ref(): string
  • Provides a way of identifying a chord progression player so that it can be easily retrieved later.

    Returns string

  • set ref(value: string): void
  • Parameters

    • value: string

    Returns void

  • get speed(): number
  • How many beats in the chord progression to play for every beat that passes in actual time. For example: 1.5 means the chord progression is played 1.5 times faster than it would normally.

    Returns number

  • set speed(value: number): void
  • Parameters

    • value: number

    Returns void

  • get startBeat(): number
  • Which beat of the chord progression to start playing from. This allows for a chord progression player to begin playing a chord progression from half-way through for example.

    Returns number

  • set startBeat(value: number): void
  • Parameters

    • value: number

    Returns void

  • 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 is intended to be called by a clock to provide regular updates. It should not be called by consumers of the library.

    Returns

    Parameters

    • deltaMs: number

      How many milliseconds have passed since the last update cycle.

    Returns void

  • Provides a way for setting the ref through a chained function call. For example:

    clock.addChild(new ChordProgressionPlayer(chords, metronome).withRef('player'));
    

    Returns

    The calling object.

    Parameters

    • ref: string

      The ref to set on the object.

    Returns IClockChild

Generated using TypeDoc