Docs
Reference
el.mc.sampleseq2

el.mc.sampleseq2(props, t)

The mc.sampleseq2 is equivalent to el.mc.sampleseq, except that it adds the ability for pitch shifting and time stretching the source sample during playback. See el.sampleseq and the corresponding el.sampleseq2 for a thorough description of the utility here.

This node is nearly identical to the el.sampleseq2 node, except that el.mc.sampleseq2 supports multi-channel buffers through the virtual file system and produces multi-channel output. The return value of el.mc.sampleseq2 is an array containing the indivdual channel signals you want to address.

let [leftChannel, rightChannel] = el.mc.sampleseq2({
  channels: 2,
  seq: [
    { time: 0.0, value: 1 },
    { time: 0.5, value: 0 },
    { time: 1.0, value: 1 },
    { time: 1.5, value: 0 },
  ],
  path: '/path/to/stereoVocals.wav',
  duration: 4,
  shift: 7,
  stretch: 2,
}, el.div(el.time(), el.sr()));

Props

NameDefaultTypeDescription
seq[]ArrayThe sequence of values to generate, in { time, value } pairs
path""stringThe path to the resource in the virtual file system to play back
duration0numberDuration of the sample buffer. Must be in the same units as the time signal
shift0numberPitch shift amount in semitones
stretch1numberTime stretch amount, in the range [0.25, 4]
channelsNoneNumberThe number of output channels to address