Class ClipBend

ClipBend represents a bend to be played within a clip, specifying the start and end of the bend, as well as the bend amount and optionally shape.

Hierarchy

  • Range

    Hierarchy

    • ClipBend

Constructors

  • Parameters

    • start: number

      What beat within the clip that the bend starts

    • duration: number

      How many beats the bend lasts

    • percent: number | ITween

      How much bend to apply, valid values range from 0 - 127, or a Tween object which defines a strategy for how to change over the course of the bend's lifetime.

    • channel: number = null

      Which channel to play the bend on, valid values range from 0 - 15, or null to allow whatever is playing the clip to decide

    Returns ClipBend

Accessors

  • get channel(): number
  • Which channel to send the bend to, valid values range from 0 - 15, or null to allow whatever is playing the clip to decide

    Returns number

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

    • value: number

    Returns void

  • get duration(): number
  • The difference between the start and end values.

    Attempts to set this to a negative value will result in an error being thrown.

    Returns number

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

    • value: number

    Returns void

  • get end(): number
  • The value which the range ends at.

    Attempts to set this to a value less than start will result in an error being thrown.

    Returns number

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

    • value: number

    Returns void

  • get percent(): number | ITween
  • How much bend to apply, valid values range from -1 to +1, or an ITween object to allow for values that change over time.

    In the MIDI standard, bends are defined by 2 7-bit numbers put together, this makes sense within the specification, but is not particularly friendly to work with. Shimi prefers to work with percentages for ease of use.

    An example of using a tween to make a bend that smoothly eases up: clipBend.percent = Tween.sineInOut(0, 1);

    Returns number | ITween

  • set percent(value: number | ITween): void
  • Parameters

    Returns void

  • get start(): number
  • The value which the range starts at.

    Attempts to set this to a value greater than end will result in an error being thrown.

    Returns number

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

  • Returns true if the passed in point is greater than or equal to range start, and less than or equal to range end.

    Returns

    Parameters

    • point: number

      The point value to determine whether it's within the range.

    Returns boolean

  • Returns a copy of this ClipCC object

    Returns ClipBend

  • Accepts a value and returns what percentage of the way into the range that the value is.

    The returned value can be negative, or greater than 100%, if the passed in value is less than the range start, or greater than the range end.

    Returns

    Parameters

    • value: number

      The value to compare against the range.

    Returns number

  • Used by the library for the custom serialization of Clips

    Returns any

  • Takes an object parsed from JSON ClipBend data to load into an actual clip bend instance.

    Parameters

    • clipBendData: any

    Returns ClipBend

Generated using TypeDoc