I'm starting a project which includes building an application that will be using the Wave Field Synthesis (WFS) method (and maybe Higher Order Ambisonics), for sound spatialization. I am not looking for ready made spatialization libraries (although they would help) as I'll write and test the methods from scratch. I was headed towards Cinder, as working in C++ provides better communication with the hardware, and it would be a great advantage to have a cross-platform code (I won't have to write multiple API's for each platform), plus the fact I'd like to integrate visuals in addition to audio.
My question is: as I'll have to control 128, 256 or even more channels individually (including filters), is it at all sane, or even possible to build this program using the Cinder libraries? I'm quite a beginner, but not clueless in programming in C++, but fortunately I have a lot of time to work on it. If you have any other ideas/tips/comments in mind that could give me some directions, it would be much appreciated.
I haven't been to much into Cinder Audio tools but it seems it is based on FMod which might be a little too simple for research application. I worked at the Ircam, and they developed a WFS system. I think it was in Max MSP. My first guess would be that MSP would be a more appropriate solution.
Cinder does not include FMOD, though it is a very nice sound library to use. FMOD will allow you to use a lot of virtual channels, but it realistically maxes out at 128.
The way to handle something like this not too far from granular synthesis. Create an output buffer for each channel, and an accompanying temp buffer for processing. Load your sources (files, synthesis, etc) into memory. For each iteration of your buffer (which is generally not tied to frame rate), copy a portion of your source buffer into your temp buffer. Process there and mix the values of the result into the appropriate output buffer.
It's best to iterate through at least two buffers per channel (circular buffering) so you aren't reading and writing the same data in memory. I usually use 32 small buffers per channel (usually 512 - 1024 bytes wide), which provides a lot of wiggle room for heavier processing.
That said, I would recommend using this technique with FMOD. You can essentially use hundreds of sources, processed with FX, using only as many channels as are needed for your final mix. And FMOD is very solid at handling it.
FMOD has licensing fees if you use this commercially, so be aware of that.
I didn't know about Ircam's WFS system; I'll have a more thorough search. There is also The Game of Life project (http://gameoflife.nl/) which uses Supercollider to apply the WFS technique at their system, and the SoundScape renderer (http://www.tu-berlin.de/?id=ssr) developed at TU Berlin and built on C++ using the Standard Template Library; I'm sure there are more. By using MaxMSP or Supercollider I could achieve this really faster, but the reason I want to try C++, is I think better communication with the hardware could be achieved, avoiding possible glitches when using many channels and moving virtual sources; please correct me if I'm wrong.
letsgooutside your suggestion using FMOD this way, seems nice, athough I can't say I know exactly how to implement it, but for sure is more than enough as a starting point; if you could also point me some examples that use this in some extend it would be great, but if not, I'm sure I'll manage it somehow. Just for clarification, are you saying that this way, I could use as many channels I want (more than 128) on real time, whithout any limitations?