Class Arpeggiator

The Arpeggiator is much like to Arpeggios, what the ClipPlayer is to Clips.

The Arpeggiator should be added to a clock to receive regular updates. It should hold a reference to a metronome for beat timings. It should hold a reference to a MIDI out for it to send notes to. It should hold a reference to an arpeggio, which defines the shape that it will play. And it should hold a reference which defines what chord it should play the arpeggio shape around.

Hierarchy

  • Arpeggiator

Implements

Constructors

Accessors

  • get arpeggio(): Arpeggio
  • Which arpeggio to play

    Returns Arpeggio

  • set arpeggio(value: Arpeggio): void
  • Parameters

    Returns void

  • get beat(): number
  • Which beat of the arpeggio playback is at

    Returns number

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

    • value: number

    Returns void

  • get channel(): number
  • The default channel for arpeggiated notes to be played on.

    Returns number

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

    • value: number

    Returns void

  • get chord(): Chord
  • Which chord to play. Setting this will cause all currently playing notes to stop.

    Returns Chord

  • set chord(value: Chord): void
  • Parameters

    Returns void

  • get isFinished(): boolean
  • Signifies whether the arpeggiator has stopped.

    Returns boolean

  • get metronome(): IMetronome
  • The metronome which the player uses for tracking beat timings

    Returns IMetronome

  • set metronome(value: IMetronome): void
  • Parameters

    Returns void

  • get midiOut(): IMidiOut
  • The MidiOut which data from the arpeggio gets played on

    Returns IMidiOut

  • set midiOut(value: IMidiOut): void
  • Parameters

    Returns void

  • get noteModifier(): ((note: Note) => void)
  • Allows attaching custom logic to modify each note produced by the arpeggiator.

    For example:

    const arp = new Arpeggiator(arpeggio, metronome, midiOut);
    arp.noteModifier = note => note.velocity = Math.floor(Math.random() * 128); //Give each arpeggiated note a random velocity

    Returns ((note: Note) => void)

      • (note: Note): void
      • Parameters

        Returns void

  • set noteModifier(value: ((note: Note) => void)): void
  • Parameters

    • value: ((note: Note) => void)
        • (note: Note): void
        • Parameters

          Returns void

    Returns void

  • get ref(): string
  • Provides a way of identifying arpeggiators so they can easily be retrieved later

    Returns string

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

    • value: string

    Returns void

  • get running(): boolean
  • If not running, then the arpeggiator won't do anything with each update cycle

    Returns boolean

  • set running(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

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

    Returns number

  • set speed(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

  • Calling this tells the arpeggiator to stop whatever it's doing and that it will no longer be used.

    Returns void

  • 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 Arpeggiator(arpeggio, metronome, midiOut).withRef('arpeggiator'));
    

    Returns

    The calling object.

    Parameters

    • ref: string

      The ref to set on the object.

    Returns IClockChild

Generated using TypeDoc