Release v1.2.0

This commit is contained in:
Geraint 2025-04-16 11:57:23 +01:00
parent 322f611c38
commit 54423c34db
3 changed files with 16 additions and 9 deletions

View File

@ -1,11 +1,6 @@
#ifndef SIGNALSMITH_STRETCH_H #ifndef SIGNALSMITH_STRETCH_H
#define 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 "signalsmith-linear/stft.h" // https://github.com/Signalsmith-Audio/linear
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
@ -35,7 +30,7 @@ namespace _impl {
template<typename Sample=float, class RandomEngine=void> template<typename Sample=float, class RandomEngine=void>
struct SignalsmithStretch { 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() : randomEngine(std::random_device{}()) {}
SignalsmithStretch(long seed) : randomEngine(seed) {} SignalsmithStretch(long seed) : randomEngine(seed) {}

View File

@ -4,9 +4,9 @@ This is an official release of the Signalsmith Stretch library for Web Audio, us
## How to use it ## 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` ### `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 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. 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)

View File

@ -1,6 +1,6 @@
{ {
"name": "signalsmith-stretch", "name": "signalsmith-stretch",
"version": "1.1.1", "version": "1.2.0",
"description": "JS/WASM release of the Signalsmith Stretch library", "description": "JS/WASM release of the Signalsmith Stretch library",
"main": "SignalsmithStretch.mjs", "main": "SignalsmithStretch.mjs",
"exports": { "exports": {