Hacker News new | ask | show | jobs
by tialaramex 2164 days ago
Saturated addition is indeed the correct way to add two PCM streams together.

Especially back in the 1980s and 1990s you'd get awful code that did things like averaging the two streams because wrapping sounds awful and the authors were ignorant of the theory and/or unaware that saturated addition is a thing.

You can tell when somebody did this because it means playing silence makes everything else quieter, or worse there's an arbitrary limit on how many streams are played and playing any one thing is very quiet because it's attenuated so as to never wrap.

Haiku the 1990s-style operating system did this for years, as did various Amiga music software.

1 comments

At least on x86, saturated adds didn't become a thing until MMX was released. Doing saturated adds was simply too expensive on older machines, and usually required a branch.