@audiotool/nexus - v0.0.17
    Preparing search index...

    Type Alias InsertSampleOptions

    Options for inserting a sample into the timeline.

    Grouped by concern:

    • sample: how the sample's audio maps to musical time (tempo, stretch, playback offset within the sample).
    • region: where the resulting region sits on the project timeline.
    • loop: whether and how the region repeats inside itself.
    • attachTo / displayName: target track/device and naming.
    type InsertSampleOptions = {
        attachTo?: NexusEntity<"audioTrack"> | NexusEntity<"audioDevice">;
        displayName?: string;
        loop?: { durationTicks?: number; startTicks?: number } | boolean;
        region?: { durationTicks?: number; positionTicks?: number };
        sample?: {
            bpm?: number | "project";
            musicDurationTicks?: number;
            offsetTicks?: number;
        };
    }
    Index

    Properties

    attachTo?: NexusEntity<"audioTrack"> | NexusEntity<"audioDevice">

    Where to insert the sample:

    • NexusEntity<"audioTrack">: Insert into this existing audio track
    • NexusEntity<"audioDevice">: Create a new track on this device
    • undefined: Create a new AudioDevice and AudioTrack.
    displayName?: string

    Display name for the region and the audio device, if created.

    sample's displayName if available
    
    loop?: { durationTicks?: number; startTicks?: number } | boolean

    Loop configuration.

    • undefined / false: no loop intent — region clips or runs once.
    • true: marker indicating "fill the rest of the region by repeating the sample". Has no audible effect when region.durationTicks equals the sample's musical duration (the default).
    • object: loop a specific sub-range of the sample. startTicks also shifts where the sample begins playing at region start (unless sample.offsetTicks is set explicitly).

    Type declaration

    • { durationTicks?: number; startTicks?: number }
      • OptionaldurationTicks?: number

        Length of the loop content.

        to the end of the sample.
        
      • OptionalstartTicks?: number

        Where the loop starts inside the sample, relative to the sample's start. Also the sample-internal tick that plays at the region's start (when sample.offsetTicks is not set).

        0
        
    • boolean
    region?: { durationTicks?: number; positionTicks?: number }

    Where the resulting region sits on the project timeline.

    Type declaration

    • OptionaldurationTicks?: number

      Region length on the project timeline. If shorter than the sample's musical duration, the sample is clipped. If longer and loop is set, the loop content repeats to fill the remainder.

      the sample's musical duration (or sample.musicDurationTicks when set).

    • OptionalpositionTicks?: number

      Region start on the project timeline.

      0
      
    sample?: {
        bpm?: number | "project";
        musicDurationTicks?: number;
        offsetTicks?: number;
    }

    How the sample's audio maps to musical time.

    Type declaration

    • Optionalbpm?: number | "project"

      Bpm used to convert the sample's real-time duration into ticks.

      • number: Force this bpm, overriding any bpm authored on the sample. With a matching value, the sample plays in sync with the project metronome.
      • "project": Use the project's current bpm at insertion time, ignoring any bpm authored on the sample. Note: this does NOT make the sample tempo-independent. If the project tempo changes after insertion, the sample still stretches accordingly — there is no true "native speed" mode at Audiotool.
      • undefined: Use the sample's authored bpm if present, else fall back to project bpm.

      Ignored if musicDurationTicks is provided.

      If bpm cannot be resolved (no override, no sample bpm, no project bpm via Config).

    • OptionalmusicDurationTicks?: number

      Force the sample's musical duration to this many ticks, regardless of its real-time length. When set, bpm is ignored. Useful when you know exactly how many bars the sample should occupy on the timeline.

    • OptionaloffsetTicks?: number

      Offset into the sample's musical time where playback begins at the region's start. Independent of loop.startTicks. Use this when you want the very first instant of the region to play a sample-internal tick that differs from loop.startTicks.

      0