pouët.net

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...


added on the 2012-06-17 04:59:38 by xoofx xoofx
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?
added on the 2012-06-17 07:18:13 by Mewler Mewler
Bubblin Under does FM synthesis on the GPU. (I found the audio output pretty horrible, but seemingly others liked it.)
added on the 2012-06-17 07:30:22 by Sesse Sesse
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.
added on the 2012-06-17 10:58:59 by xoofx xoofx
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.
added on the 2012-06-17 11:38:42 by JohnD JohnD
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?
added on the 2012-06-17 11:54:41 by fizzer fizzer
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.
added on the 2012-06-17 12:56:32 by xTr1m xTr1m
Actually, when I think about it, physical modeling could work well.
added on the 2012-06-17 12:56:44 by JohnD JohnD
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
added on the 2012-06-17 13:17:44 by xTr1m xTr1m
Or some procedual texture generation techniques -> iFFT -> audio signal.
added on the 2012-06-17 13:18:07 by xTr1m xTr1m
Or FM Synth -> procedual texture
:)
added on the 2012-06-17 13:26:23 by Mewler Mewler
"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.
added on the 2012-06-17 15:06:50 by Hoild Hoild
I was sketching on some synth stuff in OpenCL.. I think it could be quite awesome :)
added on the 2012-06-17 15:08:51 by ekoli ekoli
@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).
added on the 2012-06-17 15:09:35 by xoofx xoofx
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.



added on the 2012-06-17 15:57:41 by torus torus
@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.
added on the 2012-06-17 16:11:41 by xoofx xoofx
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.
added on the 2012-06-18 03:26:32 by orby orby
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.
added on the 2012-06-18 10:40:22 by p01 p01
Sorry, what's an FBO?
trc_wm: lmgtfy is first for me, Good one!
added on the 2012-06-18 17:45:16 by TLM TLM
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.
added on the 2012-06-18 17:53:21 by trc_wm trc_wm
Wholesale valve!

login