In a C++ app, I am using FSOUND_SetFrequency() to vary the playback rate and FSOUND_FX_Enable()+FSOUND_FX_SetParamEQ() to produce effects. When I call FSOUND_Stream_OpenFile with options set to FSOUND_HW2D | FSOUND_ENABLEFX, the effects work but I am unable to change the frequency. When I call FSOUND_Stream_OpenFile with options set to 0, the effects (of course) no longer work but I am able to change the frequency. Is this a problem, a “feature”, or do I just need to RTFM some more? :^) I DL’d and installed the latest DL from http://18.104.22.168/files/fmod.dll yesterday (June 4th) and am still experiencing this behavior. Thanx in advance!
Oh no, that is not what I wanted to hear! So that means that if I want to be able to vary the playback rate, which is a must for the DJ player application that I’m building, I need to write all my own code for the effects? I know that technically I can do that with the DSP functions (followed the dsp/reverb sample all the way through) but I don’t know the first thing about writing my own number-crunching code for, let’s say, a parametric EQ or a low-pass filter. “Dammit Jim, I’m, a doctor, not a mathemetician!” :^) I’m willing to give it a whack, though; can anyone point me to some source code or a book on the subject that weighs less than 5 pounds? Or Brett, maybe this is just a temporary roadblock, please say that’s the case…?
P.S.: Here’s what I’m building with FMOD, a Windows-based DJ player. This used to be based on XAudio, but I’m in the process of switching to FMOD for the DX8 effects. Hope I don’t have to go back :^(
http://atomicsoftworks.com/Downloads/RS … eSetup.exe
I tried your program and altough it looks nice, it crashed every time I tried to add songs to the playlist.
If you are interested in it, I am working on a dj Program for some time, which you can try out at :
I am working on my own effects, and the only problem I am currently experiences is that dsp callbacks have a 100 ms latency.
After my exams I’ll search some of the url’s I’ve used to get my equalizer working.
I also see that your program has a 10-band equalizer, which I do not find very usefull for dj purposes. 3 bands are a lot more usefull because you can’t change 10 bands quickly.
Well okay, after spending the last week doing research on DSP (and boy oh boy does my head ache from all that math!) I think that the thing to do is to let FMOD vary the playback rate and do all of my own FX via DSP callbacks. I’ve got a pocket full of algorithms for EQ/phasing/flanging/etc., and once I get them implemented and documented in C++ I’ll post them here for anyone else who’s in the same boat.
Adion: I will check out your DJ program! What type of files are you trying to add to the playlist that are making my code go “boom”? I’ve really only tested it with MP3’s since porting it to FMOD.
I’m making a dj-soft too it’s pretty much ready now (thanks to FMOD and it’s ease of use!). What it’s lacking tho is those eq and flanger effects and i have no faintest idea how to do them with the dsp-unit… any hints and/or pointers would be gladly appreciated!
Ok, I’ve found the source on which I based my equalizer :
It looks complicated, but what you have to do is first calculate all the variables depending on the filter you need, and then use Equation 4, where y[n] is the current sample you are processing, y[n-1] the previous sample and so on.
To make this easiest, just create a structure that contains all variables needed, including something like y, y_prev and y_prev_prev.
Then create a function that gets as argument the structure, the current input sample, and variables such as frequency and amount to increase decrease and filter type.
Now, you only want to update all the variables when frequency or filter type or these vars change, because they are quite slow to recalculate every sample.
I think this should get you started.
Mike: I’ve tested it with mp3 files. Have you tested djDecks yet?
Please login first to submit.