Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 1.92 KB

File metadata and controls

45 lines (29 loc) · 1.92 KB

@soundtouchjs/interpolation-strategy-linear

Linear interpolation strategy plugin for SoundTouchJS.

I accept cash if you like what's been done.

Part of the SoundTouchJS monorepo — for more information and so much more.

Usage

import { registerInterpolationStrategy, SoundTouch } from '@soundtouchjs/core';
import { registerLinearStrategy } from '@soundtouchjs/interpolation-strategy-linear';

registerLinearStrategy({ registerInterpolationStrategy });

const st = new SoundTouch({
  interpolationStrategy: 'linear',
});

st.setInterpolationStrategyParams({ edgeHoldFrames: 3 });

Params

  • edgeHoldFrames (default 1, normalized to 0..32) — frames held at edges to avoid clicks
  • blend (default 1, normalized to 0..1) — 1 = pure linear interpolation; 0 = nearest-neighbor; values between blend the two
  • normalize (default false) — when true, kernel weights are normalized to sum to 1
  • zeroCrossings — alias for edgeHoldFrames (accepted for cross-strategy API consistency)

Related docs

Exports

  • linearKernel: Interpolation kernel implementation.
  • linearStrategy: Strategy descriptor with id linear.
  • registerLinearStrategy: Helper that registers linearStrategy into a compatible registry.
  • linearStrategy.defaultParams: Runtime defaults for strategy params.

License

MPL-2.0 — see LICENSE for details.