@audio/eq 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/LICENSE +40 -0
- package/README.md +15 -0
- package/index.d.ts +66 -0
- package/index.js +13 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Kṛṣnized
|
|
2
|
+
|
|
3
|
+
This is a reminder that, in the absolute sense, all results of work belong to the Supreme.
|
|
4
|
+
|
|
5
|
+
While software and intellectual property (IP) require a formal license to define authorship,
|
|
6
|
+
responsibilities, or distribution limitations, these are temporary material designations.
|
|
7
|
+
The origin and destination of all ideas, as well as the ultimate owner of all results,
|
|
8
|
+
is the Supreme. The most meaningful action is to dedicate these results to the Supreme.
|
|
9
|
+
This process is known as Karma-Yoga and is described in BG 3.9, BG 12.10 and BG 18.46.
|
|
10
|
+
|
|
11
|
+
"Work done as a sacrifice for the Supreme must be performed;
|
|
12
|
+
otherwise, work binds one to the material world."
|
|
13
|
+
|
|
14
|
+
This license does not override or alter the terms specified by the material-level license below.
|
|
15
|
+
|
|
16
|
+
ॐ
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
MIT License
|
|
21
|
+
|
|
22
|
+
Copyright (c) Dmitry Iv
|
|
23
|
+
|
|
24
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
25
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
26
|
+
in the Software without restriction, including without limitation the rights
|
|
27
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
28
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
29
|
+
furnished to do so, subject to the following conditions:
|
|
30
|
+
|
|
31
|
+
The above copyright notice and this permission notice shall be included in all
|
|
32
|
+
copies or substantial portions of the Software.
|
|
33
|
+
|
|
34
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
35
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
36
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
37
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
38
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
39
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
40
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @audio/eq
|
|
2
|
+
|
|
3
|
+
> Equalization & tone shaping — shelves, parametric, graphic, baxandall, tilt, crossover.
|
|
4
|
+
|
|
5
|
+
| Package | What |
|
|
6
|
+
|---|---|
|
|
7
|
+
| `@audio/eq-lowshelf` / `@audio/eq-highshelf` | RBJ shelving filters |
|
|
8
|
+
| `@audio/eq-parametric` | multi-band parametric EQ |
|
|
9
|
+
| `@audio/eq-graphic` | ISO 266 10-band graphic EQ |
|
|
10
|
+
| `@audio/eq-baxandall` | Baxandall bass/treble tone control |
|
|
11
|
+
| `@audio/eq-tilt` | one-knob see-saw tilt EQ |
|
|
12
|
+
| `@audio/eq-crossover` | Linkwitz-Riley N-way crossover |
|
|
13
|
+
| `@audio/eq-fir` (planned) | linear-phase FIR EQ from arbitrary response — firequalizer / match-EQ |
|
|
14
|
+
|
|
15
|
+
Extracted from [filter](https://github.com/audiojs/filter). Headphone crossfeed moved to `@audio/spatial-crossfeed`.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
type Buf = Float32Array | Float64Array | number[]
|
|
2
|
+
interface BiquadCoef { b0: number; b1: number; b2: number; a1: number; a2: number }
|
|
3
|
+
type SOS = BiquadCoef[]
|
|
4
|
+
|
|
5
|
+
export interface GraphicEqParams {
|
|
6
|
+
gains?: Record<number, number> // { 31.5: dB, 63: dB, 125: dB, 250: dB, 500: dB, 1000: dB, 2000: dB, 4000: dB, 8000: dB, 16000: dB } — ISO 266 / IEC 61260-1 1/1-octave nominal band keys only, unset keys default to 0 dB
|
|
7
|
+
fs?: number
|
|
8
|
+
[key: string]: unknown
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** ISO 266 octave-band graphic equalizer (10 bands: 31.5 Hz – 16 kHz), in-place, cascaded biquads */
|
|
12
|
+
export function graphicEq(data: Buf, params: GraphicEqParams): Buf
|
|
13
|
+
|
|
14
|
+
export interface PeqBand {
|
|
15
|
+
fc: number
|
|
16
|
+
Q?: number // default 1 for type 'peak', 0.707 (RBJ maximally-flat) for 'lowshelf'/'highshelf'
|
|
17
|
+
gain?: number // dB (default 0)
|
|
18
|
+
type?: 'peak' | 'lowshelf' | 'highshelf' // default 'peak'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ParametricEqParams {
|
|
22
|
+
bands?: PeqBand[]
|
|
23
|
+
fs?: number
|
|
24
|
+
[key: string]: unknown
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Multi-band parametric EQ, in-place. Filters rebuild automatically whenever any band's fc/Q/gain/type or fs changes. */
|
|
28
|
+
export function parametricEq(data: Buf, params: ParametricEqParams): Buf
|
|
29
|
+
|
|
30
|
+
/** Linkwitz-Riley crossover — returns one SOS array per output band. order default 4, fs default 44100. For order ≡ 2 (mod 4) (LR2, LR6, …) alternate bands are polarity-inverted internally so the returned bands sum flat by construction. */
|
|
31
|
+
export function crossover(frequencies: number[], order?: number, fs?: number): SOS[]
|
|
32
|
+
|
|
33
|
+
export interface ShelfParams {
|
|
34
|
+
fc?: number // corner frequency Hz — default 200 for lowShelf, 4000 for highShelf
|
|
35
|
+
gain?: number // dB boost/cut (default 0)
|
|
36
|
+
Q?: number // slope control (default 0.707)
|
|
37
|
+
fs?: number // sample rate (default 44100)
|
|
38
|
+
[key: string]: unknown
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Low-shelf filter — boost or cut below corner frequency. fc default 200 Hz. */
|
|
42
|
+
export function lowShelf(data: Buf, params: ShelfParams): Buf
|
|
43
|
+
/** High-shelf filter — boost or cut above corner frequency. fc default 4000 Hz. */
|
|
44
|
+
export function highShelf(data: Buf, params: ShelfParams): Buf
|
|
45
|
+
|
|
46
|
+
export interface BaxandallParams {
|
|
47
|
+
bass?: number // dB (default 0)
|
|
48
|
+
treble?: number // dB (default 0)
|
|
49
|
+
fBass?: number // bass pivot Hz (default 250)
|
|
50
|
+
fTreble?: number // treble pivot Hz (default 4000)
|
|
51
|
+
fs?: number
|
|
52
|
+
[key: string]: unknown
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Baxandall bass/treble tone control — cascaded low-shelf + high-shelf */
|
|
56
|
+
export function baxandall(data: Buf, params: BaxandallParams): Buf
|
|
57
|
+
|
|
58
|
+
export interface TiltParams {
|
|
59
|
+
gain?: number // dB: positive = bass up / treble down (default 0)
|
|
60
|
+
pivot?: number // pivot frequency Hz (default 1000)
|
|
61
|
+
fs?: number
|
|
62
|
+
[key: string]: unknown
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Tilt EQ — see-saw around a pivot frequency */
|
|
66
|
+
export function tilt(data: Buf, params: TiltParams): Buf
|
package/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @audio/eq — equalization & tone shaping umbrella re-exporting every @audio/eq-* atom.
|
|
2
|
+
// For smaller bundles, depend directly on the individual atom.
|
|
3
|
+
// Headphone crossfeed lives in @audio/spatial-crossfeed.
|
|
4
|
+
|
|
5
|
+
export { default as graphicEq } from '@audio/eq-graphic'
|
|
6
|
+
export { default as parametricEq } from '@audio/eq-parametric'
|
|
7
|
+
export { default as crossover } from '@audio/eq-crossover'
|
|
8
|
+
export { default as lowShelf } from '@audio/eq-lowshelf'
|
|
9
|
+
export { default as highShelf } from '@audio/eq-highshelf'
|
|
10
|
+
export { default as baxandall } from '@audio/eq-baxandall'
|
|
11
|
+
export { default as tilt } from '@audio/eq-tilt'
|
|
12
|
+
export { default as firEq, design as firDesign } from '@audio/eq-fir'
|
|
13
|
+
export { default as dynamicEq } from '@audio/eq-dynamic'
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@audio/eq",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"description": "Equalization & tone shaping — umbrella for @audio/eq-* atoms (shelves, parametric, graphic, baxandall, tilt, crossover)",
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"default": "./index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"index.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"workspaces": [
|
|
20
|
+
"packages/*"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"audio",
|
|
24
|
+
"eq",
|
|
25
|
+
"equalizer",
|
|
26
|
+
"dsp",
|
|
27
|
+
"parametric",
|
|
28
|
+
"graphic"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@audio/eq-highshelf": "^1.0.0",
|
|
33
|
+
"@audio/eq-lowshelf": "^1.0.0",
|
|
34
|
+
"@audio/eq-parametric": "^1.0.0",
|
|
35
|
+
"@audio/eq-graphic": "^1.0.0",
|
|
36
|
+
"@audio/eq-baxandall": "^1.0.0",
|
|
37
|
+
"@audio/eq-tilt": "^1.0.0",
|
|
38
|
+
"@audio/eq-crossover": "^1.0.0",
|
|
39
|
+
"@audio/eq-fir": "^1.0.0",
|
|
40
|
+
"@audio/eq-dynamic": "^1.0.0"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"author": "Dmitry Iv. <dfcreative@gmail.com>",
|
|
49
|
+
"scripts": {
|
|
50
|
+
"test": "node test.js",
|
|
51
|
+
"test:all": "npm test --workspaces --if-present && npm test",
|
|
52
|
+
"publish:all": "npm publish --workspaces && npm publish"
|
|
53
|
+
},
|
|
54
|
+
"types": "index.d.ts",
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"tst": "^9.4.0"
|
|
57
|
+
}
|
|
58
|
+
}
|