@audio/synth-rhythm 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 +43 -0
  2. package/package.json +7 -3
package/audio.d.ts ADDED
@@ -0,0 +1,43 @@
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 'rhythm' */
12
+ export interface RhythmOptions {
13
+ /** 20..300 (default 120) */
14
+ "bpm"?: Auto
15
+ /** 1..12 (default 4) */
16
+ "beats"?: Auto
17
+ /** 200..4000 Hz (default 1000) */
18
+ "freq"?: Auto
19
+ /** 200..6000 Hz (default 1500) */
20
+ "accentFreq"?: Auto
21
+ /** 0..1 (default 0.7) */
22
+ "amp"?: Auto
23
+ at?: number | string
24
+ duration?: number | string
25
+ }
26
+
27
+ export declare const rhythm: {
28
+ (ctx: Ctx): Process
29
+ channels: {"inputs":[],"outputs":"any"}
30
+ streaming: false
31
+ params: {
32
+ /** 20..300 (default 120) */
33
+ "bpm": { type: "number", default: 120 }
34
+ /** 1..12 (default 4) */
35
+ "beats": { type: "number", default: 4 }
36
+ /** 200..4000 Hz (default 1000) */
37
+ "freq": { type: "number", default: 1000 }
38
+ /** 200..6000 Hz (default 1500) */
39
+ "accentFreq": { type: "number", default: 1500 }
40
+ /** 0..1 (default 0.7) */
41
+ "amp": { type: "number", default: 0.7 }
42
+ }
43
+ }
package/package.json CHANGED
@@ -1,18 +1,22 @@
1
1
  {
2
2
  "name": "@audio/synth-rhythm",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Rhythm / click track — BPM grid with accented downbeats",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "rhythm.js",
8
8
  "exports": {
9
9
  ".": "./rhythm.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
  "rhythm.js",
15
- "audio.js"
18
+ "audio.js",
19
+ "audio.d.ts"
16
20
  ],
17
21
  "keywords": [
18
22
  "audio",