To all BMax Sound Gurus

BlitzMax Forums/BlitzMax Programming/To all BMax Sound Gurus

col(Posted 2010) [#1]
Hi all,
I wonder if someone could shed some light on what I'm trying to do with sound. I'm pretty good with the 3D stuff, but just starting to my feet wet with the sound side of games.........so

I want to generate sounds the old school way - with waveform data. And adjust the rate/freq manually. I have this section working like a dream. It was quite straight forward. What I'm having a some issues with is .... what would be the best way to change the waveform as the game is running?

I have things setup as follows -

I create a TSound using 32 bits of waveform data. I play it using a TChannel. This allows me to adjust the Volume and Frequency etc.
And now i want to change the data in the 32 bits of the waveform data.

What would be the best most effecient way to do it??
First impressions make me think i have to 'remove' the sound and make a new one with the new waveform?

Would it be better to make individual TSounds ( there are only 8 after all ) for each waveform? Then assign or Copy the Sound to the TChannel that i want to hear ?

Many thanks
Dave


col(Posted 2010) [#2]
Ive decided to go with the method of creating all 8 waveforms then copy them over into the channel to play them as required.

But still, is it possible to change the waveform 'on the fly' ?

Many thanks


BlitzSupport(Posted 2010) [#3]
Might it be possible to use a sort of double-buffering (or more) technique? That is, play the sound while writing to a second sound, then swap to play that while you write to the first sound, etc, etc?


col(Posted 2010) [#4]
Thanks for your reply James, I finished the project ( Z80 Pacman emulator completely in BMax using the original arcade ROM ) using the method I mentioned in my second post. I didn't investigate any further.

Maybe I'll look into it again in the future if the need arises.

Cheers


Who was John Galt?(Posted 2010) [#5]
I don't think Blitz really supports this, but as James says, you may be able to 'hack it' somehow. The real way to do it is with a third party library like FMOD.

I have a code entry that does realtime sound streaming with Brucey's FMOD wrapper.


Who was John Galt?(Posted 2010) [#6]
col!!.....

I've written a large portion of a Z80 emulator, but it's not working. Have you got a test suite I could nick to run the various opcodes through their paces and check if they're producing the expected output?


Grey Alien(Posted 2010) [#7]
You could cheat and use SFXR for some rad sounding chip sounds. I love it.


col(Posted 2011) [#8]
Hey John Galt

Sorry for this really late reply. Are you still working on this project ??

Sure, i had a test suite... not sure where it is right now, but i'm willing to take a break from my current endeavor and offer some hands on help for you. I also wrote a disassembler to make sure things were working as predicted. I still have the disassembler handy :p

Sorry again for the late reply. been working on a multi-thread 3d engine for max - major headache haha but i like a challenge :D
oh before anyone asks....its not working correctly just yet. I had a single thread engine working lovely with multiple objects shaders, collision etc - nothing new there really, but i wanted to go to the next step so now its mangled way beyond belief.

Last edited 2011

Last edited 2011