@audio/shift-ola 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 +14 -0
- package/package.json +40 -0
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { wsola as stretch } from 'time-stretch'
|
|
2
|
+
import { makeStretchShift } from '@audio/shift-core'
|
|
3
|
+
|
|
4
|
+
// Overlap-Add pitch shift. Plain OLA time-stretch at `factor = ratio` — no similarity
|
|
5
|
+
// search (delta=0), so grains are placed at nominal analysis positions — followed by
|
|
6
|
+
// anti-aliased sinc resample back to original length. The simplest stretch+resample
|
|
7
|
+
// pitch shift — the baseline the others improve on. For the same form with per-grain
|
|
8
|
+
// similarity search, use `wsola`.
|
|
9
|
+
let deriveOpts = (opts) => {
|
|
10
|
+
let frameSize = opts?.frameSize ?? 2048
|
|
11
|
+
return { frameSize, hopSize: opts?.hopSize ?? (frameSize >> 2), delta: 0 }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default makeStretchShift(stretch, deriveOpts)
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@audio/shift-ola",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "OLA (Overlap-Add) pitch shift — simplest stretch+resample baseline",
|
|
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-ola#readme",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/audiojs/shift.git",
|
|
28
|
+
"directory": "packages/shift-ola"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"audio",
|
|
32
|
+
"pitch-shift",
|
|
33
|
+
"ola",
|
|
34
|
+
"overlap-add",
|
|
35
|
+
"dsp"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18"
|
|
39
|
+
}
|
|
40
|
+
}
|