Skip to content

Commit fcb9552

Browse files
committed
restructure README: Browser Demos with subsections, new Examples section
- Rename Demo to Browser Demos; split into Live Spectrogram and In-browser Benchmark subsections with technical descriptions and linked headings. - Add Examples section between Quickstart and Benchmarks, housing the trumpet spectrograms image with a reproduction pointer to scripts/example.py. - Point the opening paragraph's first link at Alexandre's project page rather than the paper (paper still linked in Credits).
1 parent 515861c commit fcb9552

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# resonato**rs**
22

3-
A Rust implementation of Alexandre François's [Resonate algorithm][paper] for low-latency spectral analysis, with Python and WebAssembly bindings.
3+
A Rust implementation of Alexandre François's [Resonate algorithm][resonate] for low-latency spectral analysis, with Python and WebAssembly bindings.
44

55
[![crates.io](https://img.shields.io/crates/v/resonators.svg)](https://crates.io/crates/resonators)
66
[![PyPI](https://img.shields.io/pypi/v/resonators.svg)](https://pypi.org/project/resonators/)
@@ -33,16 +33,17 @@ It's based on Alexandre's reference implementation, [noFFT][nofft], which is wri
3333
- General-purpose STFT or CQT analysis: use [librosa](https://librosa.org/) or similar
3434
- Offline batch where FFT's O(N log N) per frame is fine
3535

36-
## Demo
36+
## Browser Demos
3737

38-
![live spectrogram demo screenshot](images/spectrogram-demo.png)
38+
### [Live Spectrogram](https://jhartquist.github.io/resonators/spectrogram/)
3939

40-
*[Try it in your browser](https://jhartquist.github.io/resonators/spectrogram/).*
40+
[![live spectrogram demo screenshot](images/spectrogram-demo.png)](https://jhartquist.github.io/resonators/spectrogram/)
4141

42-
Live in the browser:
42+
Loads the WASM build of the crate into an `AudioWorkletNode`, feeds it live microphone samples through a bank of 440 resonators (5 per semitone from A0 to C8), and writes the bank's magnitudes into a ring-buffer R32F texture. A WebGL2 fragment shader samples the texture, converts to dB, and applies a colormap.
4343

44-
- [**Spectrogram**](https://jhartquist.github.io/resonators/spectrogram/): feed your mic through a resonator bank in real time
45-
- [**Benchmark**](https://jhartquist.github.io/resonators/bench/): run the WASM bank in your browser
44+
### [In-browser Benchmark](https://jhartquist.github.io/resonators/bench/)
45+
46+
Loads the WASM build into a `Worker`, runs the bank over one second of pseudo-random noise at 48 kHz, and times the result. Reports nanoseconds per sample, microseconds per 128-sample quantum, and the percentage of `AudioWorklet` callback budget consumed at 88, 264, 440, and 880 bins.
4647

4748
## Install
4849

@@ -114,6 +115,14 @@ for (let i = 0; i < signal.length; i++) {
114115
const spectrogram = bank.resonate(signal, 256); // Float32Array, interleaved [re, im, ...]
115116
```
116117

118+
## Examples
119+
120+
![resonator bank spectrograms of a trumpet sample with linear and log frequency axes](images/spectrograms.png)
121+
122+
*Same trumpet sample from [librosa](https://librosa.org), rendered through two banks with different bin layouts: linear-spaced on the left, log-spaced on the right. The resonator algorithm is layout-agnostic, so you can match the bin structure to whatever analysis you're doing.*
123+
124+
Reproduce with `uv run scripts/example.py`.
125+
117126
## Benchmarks
118127

119128
Throughput of `bank.resonate(signal, hop)` measured against [noFFT][nofft] (installed from PyPI). noFFT uses Apple's Accelerate framework under the hood.

0 commit comments

Comments
 (0)