Live data from Hacker News

Audio from Scratch with Go: Stereo Panning

dylanmeeus.github.io

21–24 of 24 posts

Re: Audio from Scratch with Go: Stereo Panning

#21
post #15

This is a fun tutorial for processing audio in Go, but generally panning will sound bad if you only adjust the amplitude/level. The two important missing pieces are phase delay and frequency-specific attenuation (the "head" model). Audio coming from the left side of your head reaches your left ear first, then your right ear later. Also, your head blocks certain frequencies more than others. Both of these effects are…

You say this like it's bog standard but adding HRTF and compensation for speaker distance are not part of a standard panning algorithm. This is more likely to exist in another module, such as for ambisonics or correction.

It isn't about speaker distance, it's about distance between ears.

I agree that HRTFs are uncommon in mixing, but spatialization without some frequency dependent attenuation generally sounds "flat" with headphones.

Although VR systems and big budget spatialization like Atmos will account for speaker distance (so called near field effects) it's almost impossible to notice those effects for stationary sources and no head-tracking.

Re: Audio from Scratch with Go: Stereo Panning

#22
post #18

Having had to do some mass audio stuff on datasets recently I discovered SoX - a self proclaimed "swiss army knife" for sound processing. Delighted to find multiple bindings in Go, I eventually decided to just do it in python as there was a very solid library there and it was just simpler for my use case.

The command line application is also quite useful. Usually you wouldn't need to go into a programming language at all to wield its power

Yeah you're right it is. I was strongly considering just writing a bash script but I had a bunch of probabilistic stuff going on for using effects, so stuck with python.

Re: Audio from Scratch with Go: Stereo Panning

#23
post #18

Earlier quoted context omitted.

The command line application is also quite useful. Usually you wouldn't need to go into a programming language at all to wield its power

Yeah you're right it is. I was strongly considering just writing a bash script but I had a bunch of probabilistic stuff going on for using effects, so stuck with python.

I've had good luck writing ruby scripts that just shell out to Sox because I didn't feel like learning the API

Re: Audio from Scratch with Go: Stereo Panning

#24
post #15

Earlier quoted context omitted.

You say this like it's bog standard but adding HRTF and compensation for speaker distance are not part of a standard panning algorithm. This is more likely to exist in another module, such as for ambisonics or correction.

HRTF is often used in game audio and AR [2], but never [1] as a mix effect in commercial DAWs. HRTF is a blunt instrument anyway. It's supposed to model your head and not just a standard imaginary generic head, and that's impossible without sticking a microphone inside each ear. It's also a headphone-only effect. As soon as you play the sound through speakers you get room reflections and all kinds of other artefacts…

Sorry this is just wrong. What is your basis for saying that HRTF are never used in commerical DAWs? Have you read anything by Bob Katz or Rashad Becker? Or perhaps you're not aware of the several options people reach for to perform multichannel mixing using ambisonics:

https://plugins.iem.at/

https://www.ssa-plugins.com/

http://www.ambisonictoolkit.net/documentation/reaper/

Post reply on HN