Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a sampler sound.

Hierarchy

Implements

Index

Constructors

constructor

  • Creates an Sound object with the specified path and an optional options object. Paths can be absolute or relative to the JavaScript file being executed.

    Throws an exception if the file does not exist at the specified path.

    Parameters

    Returns Sound

Properties

Optional ampVelocityTracking

ampVelocityTracking: number

The amp velocity tracking for this sound. Range -1.0 - 1.0 Defaults to 1.0.

Optional attack

attack: number

The attack in seconds for this sound. Defaults to 0.0.

Optional decay

decay: number

The decay in seconds for this sound. Defaults to 0.0.

Optional endSample

endSample: number

The end sample for this sound.

file

file: string

The file path for this sound.

Optional highKey

highKey: number

The high key for this sound. Defaults to 127.

Optional highVelocity

highVelocity: number

The high velocity for this sound. Defaults to 127.

Optional hold

hold: number

The hold in seconds for this sound. Defaults to 0.0.

Optional id

id: ObjectID | undefined

The identifier of this object.

lengthInSamples

lengthInSamples: number

The total number of samples in this sound.

Optional lowKey

lowKey: number

The low key for this sound. Defaults to 0.

Optional lowVelocity

lowVelocity: number

The low velocity for this sound. Defaults to 0.

Optional release

release: number

The release in seconds for this sound. Defaults to 1.0.

Optional rootKey

rootKey: number

The root key for this sound. Defaults to 60.

Optional startSample

startSample: number

The start sample for this sound.

Optional sustain

sustain: number

The sustain for this sound. Defaults to 1.0.

Methods

slice

  • slice(slices: number): Sound[]
  • Splits this sound into equal parts or "slices".

    The sounds will be mapped starting from this sound's "rootKey" property onward retaining the sound's high/low velocity values. So if you have a sound with a root key of 1 and call slice(10) you will get back 10 sounds mapped from rootKey 1 through rootKey 10. The maximum number of slices is 128 (one for each midi note).

    If you have a sound with a root key of 126 and call slice(10) the root key will wrap around to 0 and you will get back 10 sounds mapped from rootKey 126 through rootKey 7.

    Parameters

    • slices: number

      The number of slices to create.

    Returns Sound[]

Generated using TypeDoc