Skip to main content

pack

pack(
@buffers ## llll (required)
@resamplingfiltersize 11
@resamplingmode 'sinc'
@resamplingpolicy 3
) -> llll

Combines multiple buffers as channels into a single buffer.


Arguments

  • @buffers [llll]: Audio samples to convert to a buffer. (required)
  • @resamplingfiltersize [int]: Resampling filter size. (default: 11).
  • @resamplingmode [symbol]: Resampling mode. (default: 'sinc').
    • 'sinc'
    • 'nearest neighbor'
    • 'sample and hold'
    • 'linear'
    • 'quad'
    • 'cubic'
  • @resamplingpolicy [int]: Resampling policy. (default: 3).
    • 0: Don't
    • 1: To lowest
    • 2: To highest
    • 3: To most common
    • 4: To max. current

Output

New buffer [llll]


Usage

$dur = 1000;
$chan1 = cycle(440, $dur).process(
gain([0 0.1 0] [1 0 0.125])
);
$chan2 = noise($dur).process(
gain([0 0 0] [1 0.1 0.125])
);
$chan1.view('first channel');
$chan2.view('second channel');
$packed = pack($chan1 $chan2);
$packed.view('packed channels')