Class Clip

This class represents a clip in Live. It can be either an audio clip or a MIDI clip in the Arrangement or Session View, depending on the track / slot it lives in.

Hierarchy

Properties

raw: RawClip
arrangementPath: string = 'live_set tracks $1 arrangement_clips $2 clip'
sessionPath: string = 'live_set tracks $1 clip_slots $2 clip'

Accessors

  • get id(): undefined | number
  • Returns undefined | number

  • get length(): number
  • The clip's length (duration)

    Memberof

    Clip

    Returns number

  • get name(): string
  • The name of the clip

    Memberof

    Clip

    Returns string

Methods

  • Add new notes to a clip. For MIDI clips only.

    Memberof

    Clip

    Parameters

    Returns Promise<void>

  • Add new notes to a clip. For MIDI clips only.

    Memberof

    Clip

    Parameters

    • notes: Note[]

      as returned from getNotesExtended

    Returns Promise<void>

  • Removes all automation in the clip

    Memberof

    Clip

    Returns Promise<void>

  • Removes the automation of the clip for the given parameter

    Memberof

    Clip

    Parameters

    • Optional deviceParameterId: number

    Returns Promise<void>

  • Crops the clip: if the clip is looped, the region outside the loop is removed; if it isn't, the region outside the start and end markers.

    Memberof

    Clip

    Returns Promise<void>

  • Call this before replace_selected_notes if you just want to add some notes. For MIDI clips only.

    Memberof

    Clip

    Returns Promise<void>

  • Makes the loop two times longer by moving loop_end to the right, and duplicates both the notes and the envelopes. If the clip is not looped, the clip start/end range is duplicated. For MIDI clips only.

    Memberof

    Clip

    Returns Promise<void>

  • Duplicate the notes in the specified region to the destination_time. Only notes of the specified pitch are duplicated or all if pitch is -1. If the transposition_amount is not 0, the notes in the region will be transposed by the transpose_amount of semitones. For MIDI clips only.

    Memberof

    Clip

    Example

    // duplicates 1 bar to the beginning of the next bar
    await clip.duplicateRegion(0, 4, 4);

    Parameters

    • Optional regionStart: number

      beats time

    • Optional regionLength: number

      beats time

    • Optional destinationTime: number

      beats time

    • Optional pitch: number = -1
    • Optional transpositionAmount: number = 0

    Returns Promise<void>

  • Same effect as pressing the Clip Launch button.

    Memberof

    Clip

    Returns Promise<void>

  • Returns a list of notes that start in the given area. The output is similar to get_selected_notes.

    Memberof

    Clip

    Parameters

    • Optional startTime: number = 0
    • Optional timeRange: number = 256
    • Optional startPitch: number = 0
    • Optional pitchRange: number = 127

    Returns Promise<Note[]>

  • Provided note IDs must be associated with existing notes in the clip. Existing notes can be queried with getNotw.

    Memberof

    Clip

    Parameters

    • ids: number[]

      note ids

    Returns Promise<Note[]>

  • Use this if you want to operate on the selected notes

    Memberof

    Clip

    Returns Promise<Note[]>

  • Jumps by given amount, unquantized. Unwarped audio clips, recording audio clips and recording non-overdub MIDI clips cannot jump.

    Memberof

    Clip

    Parameters

    • beats: number

      relative jump distance in beats. Negative beats jump backwards.

    Returns Promise<void>

  • Quantizes all notes in the clip to the quantization_grid taking the song's swing_amount into account.

    Memberof

    Clip

    Parameters

    • quantizationGrid: number
    • amount: number

    Returns Promise<void>

  • Same as quantize, but only for notes in the given pitch.

    Memberof

    Clip

    Parameters

    • pitch: number
    • quantizationGrid: number
    • amount: number

    Returns Promise<void>

  • Deletes all notes that start in the given area.

    Memberof

    Clip

    Parameters

    • Optional startTime: number = 0
    • Optional timeRange: number = 256
    • Optional startPitch: number = 0
    • Optional pitchRange: number = 127

    Returns Promise<void>

  • Deletes all notes associated with the provided IDs.

    Memberof

    Clip

    Parameters

    • ids: number[]

      note ids

    Returns Promise<void>

  • Remove all selected notes

    Memberof

    Clip

    Parameters

    Returns Promise<void>

  • Scrub the clip to a time, specified in beats. This behaves exactly like scrubbing with the mouse; the scrub will respect Global Quantization, starting and looping in time with the transport. The scrub will continue until stopScrub() is called.

    Memberof

    Clip

    Parameters

    • beatTime: number

    Returns Promise<void>

  • Use this function to process all notes of a clip, independent of the current selection.

    Memberof

    Clip

    Returns Promise<void>

  • If the state is set to true, Live simulates pressing the clip start button until the state is set to false, or until the clip is otherwise stopped.

    Memberof

    Clip

    Parameters

    • state: boolean

    Returns Promise<void>

  • Same effect as pressing the stop button of the track, but only if this clip is actually playing or recording. If this clip is triggered or if another clip in this track is playing, it has no effect.

    Memberof

    Clip

    Returns Promise<void>

  • Stops an active scrub on a clip

    Memberof

    Clip

    Returns Promise<void>

  • Parameters

    • trackNumber: number
    • clipSlotNumber: number

    Returns string

  • Parameters

    • trackNumber: number
    • clipSlotNumber: number

    Returns string