@audio/synth-risset 1.1.1 → 1.1.3

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/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @audio/synth-risset [![npm](https://img.shields.io/npm/v/@audio/synth-risset)](https://www.npmjs.com/package/@audio/synth-risset) [![MIT](https://img.shields.io/badge/MIT-%E0%A5%90-white)](https://github.com/krishnized/license)
2
+
3
+ Risset drum (inharmonic bell-drum)
4
+
5
+ ```
6
+ npm install @audio/synth-risset
7
+ ```
8
+
9
+ ```js
10
+ import risset from '@audio/synth-risset'
11
+ ```
12
+
13
+ Risset drum: a fixed set of five inharmonic partials plus a sub-sine an octave below with slower decay, a simplified take on Risset's classic bell-drum catalogue. Amplitude-normalized to `amp` at the peak. Pitched — `(freq, opts)`.
14
+
15
+ ```js
16
+ risset(100, { duration: 1.2 }) // → Float32Array
17
+ ```
18
+
19
+ | Param | Default | |
20
+ |---|---|---|
21
+ | `freq` | — | Hz (positional) |
22
+ | `duration` | `1.2` | Seconds |
23
+ | `amp` | `0.6` | Peak amplitude (post-normalization) |
24
+ | `fs` | `44100` | Sample rate |
25
+
26
+ **Use when:** a cheap inharmonic drum/bell hybrid distinct from the literature-grounded [`synth-modal`](https://github.com/audiojs/synth/tree/main/packages/synth-modal).
27
+
28
+ ---
29
+
30
+ Part of [@audio/synth](https://github.com/audiojs/synth) — the synth family umbrella.
31
+
32
+ MIT © [audiojs](https://github.com/audiojs)
package/audio.d.ts ADDED
@@ -0,0 +1,31 @@
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 'risset' */
12
+ export interface RissetOptions {
13
+ /** 30..1000 Hz (default 100) */
14
+ "freq"?: Auto
15
+ /** 0..1 (default 0.6) */
16
+ "amp"?: Auto
17
+ at?: number | string
18
+ duration?: number | string
19
+ }
20
+
21
+ export declare const risset: {
22
+ (ctx: Ctx): Process
23
+ channels: {"inputs":[],"outputs":"any"}
24
+ streaming: false
25
+ params: {
26
+ /** 30..1000 Hz (default 100) */
27
+ "freq": { type: "number", default: 100 }
28
+ /** 0..1 (default 0.6) */
29
+ "amp": { type: "number", default: 0.6 }
30
+ }
31
+ }
package/package.json CHANGED
@@ -1,19 +1,25 @@
1
1
  {
2
2
  "name": "@audio/synth-risset",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Risset drum — inharmonic partial set with exponential decay",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "risset.js",
8
8
  "exports": {
9
9
  ".": "./risset.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
  "risset.js",
15
- "audio.js"
18
+ "risset.d.ts",
19
+ "audio.js",
20
+ "audio.d.ts"
16
21
  ],
22
+ "types": "risset.d.ts",
17
23
  "keywords": [
18
24
  "audio",
19
25
  "dsp",
@@ -28,5 +34,11 @@
28
34
  "publishConfig": {
29
35
  "access": "public"
30
36
  },
31
- "audio": "./audio.js"
37
+ "audio": "./audio.js",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/audiojs/synth.git",
41
+ "directory": "packages/synth-risset"
42
+ },
43
+ "funding": "https://github.com/sponsors/audiojs"
32
44
  }
package/risset.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /** Risset drum — inharmonic partials + octave-below sub-sine, simplified bell-drum catalogue. */
2
+ export interface RissetOptions {
3
+ /** sample rate, default 44100 */
4
+ fs?: number
5
+ /** seconds, default 1.2 */
6
+ duration?: number
7
+ /** peak amplitude (post-normalization), default 0.6 */
8
+ amp?: number
9
+ }
10
+
11
+ /** freq: Hz (positional) */
12
+ export default function risset(freq?: number, options?: RissetOptions): Float32Array