openal or freeaudio filter request

BlitzMax Forums/BlitzMax Programming/openal or freeaudio filter request

AdamStrange(Posted 2011) [#1]
does anyone have any code to do filtering on audio. either penal or free audio?


BlitzSupport(Posted 2011) [#2]
There's loads of plain C source here:

http://musicdsp.org/archive.php?classid=3


Taron(Posted 2011) [#3]
Filter as in lowpass, bandpass, highpass and resonance with it all?

If that was the case, that's really easy stuff after all. A while ago I figured it out almost by accident as I was starting a physical modeling synth.

Filters are essentially springs, much like in physics simulations.

Visualize the sample waveform passing through your pickup point. Virtually this is where your sample value gets transferred to your speakers, so to say. If you only looked at this slice of the pickup line, you'd see a sample bounce up and down according to the waveform as it passes through.

A filter would be literally like a springboard attached to that sample, swinging after it by fairly ordinary dynamics routines.

The spring dampening is the lowpass.
The spring recoil is the resonance.

To get highpass you could just subtract the lowpass output from your original signal.

To get a bandpass, I think, you would take only the overlap between high- and lowpass. I'm too lazy to think about it too much right now and may be a bit off here, haha, but well... the general principle is so.

However, there's only one thing worthy of paying good attention to and that is to denormalize the result to avoid floating point numbers that become too small. If that happens, the FPU appearanly goes into high precision mode and slows down the processing dramatically. You could check for it and zap values to zero after a certain tiny threshold. Just look it up.


AdamStrange(Posted 2011) [#4]
mmmm, interesting analogy with the spring. certainly makes things easier to visualise :)

i'm doing a lot of work with samples, editing and stuff and really wanted to have sample playback with filter control. :)


AdamStrange(Posted 2011) [#5]
after examining all the facts I decided to recode the bass interface so that I have complete access to the fx module.

this allows all the basic fx, reverb, flange, chorus, hipass/lowpass filters etc

I've got half of it converted and operational and am working my way through until its all done :)

then I'll check it all to see how to operate it all. But initial findings are just what I was looking for plus some more to jeep me busy for a while.

it will be good to get it all integrated with my sampler/sequencer :)