Audio synthesis/processing on the GPU
category: code [glöplog]
Hi All,
For the past few years, I have been thinking - ok, no more than once a year :) - to implement a full synth on the GPU, but of course, failed each time to solve the problem of synth algos requiring feedback from previous calculated values (e.g. IIR filters, FM synthesis with feedback... etc.)...
Has anyone been successful at using GPU for audio processings in recent intros/demos? I read somewhere that Psycho was working on a GPU version of their synth, but don't know how far they went...
For the past few years, I have been thinking - ok, no more than once a year :) - to implement a full synth on the GPU, but of course, failed each time to solve the problem of synth algos requiring feedback from previous calculated values (e.g. IIR filters, FM synthesis with feedback... etc.)...
Has anyone been successful at using GPU for audio processings in recent intros/demos? I read somewhere that Psycho was working on a GPU version of their synth, but don't know how far they went...
Hey! You stole my idea for a fun project! :D
But yea, it seems like a really interesting idea. You could possibly explore new synthesis forms as well with the massively parallelness of modern gpu's. 10,000 synth unision anyone?
But yea, it seems like a really interesting idea. You could possibly explore new synthesis forms as well with the massively parallelness of modern gpu's. 10,000 synth unision anyone?
Bubblin Under does FM synthesis on the GPU. (I found the audio output pretty horrible, but seemingly others liked it.)
Quote:
Bubblin Under does FM synthesis on the GPU.
Nice, I missed that one! Sure, additive/FM synthesis without feedback is pretty straightforward on the GPU (output of one operator is feeding the input of another operator early in the chain) and could give some great results.
One of the problems implementing synth over gpu, is the fact the synth are normally hard to parallel as very often a self and cross operators feedbacks are involved. You could use Mewler idea for paralleling in an voice granularity, two problems with that: depending on synth, you would have hard time to fully utilize the stream processor nature of the gpu. Second, you don't really need 10,000 unison voices...
One really interesting concept to go for is reverb effect, gpu would be able to create some crazy ass reverbs.
One really interesting concept to go for is reverb effect, gpu would be able to create some crazy ass reverbs.
Correct me if I'm wrong, but there are very good FFT implementations on GPU, aren't there? Can FFT be used as a general way to apply filters and reverb for music?
Take for example cymbals. Really full sounding crash or ride cymbals. Theoretically, you'd take a noise signal, attach 100-200 peak-filters at different frequencies and mix the resulting signals together, then some fat reverb. This is something that could be parallelized very well.
Actually, when I think about it, physical modeling could work well.
Also, together with FFT, I think that many per-pixel operations like blur, distort and so on can generate interesting audio effects. Something I'd like to play with someday :) audio signal -> FFT -> GPU image filter -> iFFT -> audio signal
Or some procedual texture generation techniques -> iFFT -> audio signal.
Or FM Synth -> procedual texture
:)
:)
"Subscribe" ;]
This is a subject I was often musing about for the last six or seven years. I am no coder, though, but still really interested.
This is a subject I was often musing about for the last six or seven years. I am no coder, though, but still really interested.
I was sketching on some synth stuff in OpenCL.. I think it could be quite awesome :)
@xTr1m, most filters are practicals when implemented as IIR, which is a recursive filters, so It means that it is a sequential algo that cannot be easily parallelized on the GPU. but, @fizzer is right about FFT, forgot about them! This is a good way to get some nice sharp filters (though reverb seems a bit more consuming, but it is indeed possible).
Regarding IIR filters. These are serial in a naive implementation, but there is a trick to run some forms of them in parallel.
Lets say you have a order 20 filter built from 10 2nd order stages (think graphic equalizer). If you add a single sample delay between those stages you can break the serial nature and calculate all ten filters in parallel at the cost of 10 samples latency.
This works for SIMD just as good of course.
Lets say you have a order 20 filter built from 10 2nd order stages (think graphic equalizer). If you add a single sample delay between those stages you can break the serial nature and calculate all ten filters in parallel at the cost of 10 samples latency.
This works for SIMD just as good of course.
@torus, nice trick for the filters, though parallelizing on GPU would require to be able to parralelize at the sample level (or a couple of them, but no more)... FFT for filters and reverb is probably the best option so far. I guess that feedback at the sample level in a FM synth is not really feasible on the GPU.
Yeah, I would think OpenCL or CUDA or the like is what you're looking for if you'd like to start doing that sort of work on a GPU.
OK, I'm probably talking through my ass here, since I'm a newbie to 3D card programming, but is there any way to do NON-graphical stuff on a GPU, INSIDE A BROWSER? i.e. in WebGL? I don't know C and OpenGL programming and don't really have any wish to learn, which is why I ask.....
Of course it is possible. What you want is basically shaders and FBOs. If you can do you non-graphical stuff in OpenGL ES, you can run it inside a browser.
Sorry, what's an FBO?
trc_wm: lmgtfy is first for me, Good one!
While GPU processing is all ponies and unicorns for graphics, I am not yet convinced it with have a great impact on audio, except for more of everthing we already have. The cpu is already fast enough to run impressive audio algorithms and the demoscene is not really pushing the envelope on audio anyway.
That said, I hope someone will prove me wrong.
That said, I hope someone will prove me wrong.
Wholesale valve!