@audio/synth-risset 1.0.0 → 1.1.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/atom.js +23 -0
- package/package.json +6 -3
package/atom.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// atom manifest — Risset drum (inharmonic partials + gliding fundamental).
|
|
2
|
+
// Generator: no input bus, output width host-negotiated; whole-render (the batch
|
|
3
|
+
// kernel produces its buffer in one call, placed over the materialized timeline —
|
|
4
|
+
// `audio(5).risset()` renders risset over those 5 seconds).
|
|
5
|
+
|
|
6
|
+
import rissetFn from './risset.js'
|
|
7
|
+
|
|
8
|
+
export const risset = (ctx) => {
|
|
9
|
+
return (inputs, outputs, params) => {
|
|
10
|
+
const out = outputs[0]
|
|
11
|
+
if (!out || !out.length) return
|
|
12
|
+
const n = out[0].length
|
|
13
|
+
const d = rissetFn(params.freq[0], { fs: ctx.sampleRate, duration: n / ctx.sampleRate, amp: params.amp[0] })
|
|
14
|
+
const m = Math.min(n, d.length)
|
|
15
|
+
for (let c = 0; c < out.length; c++) { out[c].set(d.subarray(0, m)); out[c].fill(0, m) }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
risset.channels = { inputs: [], outputs: 'any' }
|
|
19
|
+
risset.streaming = false
|
|
20
|
+
risset.params = {
|
|
21
|
+
freq: { type: 'number', min: 30, max: 1000, default: 100, unit: 'Hz', curve: 'log' },
|
|
22
|
+
amp: { type: 'number', min: 0, max: 1, default: 0.6 },
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@audio/synth-risset",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
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
|
+
"./atom": "./atom.js",
|
|
10
11
|
"./package.json": "./package.json"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
|
-
"risset.js"
|
|
14
|
+
"risset.js",
|
|
15
|
+
"atom.js"
|
|
14
16
|
],
|
|
15
17
|
"keywords": [
|
|
16
18
|
"audio",
|
|
@@ -25,5 +27,6 @@
|
|
|
25
27
|
},
|
|
26
28
|
"publishConfig": {
|
|
27
29
|
"access": "public"
|
|
28
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"atom": "./atom.js"
|
|
29
32
|
}
|