I have gotten the Wind, Rocket Engine, and Sonar Ping circuits to work using the chaining structure, but I'm stumbling on the Helicopter one. It mostly works, component-wise, but I think I have a problem with the InterpolatingDelay module, since that is where it seems to break. I'll have to fuxxor with it some more, see if I can find what the problem is.
But other than that, this thing is cool as hell. I can simply create chains of modules that combine various signal generators, filters, and other operations, then call the module at the end of the chain to fill an SDL_mixer chunk with a sample of a given length, then play the resulting sound effect, all from a Lua prompt. Observe:
-- Generate a series of sonar pings
That Lua code when executed by the application sets up the module chain to generate a series of sonar pings, and dumps 200,000 samples worth of sound data (currently at the default SDL_mixer sample rate of 22050, so a couple of seconds) into a sound effect which can then be sent to SDL_mixer to play.
The binding works similarly to how libnoise works. Each module can have a certain number of input sources, themselves also modules, that are read when a module's getValue() is called. For example, a SineOscillator module has two sources, for Amplitude and Frequency. Using CConstant modules for each produces a steady note at a steady volume; interjecting a little red or white noise in there for frequency causes the pitch to vary. And so forth. A low-pass filter has 3 sources--signal source, frequency, and Q. Sources are set using the generic setSource() function, with reasonable defaults if a required source hasn't been set. (Should probably raise an exception, but what the hell).
So the above sonar ping (pretty much a direct refactoring of the sample given in the book) combines a red noise generator, impulse oscillator, and a low-pass filter with some combiner trickery, and results in a fairly elementary (yet reasonable) imitation of a sonar ping. Pretty fun stuff. Now to figure out the module chain for ass-kicking, bass-rumbling explosions. [grin]