Dark Bit Factory & Gravity

PROGRAMMING => Other languages => Blitz => Topic started by: valis on January 21, 2011

Title: Tell me About Sound
Post by: valis on January 21, 2011
How are sound systems typically programmed for games and demos?

Let's say I want to produce something similar to a mod tracker.  Let's say I want to make it tiny. 

How are the different audio channels handled?  Do you have, eg, 4 channel audio, each one with a different sound bound to it?

Educate.
Title: Re: Tell me About Sound
Post by: va!n on January 21, 2011
You can use mod /xm files if you dont use any tiny synth like 4kklang or v2m. However i prefer to look at this very nice, tiny and open source mod player:

http://ufmod.sourceforge.net/
(http://ufmod.sourceforge.net/) == has even support for blitz max ;)


I am not sure if Blitz sound commands supports multi channel... IF so, it would be easy to handle...
Title: Re: Tell me About Sound
Post by: valis on January 21, 2011
It does have multichannel sound.  However I am a complete noob to sound programming.

maybe I will find some short sound samples and have a play around.

Any thoughts about this?
http://code.google.com/p/maxmod/
Title: Re: Tell me About Sound
Post by: va!n on January 21, 2011
i d/l BlitzMax demo and taked a look to the documentation... Seems its very easy to use own channels and so you can have multiply chanlles with controlling each of your wishes.

Audio -> Audioplayback:
TChannel == Audio channel Type
AllocChannel == Allocate audio channel
StopChannel == Stop an audio channel
Title: Re: Tell me About Sound
Post by: zawran on January 21, 2011
Blitzmax has a useful audio module, which supports multiple channels. I have not seen any kind of trackers coded in blitzmax that uses its own audio module. For that you are probably better off using one of the supported tracker players like ufmod, bass and fmod. ufmod is quite small and works just fine for xm tunes. I have mostly used bass, but a lot of people use fmod. I have no personal experience with maxmod, but from the look of it, it could work as well for playing tracker tunes.
Title: Re: Tell me About Sound
Post by: ferris on January 21, 2011
Are you asking about how to simply play files or are you interested in making your own module player / synth / whatever?
Title: Re: Tell me About Sound
Post by: va!n on January 21, 2011
i think he would like to know, how to play multiply samples at the same time and how to control the playing of these... If so, i think Blitzmax audio commands may be helpfull here ^^
Title: Re: Tell me About Sound
Post by: valis on January 22, 2011
I looked around at the available mod players and synths.  Looks like something like ufmod will be what I need.

With those, is it possible to play mods out of memory instead of loading them from a file?  Are the samples the mod player uses tweakable in realtime, eg. can I write sin or square waves to the samples?
Title: Re: Tell me About Sound
Post by: ferris on January 23, 2011
I should. I'm not sure about ufmod's blitzmax implementation, but it's FreeBASIC flavor was used in one of my old 64k's.