Qbasicnews.com
Play and Sound Replacements? - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html)
+--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html)
+--- Thread: Play and Sound Replacements? (/thread-6119.html)

Pages: 1 2


Play and Sound Replacements? - keeling - 02-18-2005

Has anyone done any work on routines that duplicate the functions Play and Sound? I saw the great tutorial on 3D sound but what about non-3D sounds. Maybe a MIDI replacement for Play?


Play and Sound Replacements? - Z!re - 02-18-2005

Ther are many sound libraries available..

Look in the examples folder, there are examples using FMOD and others.


Play and Sound Replacements? - keeling - 02-18-2005

I had seen that but isn't that just for playing MOD files. I mean something like generating a sound at some given freq. (i.e. 5600 HZ) as well as playing specific notes (C4, D3, etc).

Have I miss understood the FMOD example?


Play and Sound Replacements? - marinedalek - 02-18-2005

I have to say I'm interested in direct wave control of the soundcard too, I'm thinking of maybe making a MIDI-controlled synthesiser for fun. So you have to create wave "packets" in quick succession and send them to the soundcard or what?


Re: Play and Sound Replacements? - adosorken - 02-19-2005

Quote:Has anyone done any work on routines that duplicate the functions Play and Sound? I saw the great tutorial on 3D sound but what about non-3D sounds. Maybe a MIDI replacement for Play?
I've been working on and off on a PLAY drop-in that uses the MIDI port but the PLAY metalanguage is pretty complex.


Play and Sound Replacements? - shiftLynx - 02-19-2005

Quote:I had seen that but isn't that just for playing MOD files. I mean something like generating a sound at some given freq. (i.e. 5600 HZ) as well as playing specific notes (C4, D3, etc).

Have I miss understood the FMOD example?

After reading your post today, I wrote a tutorial on FMOD... it's in this forum. Smile

-shiftLynx


Play and Sound Replacements? - keeling - 02-19-2005

Thanks you, I read it and learned a lot... but it still misses part of my question.

The FMod seems great for playing a midi tune or a premade wav. Put in QB one could generate the tune by code during run-time. With the FMOD stuff it seems like everything must be done pre-run time.

Not all sound tools are for games or back ground music. For example, you can learn a lot about Fourier Transform by seeing and hearing it. Music composing algorithms are another area were MIDI (or some other music format) generation would be nice, and something that FMOD doesn't seem to do.

Again, the tutorial was great and it covered a lot about loading and playing sound, but the sound and play functions did more than that.


Play and Sound Replacements? - shiftLynx - 02-19-2005

Hmm, I see what you mean now... SDL allows you to send raw data to the sound card... I've never used the functions to do this, but maybe somebody here has played with them? I believe you have to use SDL_OpenAudio to set up a callback function, which is called every time SDL wants you to fill the sound buffer with the next piece of audio data. You could then link the callback function into some sort of wave generating routines.

I'm not sure - these are just some thoughts; this is the only way I know how to feed raw sound data to the soundcard. Smile

-shiftLynx


Play and Sound Replacements? - subxero - 02-19-2005

I remember writing something a while back that uses kernel32's Beep function to play notes (I had a table of 50-some notes, and I wrote a really simple sublanguage similar to PLAY.)

It's not portable. I'll see if I can find the code, though.


Play and Sound Replacements? - lillo - 02-19-2005

don't tell me FMOD doesn't allow to access the mixing buffer or install a mixing callback... I can't believe a so famous and widely used library doesn't allow it!

EDIT: ahhh, from fmod.org, on the features page I found this:
Quote:# User call-back custom streams.
# Generate custom samples.
That means it has a way to pass user buffers... Gotta check the docs