From 54423c34dbc28d1bdb433e528a699c4d9adf4e53 Mon Sep 17 00:00:00 2001 From: Geraint Date: Wed, 16 Apr 2025 11:57:23 +0100 Subject: [PATCH] Release v1.2.0 --- signalsmith-stretch.h | 7 +------ web/release/README.md | 16 ++++++++++++++-- web/release/package.json | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/signalsmith-stretch.h b/signalsmith-stretch.h index 83f7bb9..5a538b4 100644 --- a/signalsmith-stretch.h +++ b/signalsmith-stretch.h @@ -1,11 +1,6 @@ #ifndef SIGNALSMITH_STRETCH_H #define SIGNALSMITH_STRETCH_H -//#include "dsp/spectral.h" -//#include "dsp/delay.h" -//#include "dsp/perf.h" -//SIGNALSMITH_DSP_VERSION_CHECK(1, 6, 0); // Check version is compatible - #include "signalsmith-linear/stft.h" // https://github.com/Signalsmith-Audio/linear #include #include @@ -35,7 +30,7 @@ namespace _impl { template struct SignalsmithStretch { - static constexpr size_t version[3] = {1, 1, 1}; + static constexpr size_t version[3] = {1, 2, 0}; SignalsmithStretch() : randomEngine(std::random_device{}()) {} SignalsmithStretch(long seed) : randomEngine(seed) {} diff --git a/web/release/README.md b/web/release/README.md index 5477994..f086db5 100644 --- a/web/release/README.md +++ b/web/release/README.md @@ -4,9 +4,9 @@ This is an official release of the Signalsmith Stretch library for Web Audio, us ## How to use it -Call `SignalsmithStretch(audioContext, ?channelOptions)` from the main thread. This returns a Promise which resolves to an `AudioNode`, with extra methods attached to it. +Call `SignalsmithStretch(audioContext, ?channelOptions)` from the main thread. This returns a Promise which resolves to an `AudioNode`, with extra methods attached to it. The optional [`channelOptions` object](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/AudioWorkletNode#options) can specify the number of inputs/outputs and channels. -It can operate either on live/streaming input, or on a sample buffer you load into it. +It can operate either on live/streaming input (if you configure it to have an input), or on a sample buffer you load into it. ### `stretch.inputTime` @@ -44,3 +44,15 @@ This drops all input buffers, and resets the input buffer start time to 0. This drops all input buffers before the given time. It returns (as a Promise) the an object with the current input buffer extent: `{start: ..., end: ...}`. This can be useful when processing streams or very long audio files, letting the Stretch node release old buffers once that section of the input will no longer be played back. + +### `stretch.latency()` + +Returns the latency when used in "live" mode. This is also how far ahead you might want to schedule things (`output` in `.schedule()`) to give the node enough time to fully compensate for its own latency. + +### `stretch.configure({...})` + +Optionally reconfigure, with the following fields: + +* `blockMs`: block length in ms (default 120ms) +* `intervalMs`: interval (default is 30ms) +* `splitComputation`: spread computation more evenly across time (default `false`, but worth trying if you're getting dropouts) diff --git a/web/release/package.json b/web/release/package.json index f92fbf5..5d4bb12 100644 --- a/web/release/package.json +++ b/web/release/package.json @@ -1,6 +1,6 @@ { "name": "signalsmith-stretch", - "version": "1.1.1", + "version": "1.2.0", "description": "JS/WASM release of the Signalsmith Stretch library", "main": "SignalsmithStretch.mjs", "exports": {