npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@audio/shift-paulstretch

v1.1.4

Published

Paulstretch-style randomized-phase pitch shift for textural blur

Readme

@audio/shift-paulstretch npm MIT

Paulstretch-style randomized-phase pitch shift for textural blur

npm install @audio/shift-paulstretch
import paulstretch from '@audio/shift-paulstretch'

Large-frame (16k) phase randomization. Magnitudes pulled from source bins at k/ratio; phases drawn from a seeded PRNG every frame. Destroys temporal structure by design.

paulstretch(audio, { ratio: 1.5 })
paulstretch(audio, { ratio: 1.5, seed: 42 })

| Param | Default | | |---|---|---| | seed | fixed (0x1f123bb5) | 32-bit PRNG seed for the per-frame phase draw |

Deterministic: the same seed (the shipped default, or one you pass) always reproduces the same phase sequence and therefore byte-identical output. Pass seed to get a different, still-reproducible draw.

Preserves long-term magnitude-spectrum statistics. Destroys phase, transients, rhythm — by design.

| f0 err | THD% | alias | attack corr | formant dist | phase coh | shift | |-------:|-----:|------:|------------:|-------------:|----------:|------:| | 0.00 | 0.2 | 0.230 | 0.935 | 7.371 | 0.518 | 2.221 |

Worst formant dist by a wide margin (7.371 — the next-worst is granular at 3.486) because random phases smear spectral energy across the frame; the smear is the aesthetic. Alias 0.230 is the same smear leaking past Nyquist.

Use when: Ambient/drone textures, extreme shift ratios. Not for: Anything requiring temporal precision.

Stream

let write = paulstretch({ ratio: 1.5 })
let out = write(inputBlock)
let tail = write()  // flush

paulstretch streams per-frame: each write(chunk) call renormalizes and emits audio as soon as a frame completes, and re-chunking the same input differently reproduces the batch output byte for byte.

Data

Input is a Float32Array (mono) or an array of Float32Array channels ([left, right, ...]) — anything else throws TypeError. ratio also accepts a function t => ratio (seconds from stream start) or a Float32Array breakpoint envelope (resampled across the input via ratioDuration, default the input's own duration) for time-varying pitch.


Part of @audio/shift — the shift family umbrella. This README is generated from the umbrella docs.

MIT © audiojs