[See note below about the StandingWave3 update.]
After months of waiting for an opportunity to open up in my schedule, I’ve finally managed to create and package the StandingWave2 audio synthesis engine for Flash. It’s now up on Google Code at http://code.google.com/p/standingwave/. Phew… about time!
People have been asking for an open source audio library for a long time. Because the original StandingWave1 became an integral part of Noteflight, I could not simply give the code away. StandingWave2, on the other hand, is a clean subset that the Noteflight team is happy to make available to the Flash community under the MIT OS license.
The basic ideas behind StandingWave are sources, filters and performances. Sources and filters are simple, self-contained objects that can be hooked up to create a kind of audio-processing/sequencing pipeline, and then rendered by a “player” object that encapsulates the Flash Player 10 audio API. Performances allow source/filter combinations to be delivered in a continuous sequence, with extremely precise timing. Obviously this can be used to play music, but it can also be used for all kinds of dynamic sound creation. And it’s relatively easy to extend StandingWave to add your own kinds of sources, filters and performances once you read the code and get the idea.
All the DSP algorithms are in pure AS3. They would certainly be faster in PixelBender or Alchemy, but we’ve opted to keep the approach simple and flexible for now so that it’s easy for people to extend.
I will be talking much more about StandingWave at 360Flex and Flash on Tap, so hope you can make it to either of those conferences. I’ll be posting the slides here.
About its quality and performance: as useful as this library is (thousands of people use it on Noteflight), it could be so much better. It’s fast, but it should be faster; it has a basic repertoire of sources and filters, but should be richer. The need for improvement is one of the main reasons we’re open sourcing it: we very much want others to contribute.
Happy audio coding!
Important update: After a lot of amazing work by Max Lord, who rearranged SW2’s internal organs to create a new, bionically altered library, StandingWave 3 was released in June 2010. This update to StandingWave uses Adobe Alchemy to compile C audio processing code directly into the Flash Player for maximum speed, and is generally much faster and more flexible than Standing Wave 2. It also includes a notion of modulators that allows for continuous variation of many filter parameters. Like this idea? I do, which is why it’s now the production audio library in Noteflight. Go to the StandingWave 3 repository on GitHub.