Let's Write a Reverb (2021)(signalsmith-audio.co.uk) |
Let's Write a Reverb (2021)(signalsmith-audio.co.uk) |
https://news.ycombinator.com/item?id=36706588
Speaking of reverb, I implemented a Dattorro reverb (https://ccrma.stanford.edu/~dattorro/EffectDesignPart1.pdf) in Rust before.
https://github.com/chaosprint/dattorro-vst-rs
It's based on Glicol source code here:
https://github.com/chaosprint/glicol/blob/main/rs/synth/src/...
You can play with it here:
https://glicol.org/demo#handmadedattorroreverb
Also you don't want to miss the Tom Erbe's reverb patches in Pure Data. Patches demonstrating several types of reverb (Schroeder, Moorer, Moore, Gerzon, Dattorro):
Are you also "Geraint"? (The home page https://signalsmith-audio.co.uk/ says "we" but the Geraint page https://geraintluff.github.io/jsfx/ says "I"...?)
Geraint's plugins are a great collection of excellent (and free) effects for Reaper, with a superb GUI (which isn't easy to do in Reaper/JSFX). So thanks also for this! ;-)
Possibly off-topic, but I am coder with hobbyist interest in the DSP space. I have never really had a "penny drop" moment when it comes to starting from nothing and generating sound.
Even generating simple sine wave seems like either a big chore or a completely abstract concept (depending on the tools/libraries/environment), I have not been able to find a middle-ground where I feel like I am learning but not getting completely lost in trigonometry or calculus. I am not sure if I'm not using the right tools or if I need to start even simpler and build up. GNU Radio comes close to scratching an itch for me of generating signal processing pipelines and a bit of intuition, but ultimately it becomes pretty easy to get lost in that as well (and it seems mostly focused on actual radio use-cases).
Do you have any advice for someone looking to build more familiarity or intuition on this front?
If you swap language/environment later, you'll carry your understanding/intuition with you, so you don't have to start with C++ if that's not your bag (even though it's still the industry standard). There are audio-specific languages with JIT runtimes (which can be used in Logic/Reaper/GarageBand/etc.), Rust/JS frameworks, etc. so find the one that feels good to tinker with, and keep that momentum/motivation going. :)
If you aim for performance, you will have to use SIMD and language that supports it (for example, C, Rust).
I'm working on WASM demos! I've been playing with WASM builds of my plugins, and it's great for prototyping/sharing, but it could definitely be set up better for demos/teaching: https://signalsmith-audio.co.uk/tmp/web-audio/?url=/tmp/basi...
I have subscribed to your blog.
https://github.com/phkahler/obs-studio/tree/eq8
It got rejected but only because they don't want the feature. My implementation does seem different to most which I think use band-pass filters instead.
Since the author does a quick comparison between convolution and algorithmic reverbs, I'll mention how I often combine them: a small/medium convolution reverb, plus a long algorithmic reverb. The convolution can perfectly diffuse the signal and it can also give a precise character to the sound, depending on the impulse response. It's great for adding a "body" to a raw sound generator. The algorithmic layer then adds a subtle ambience that can be extra long if desired.
It's worth knowing that some of those effects can also be achived (of course much much more simplified) in all modern browsers using the Web Audio API. I created mobbler[0] using that, and I also wrote a small tutorial on how some of the effects can be achieved using simple modules (it might seem too complex at first glance, but you can just look at the pictures)[1].
For Web Audio, there's an increasing trend of compiling WASM and running it in an AudioWorkletProcessor, which is maybe 2-3x slower than native. It's actually how I do a lot of my prototyping now, because the Emscripten build times are faster than a full plugin, and I can send it to people without them having to install anything.
> I haven't found any good resources on this particular diffuser design. I found a couple of forum posts and a paragraph from a book
When I read this my first thought was "this is a link to a comment by mystran on KVR, isn't it?" And yep. If you're looking for some obscure DSP knowledge, all Google searches eventually lead to a comment by mystran.
You can make a (very efficient!) diffuser from 2-channel rotations, but you have to tune it a bit to get it smooth without having a slow attack. With more channels, it's much easier to get right.
Reverb algorithms are indeed random enough, a leading audio plugin brand once came up with a randomizing reverb freeware[0] embedded with a "submit when it sounds cool" button.
https://bedroomproducersblog.com/2021/11/17/baby-audio-magic...
And while it's not a one-button random reverb, MCharmVerb also heavily relies on randomizing:
A lot of this stuff can be made from relatively simple building-blocks though, and you don't have to copy a previous configuration. My thought process was pretty much exactly as written in the blog-post! I just wanted to make something which didn't require any special tuning skills.
Original owner; got it in 1989.
I was fiddling with it recently to try to get a decent reverb. The main algorithms don't sound good; they have not aged well. These algorithms have a delay parameter, but it doesn't produce enough of a separation somehow.
Instead of a reverb-only block you can choose a combined delay with reverb (R->D, D->R or D+R). The delay block takes its own resources, leaving fewer for the reverb, which is simplified. You cannot choose the type of reverb (plate, hall, ...) and there are fewer parameters.
The interesting thing is that with the D->R and R->D, I can get much better sounds.
The D->R can produce a pretty lush/deep long reverb, where the main signal stands out clearly.
(I should mention that I'm using an external analog mixer for mixing the dry signal: the FX-500 is 100% wet. Thus, in general, I can get the best possible sound out of it: the full resolution is allocated to the effect, not to propagating the dry signal.)
Less can be more; a simpler reverb can sound better. A completely separate delay before the reverb can be better than playing games with built-in pre-delay.
Basically, in combining the resources of the delay and reverb into a more complicated reverb effect, Yamaha somehow made a mess.
I'm interested in doing the same at work, but the office PCs run Windows and I'm somewhat limited in what I can install.
The Arduino Audio Tools library seemed like it would work, but it only applies effects on one channel.
https://github.com/pschatzmann/arduino-audio-tools/wiki/Audi...
I discovered the Wishing Well stereo reverb pedal, and am wondering whether building one will allow me to apply the effect to music from an iPod, rather than a guitar.
https://scientificguitarist.wixsite.com/home/wishing-well
If anybody would like to group-buy the Wishing Well, please let me know - if I order PCBs and parts, I'll have spares.
Made me wonder whether there’s a connection with linear feedback shift registers (https://en.wikipedia.org/wiki/Linear-feedback_shift_register)
If you have a LFSR that produces a decent but not too good pseudo-random signal, can you use its parameters to create a decent reverb?
If anyone has any other interesting ones to share about how audio hardware and software are built, I'd love to see them!
https://valhalladsp.com/2021/09/20/getting-started-with-reve...
https://valhalladsp.com/2021/09/22/getting-started-with-reve...
If you mix in some of the diffused signal directly, it bridges the gap between the initial sound and the feedback echoes: https://signalsmith-audio.co.uk/writing/2021/lets-write-a-re...
---
You can tune the diffuser to have an almost-instant onset. I can't remember what I did last time, but at a guess, having the largest diffuser stage increase by a factor of N (number of channels) instead of 2 might do it.
But also, if you're playing acoustic drums in a big space like a concert hall (instead of a long one like a staircase), the first echoes coming back from the walls are actually a bit delayed (1 foot ~= 1ms, at the speed of sound). So if your nearest wall is 10ft away, the first wall-echoes will come 10-20ms after the initial direct sound.
The thing about reverb is they require a lot of state and nonlinearity is undesirable.
For NeuralDSP it's a bit different because they use NN's to simulate a guitar amp circuit which is a nonlinear system and so there's no simple way to "capture" the effect the way that you can for reverb sims or speaker sims. And while you can make a very accurate model using something like SPICE, that won't run in realtime. With traditional amp modeling you basically take the SPICE version and try to optimize and cheat as much as you can so it can run in realtime, at the cost of accuracy.
So that's what NeuralDSP's goal is, a system that approximates the amplifier but can also be computed in real-time, except done using a trained NN instead of a human-optimized variant of the SPICE circuit.
They have a couple whitepapers on their website, though none of them go deep enough to really give away their secret sauce. But basically according to them, making a NN model of an amplifier at a fixed setting is fairly simple. Where they had to get novel with it is adjustable settings/parameters. E.g. turning the drive up, or turning the treble down. Just capturing a few hundred or thousand models based on adjusting parameters and cross-fading between them doesn't sound realistic. So they had to come up with a larger model architecture that can "learn" those parameter changes.
It's a discussion of some of the finer (and coarser) parts of reverb design and includes comments from Casey Dowdell (Bricasti), Sean Costello (Valhalla DSP), Matt from LiquidSonics, Urs Heckmann (u-he), Chris from Airwindows, Stian (Acon Digital) and other top-notch audio DSP gurus. They're not giving away trade secrets but there are fascinating discussions around reverb design, topology, theory, and of course perception.
https://www.research.ed.ac.uk/en/publications/neural-modelli...
Don’t use NAM. Learn PyTorch.
2. Write SIMD intrinsics by hand. None of the libraries are as fast.
3. Don’t use sigmoid or tanh functions as your nonlinear activation. Instead approximate them with the softsign function which is much cheaper.
Depends on exact architecture, but these optimizations have yielded 10-30x improvement for single threaded CPU real time audio applications.
When GPU audio matures all this may be unnecessary.
> I'm not really a hardware person
Neither am I, most of the fun is in the software anyway. The rest is just some amateurish solder work and compiling an array of components I may or may not use.