@effetune/dsp 0.6.0 → 0.8.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/README.md +7 -7
- package/dist/assets/effetune-dsp.meta.json +49 -12
- package/dist/assets/effetune-dsp.simd.wasm +0 -0
- package/dist/assets/effetune-dsp.wasm +0 -0
- package/dist/assets.js +11 -11
- package/dist/catalog/effects-v1.json +65 -13
- package/dist/effect.js +28 -2
- package/dist/generated-effects.d.ts +6 -6
- package/dist/generated-effects.js +2 -2
- package/dist/graph-engine.js +7 -7
- package/dist/graph.js +4 -4
- package/dist/internal/dsp-params.generated.js +200 -99
- package/dist/internal/ir-asset-payload.js +4 -4
- package/dist/internal/ir-plugin-contract.js +10 -6
- package/dist/preset.js +6 -2
- package/dist/runtime.js +6 -6
- package/dist/schemas/bundle-v1.schema.json +7 -7
- package/dist/schemas/chain-v1.schema.json +67 -15
- package/dist/schemas/graph-v1.schema.json +67 -15
- package/dist/semantics.js +12 -19
- package/dist/telemetry.js +1 -1
- package/dist/worklet.js +11 -4
- package/package.json +1 -1
package/dist/graph-engine.js
CHANGED
|
@@ -29,8 +29,8 @@ function channelSpec(channel) {
|
|
|
29
29
|
if (channel === 'stereo') return -1;
|
|
30
30
|
if (channel === 'left' || channel === '1') return 0;
|
|
31
31
|
if (channel === 'right' || channel === '2') return 1;
|
|
32
|
-
if (/^[3-
|
|
33
|
-
return { '34': 17, '56': 18, '78': 19 }[channel];
|
|
32
|
+
if (/^([3-9]|1[0-6])$/.test(channel)) return Number(channel) - 1;
|
|
33
|
+
return { '34': 17, '56': 18, '78': 19, '910': 20, '1112': 21, '1314': 22, '1516': 23 }[channel];
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export function effectiveNodeIds(document) {
|
|
@@ -143,7 +143,7 @@ function optionalSlot(value) {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
export function decodeGraphSnapshot(bytes, document) {
|
|
146
|
-
if (!(bytes instanceof Uint8Array) || bytes.byteLength <
|
|
146
|
+
if (!(bytes instanceof Uint8Array) || bytes.byteLength < 192) {
|
|
147
147
|
throw new EffeTuneRuntimeError('DSP returned an invalid Graph compile snapshot.');
|
|
148
148
|
}
|
|
149
149
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
@@ -161,7 +161,7 @@ export function decodeGraphSnapshot(bytes, document) {
|
|
|
161
161
|
const edgesOffset = view.getUint32(56, true);
|
|
162
162
|
const totalBytes = view.getUint32(60, true);
|
|
163
163
|
if (nodeCount !== document.nodes.length || edgeCount !== document.edges.length ||
|
|
164
|
-
channels < 1 || channels >
|
|
164
|
+
channels < 1 || channels > 16 || nodeBytes !== 224 || edgeBytes !== 80 ||
|
|
165
165
|
totalBytes !== bytes.byteLength) {
|
|
166
166
|
throw new EffeTuneRuntimeError('DSP returned an inconsistent Graph compile snapshot.');
|
|
167
167
|
}
|
|
@@ -185,8 +185,8 @@ export function decodeGraphSnapshot(bytes, document) {
|
|
|
185
185
|
},
|
|
186
186
|
kernelLatency: view.getUint32(offset + 24, true),
|
|
187
187
|
inputLatency: vector(view, offset + 32, channels),
|
|
188
|
-
outputLatency: vector(view, offset +
|
|
189
|
-
preNodeCompensation: vector(view, offset +
|
|
188
|
+
outputLatency: vector(view, offset + 96, channels),
|
|
189
|
+
preNodeCompensation: vector(view, offset + 160, channels)
|
|
190
190
|
};
|
|
191
191
|
});
|
|
192
192
|
const edges = document.edges.map((edge, index) => {
|
|
@@ -209,7 +209,7 @@ export function decodeGraphSnapshot(bytes, document) {
|
|
|
209
209
|
nodes,
|
|
210
210
|
edges,
|
|
211
211
|
outputLatency: vector(view, 64, channels),
|
|
212
|
-
outputCompensation: vector(view,
|
|
212
|
+
outputCompensation: vector(view, 128, channels),
|
|
213
213
|
latencySamples: view.getUint32(28, true),
|
|
214
214
|
capacity: {
|
|
215
215
|
bufferSlots: view.getUint32(24, true),
|
package/dist/graph.js
CHANGED
|
@@ -26,8 +26,8 @@ const STREAM_SAFE_PARAMETERS = new Map([
|
|
|
26
26
|
]);
|
|
27
27
|
|
|
28
28
|
function validateAudio(audio) {
|
|
29
|
-
if (!Array.isArray(audio) || audio.length < 1 || audio.length >
|
|
30
|
-
throw new ValidationError('Audio must be an array containing between 1 and
|
|
29
|
+
if (!Array.isArray(audio) || audio.length < 1 || audio.length > 16) {
|
|
30
|
+
throw new ValidationError('Audio must be an array containing between 1 and 16 Float32Array channels.');
|
|
31
31
|
}
|
|
32
32
|
const frames = audio[0] instanceof Float32Array ? audio[0].length : -1;
|
|
33
33
|
for (const channel of audio) {
|
|
@@ -49,8 +49,8 @@ function validateBlockSize(value = 128) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
function validateChannels(channels) {
|
|
52
|
-
if (!Number.isInteger(channels) || channels < 1 || channels >
|
|
53
|
-
throw new ValidationError('channels must be an integer from 1 to
|
|
52
|
+
if (!Number.isInteger(channels) || channels < 1 || channels > 16) {
|
|
53
|
+
throw new ValidationError('channels must be an integer from 1 to 16.');
|
|
54
54
|
}
|
|
55
55
|
return channels;
|
|
56
56
|
}
|