@audio/synth-envelope 1.1.1 → 1.1.2

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.
Files changed (2) hide show
  1. package/audio.d.ts +39 -0
  2. package/package.json +7 -3
package/audio.d.ts ADDED
@@ -0,0 +1,39 @@
1
+ // Generated from the audio.js manifest (params metadata is the source of truth).
2
+ // Regenerate: node tools/dts.js in @audio/compile. Do not edit by hand.
3
+
4
+ /** Automatable number — scalar, `t => value` fn, or breakpoint curve {t, v} */
5
+ type Auto = number | ((t: number) => number) | { t: number[], v: number[] }
6
+ /** Per-block param values as delivered by hosts (numbers arrive as 1-length Float32Array) */
7
+ type Live = Record<string, Float32Array | string | boolean>
8
+ type Ctx = { sampleRate: number, maxBlockSize: number, maxChannels: number, currentTime: number, duration?: number, events?: readonly any[], emit?: (name: string, ...args: any[]) => void, [k: string]: unknown }
9
+ type Process = (inputs: Float32Array[][], outputs: Float32Array[][], params: Live) => void
10
+
11
+ /** Chainable-host options for 'adsr' */
12
+ export interface AdsrOptions {
13
+ /** 0.001..2 s (default 0.01) */
14
+ "attack"?: Auto
15
+ /** 0.001..2 s (default 0.1) */
16
+ "decay"?: Auto
17
+ /** 0..1 (default 0.7) */
18
+ "sustain"?: Auto
19
+ /** 0.001..4 s (default 0.3) */
20
+ "release"?: Auto
21
+ at?: number | string
22
+ duration?: number | string
23
+ }
24
+
25
+ export declare const adsr: {
26
+ (ctx: Ctx): Process
27
+ channels: "any"
28
+ streaming: false
29
+ params: {
30
+ /** 0.001..2 s (default 0.01) */
31
+ "attack": { type: "number", default: 0.01 }
32
+ /** 0.001..2 s (default 0.1) */
33
+ "decay": { type: "number", default: 0.1 }
34
+ /** 0..1 (default 0.7) */
35
+ "sustain": { type: "number", default: 0.7 }
36
+ /** 0.001..4 s (default 0.3) */
37
+ "release": { type: "number", default: 0.3 }
38
+ }
39
+ }
package/package.json CHANGED
@@ -1,18 +1,22 @@
1
1
  {
2
2
  "name": "@audio/synth-envelope",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "ADSR envelope generator — gain contour for amplitude/filter modulation",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "envelope.js",
8
8
  "exports": {
9
9
  ".": "./envelope.js",
10
- "./audio": "./audio.js",
10
+ "./audio": {
11
+ "types": "./audio.d.ts",
12
+ "default": "./audio.js"
13
+ },
11
14
  "./package.json": "./package.json"
12
15
  },
13
16
  "files": [
14
17
  "envelope.js",
15
- "audio.js"
18
+ "audio.js",
19
+ "audio.d.ts"
16
20
  ],
17
21
  "keywords": [
18
22
  "audio",