Digital signal mixing (like actually mixing the signals)

TyphoidHippo

1Trillion K Platinum User
I'm wondering about really just what the title says - those of you who know me know I've been around for a while - I'm not asking how to mix a song. I know there's several electrical engineers here, and more than several fellow software developers. I've developed audio libraries before, but on a new platform I'm only given an API that allows access to a primary buffer - I literally have to do the math to mix all the signals down into a single buffer. It's windows phone 7. It's a cool platform in exactly all areas but this (and sockets....but whatever, lol). I figured this was probably the best place to ask this on this site....without asking dgatwood and mshilarious directly (I'm probably gonna spam yall anyway).

Anyway - I'm not getting good results - I can run any immediately obvious algorithm on all the available signals that I would think would normalize them all into a humanly enjoyable sound, but..... no. Just no. I'm way, way off - I'm at the "guess and check" point - which I think any even slightly experienced programmer knows that that's the point where you don't know what the fuck you're doing, and you need to ask somebody for help or conduct original research.... I think protools and cubase rule out the original part. Anybody know how to do this?
 
And just to be clear - I'm not looking for somebody to give me a magical formula. I'm asking does anyone really know how to do this. As in - can you take a few minutes and explain to me how and why you're supposed to mix two signals in a way other than plain summing that still makes both sound at full volume without sending 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF to the buffer in an infinite loop? I can't begin to imagine how... anything can play two dimmu borgir (or Jay Z or soldier boy or whatever) songs at full volume and they still both sound.... at full volume and just fine.
 
It turned out I had a bug in the way I was filling the buffer, not what I was putting in it - simple addition (and clip-clamping so the shorts don't over/under flow) is all it takes to mix the signals together. Nevermind!
 
Back
Top