Ask HN: Where are the good resources for learning audio processing?
I'm trying to program a harmonizer, like Jacob Collier's one built by MIT's Ben Bloomberg. I am looking for good, accessible resources on pitch shifting (whilst still sounding natural) and other terms I've heard like format shifting.
Where are some good resources for this for somebody with extensive programming experience but no experience in audio processing?
50 comments
[ 2.6 ms ] story [ 80.4 ms ] threadNot much to say that Julius doesn't... open course materials for (almost) everything you might need in audio processing.
Ex: https://ccrma.stanford.edu/~jos/mdft/Bessel_Functions.html
"The last expression can be interpreted as the Fourier superposition of the sinusoidal harmonics of [expression], i.e., an inverse Fourier series sum. In other words, [expression] is the amplitude of the k-th harmonic in the Fourier-series expansion of the periodic signal x_m(t)."
Many of the concepts are hyperlinked for reference. With the required familiarity, I would much rather read this than something that took seven pages to get to the point - say by assuming that the reader is unfamiliar with a premise out of an abundance of caution.
Not sure if it's useful. It's probably going to involve granular synthesis.
If you want to peak into some source code - you can look into Rubberband library:
https://breakfastquay.com/rubberband/
Rubberband is one of the time stretching/pitch shifting algorithms used in Reaper. You can download reaper trial and listen to the results with different parameters to see how you can tweak the code and if that gets any results you're happy with:
https://www.reaper.fm/
The company is Zplane, not Zynaptiq. Easy mistake, there is a little overlap.
https://licensing.zplane.de/
https://github.com/librosa/librosa
I often recommend also Music and Computers originally out of Columbia. [1]
[0]http://msp.ucsd.edu/techniques.htm
[1]https://musicandcomputersbook.com/
Back in university, I heard lectures on FFT and its applications to audio signal processing. So open access university courses would be the second place I'd look. The approach I always try first is to ask people I know if they can recommend a conference/meetup. For example, the annual JUCE events appear to be chock full with VST plugin developers. There's also private schools like SAE where you (or your employer) can pay for you to have an hour with one of their lecturers to ask questions.
Also [2] is a decent book for overall dsp concepts.
[1] DAFX - Digital Audio Effects (Second Edition) Edited by Udo Zölzer https://dafx.de/DAFX_Book_Page_2nd_edition/index.html
[2] Understanding Digital Signal Processing, Richard Lyons
consider maybe backing it up with one of the textbooks like oppenheim (the classic) or manolakis (one that i think i remember liking).
https://www.willpirkle.com
Audio programming is a lot of fun but it's the most challenging domain I've ever worked in. You have to be very careful with what you do on the audio thread. No locks, no memory allocation etc. Messing this up can result in some really ugly audio artifacts.
C++ for Real-Time Audio Programming: https://learn.bela.io/tutorials/c-plus-plus-for-real-time-au...
https://github.com/airwindows/airwindows/blob/master/plugins...
Then again, maybe this is the norm for audio engineers? Not my field.
I'd guess those files aren't what the author actually edits - there are commits that suggest that they are _generated_ from "boilerplate", and even a few files that seem to have failed interpolations ("__MyCompanyName__" in some copyright lines, for instance)
A lot of files also seem to have duplicated code, down to individual comments. For instance, the comment on line 24 reoccurs on line 344 of this effect:
https://github.com/airwindows/airwindows/blob/master/plugins...
and in the Mac AU version on line 267:
https://github.com/airwindows/airwindows/blob/master/plugins...
and in the Linux VST version on lines 24 and 344:
https://github.com/airwindows/airwindows/blob/master/plugins...
There's also just things like uneven indentation, lots of things to reduce linecount at the expense of readability like single line if statements. Old optimization tricks that aren't necessary with modern compiler like `while (--sampleFrames >= 0)`.
Here's another example file
https://github.com/airwindows/airwindows/blob/master/plugins...
And the project structure is really weird. Normally you would use a framework like JUCE or iPlug, or write your own, such that your dsp code is written once and your multiplatform code is separate. Instead every platform (Mac, Windows, Linux, VST, AU) are a separate codebase with all the dsp code duplicated.
He's definitely using some sort of templating system to do this, maybe even using some tool that lets him write the dsp in Python or Matlab and converts it to C++. Basically these files in the github are not his true "source", this is generated from his real source. For that reason, commits are often massive and unhelpful in tracing changes to any individual effect.
For example, a recent commit where he added the WolfBot effect, a guitar amp simulator, has 427 changed files and 150,284 added lines. Also even though the commit is titled WolfBot, this commit includes the addition of other fx, CreamCoat, DeRez3, kCathedral3, kGuitarHall, kPlate140, kPlate240.
https://github.com/airwindows/airwindows/commit/7623a1c14b01...
For example, many of them don’t have great low end. Some are “sluggish” and need external enveloping. Getting a sense for what’s out there can help to provide a North Star when you write your own. Some classics are the Eventide H3000, IZotope Vocal Synth, TC Voice Live, Antares Harmony Engine, and Soundtoys Little Alterboy.