@audio/shift-wsola 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +15 -0
- package/package.json +40 -0
package/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { wsola as stretch } from 'time-stretch'
|
|
2
|
+
import { makeStretchShift } from '@audio/shift-core'
|
|
3
|
+
|
|
4
|
+
// Canonical Waveform-Similarity Overlap-Add pitch shift (Verhelst-Roelands). WSOLA
|
|
5
|
+
// time-stretch at `factor = ratio` — each grain's analysis base is nudged by up to
|
|
6
|
+
// ±`delta` samples to maximally correlate with the previous grain's tail, eliminating the
|
|
7
|
+
// grain-rate phase cancellation of plain OLA — followed by anti-aliased sinc resample
|
|
8
|
+
// back to original length. The search makes this a clean time-domain pitch shifter
|
|
9
|
+
// without FFT, at the cost of one cross-correlation per grain.
|
|
10
|
+
let deriveOpts = (opts) => {
|
|
11
|
+
let frameSize = opts?.frameSize ?? 2048
|
|
12
|
+
return { frameSize, hopSize: opts?.hopSize ?? (frameSize >> 2), delta: opts?.tolerance ?? (frameSize >> 2) }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default makeStretchShift(stretch, deriveOpts)
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@audio/shift-wsola",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "WSOLA (Waveform-Similarity Overlap-Add) pitch shift — similarity-search OLA variant",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./index.js",
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"index.js"
|
|
14
|
+
],
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@audio/shift-core": "^1.0.0",
|
|
17
|
+
"time-stretch": "^1.2.1"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "audiojs",
|
|
24
|
+
"homepage": "https://github.com/audiojs/shift/tree/main/packages/shift-wsola#readme",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/audiojs/shift.git",
|
|
28
|
+
"directory": "packages/shift-wsola"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"audio",
|
|
32
|
+
"pitch-shift",
|
|
33
|
+
"wsola",
|
|
34
|
+
"overlap-add",
|
|
35
|
+
"dsp"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18"
|
|
39
|
+
}
|
|
40
|
+
}
|