SDL_mixer and panning

Is there any way to control per-channel panning in SDL_mixer?–
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games - http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor

Rainer Deyke schrieb am 17 Mar 2001:

Is there any way to control per-channel panning in SDL_mixer?

Not yet, but it probably wouldn’t be too hard to add. I’ll see how
bored I am tomorrow. You could also use Mix_SetPostMix() to
Mix your own data to the SDL_mixer stream. Then you can do all kinds
of FX on your sound data.

  • Andreas

Not really. I know Andreas did something for gltron, but I haven’t had a
chance to look at his stuff. To patch SDL_Mixer to handle panning
wouldn’t take more than a half hour really. I’ve just taken a look at
the internals and as far as I can see you just need to modify the
Mix_Chunk structure by adding another volume field and then changed
mix_channels to handle this change. Of course, mix_channels uses
SDL_MixAudio to perform the actual sample mixing, which means you either
write your own mixer (supporting all the formats is a pain in the arse
more than anything else) or patch SDL.
I’d do it myself, but well its Paddies Day. The thought police
punish us if we aren’t dressed in green, dancing intoxicated in the
streets. sigh Oh well…On Sat, Mar 17, 2001 at 09:25:36AM -0800, Rainer Deyke wrote:

Is there any way to control per-channel panning in SDL_mixer?


Rainer Deyke (root at rainerdeyke.com)
Shareware computer games - http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor


Martin

Bother! said Pooh, deleting his QWK packet.

Rainer Deyke schrieb am 17 Mar 2001:

Is there any way to control per-channel panning in SDL_mixer?

There’s a patch at http://www.gltron.org/stuff/SDL_panning.tar.gz
You need to patch both SDL and SDL_mixer (but the changes are small).
Use Mix_Volume_R(voice, volume) and Mix_Volume_L(voice, volume)
to controll the panning (see example in the .tar.gz from above) of
a SDL_mixer voice.

While we’re at it, there has been some confusion on the terms
channel/voice on IRC today (yes, there is a IRC channel, it’s #sdl on
irc.openprojects.net, and it’s been active for over a year now).
Generally, people tend to think of Voices, devided into two (or four)
channels (left/right, rear left/right).

For the next major revision of SDL_mixer (will there be one?), we might
consider changing all references to ‘channel’ to ‘voice’.

  • Andreas–
    Check out my 3D lightcycle game: http://www.gltron.org
    More than 100’000 Downloads of the last version (0.59)