StandingWave2: an open source AS3 audio library

May 15, 2009 on 3:24 am | In Flex, Music, Programming | 29 Comments

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



RSS feed for comments on this post. TrackBack URI

  1. Wow, great news! See you in Boston :)

    Comment by Joa Ebert — May 15, 2009 #

  2. Thanks for sharing ! I’m looking forward to trying this out.

    Comment by David Wilhelm — May 15, 2009 #

  3. 1000 thanks !

    Comment by rkn14 — May 15, 2009 #

  4. Wow, Joe! This is amazing. Thank you so much

    Comment by Chris Lyons — May 15, 2009 #

  5. StandingWave: Open Source AS3 Audio Library für Flash…

    StandingWave ist eine Audio-Bibliothek für ActionScript 3 und kann somit in Flash oder Flex eingesetzt werden. Sie stammt aus der Audio-Engine von NoteFlight, einem Online-Notenprogramm, und wird nun als Open Source angeboten.

    The goal of StandingWav…

    Trackback by — May 15, 2009 #

  6. big thanks for sharing!

    Comment by j — July 6, 2009 #

  7. […] been messing around with recently released Standing wave 2 engine over at He used the initial version for his online musical composition app NoteFlight which is very […]

    Pingback by Standing Wave 2 - Open source AS3 sound engine | — July 10, 2009 #

  8. […] AS3 audio library After months of waiting for an opportunity […]

    Pingback by Flex开发相关优秀资源集合(全球) | 中文Flex例子 — July 22, 2009 #

  9. […] AS3 audio library 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  Phew… about time.more… 没有过多的研究它,只是从joeberkovitz.com看到了就发了出来。 The goal of StandingWave is to encapsulate the following kinds of objects, permitting them to be easily chained together and combined to produce complex, dynamic audio output: […]

    Pingback by Flex开发相关优秀资源集合 — July 25, 2009 #

  10. Thanks a lot !!

    Comment by pozeat — July 30, 2009 #

  11. hey joe,

    looks really interesting – perhaps you could provide a zip download or similar either on your site or the google code site? i find the whole subversion thing overly technical and a hassle, coming from a design/scripting/music background. :-)

    also a simple online demo would be fantastic as well.

    cheers, luke

    Comment by luke — August 9, 2009 #

  12. I’ve had numerous requests to provide an online demo, and I realize this would make things simpler for a lot of people. I’ll make an effort, but because the library is being updated relatively frequently, it is a bunch of extra work to keep posting new downloads all the time.

    But maybe even an out-of-date demo would be worthwhile.

    Comment by joe — August 9, 2009 #

  13. Is there a way to create distortion and change the levels on the bass of an mp3?

    Comment by Simoens — August 18, 2009 #

  14. No distortion yet but you can certainly boost the bass by using a BiquadFilter.

    Comment by joe — August 18, 2009 #

  15. Ok thanks for the info ! :D

    Comment by Simoens — August 18, 2009 #

  16. Thanks so much for releasing this, Joe! Could I get a hint as to how I would pan sounds? In particular, I’m creating SineSources, and I’d like to pan them left or right. I’d appreciate any tips.

    Comment by Surya Buchwald — August 25, 2009 #

  17. I’ve been porting The Synthesis ToolKit in C++ to AS3 some time ago.

    Hope you can have a look :)

    Comment by Andy Li — September 21, 2009 #

  18. ok not a developer nor savvy at all w/ subversion, so i meticulously copy the files one by one :P im familiar enough w/ as3 code but im a caveman w/ stuff outside cs4..

    now, i wonder how to compile this? is it correct to drag simpleoutput.mxml to the flex_sdk mxmlc.exe? import the files in an .as file in cs4?

    i’ll keep digging but once i get a clue to get past this i know i can take more baby steps..


    Comment by jay — September 29, 2009 #

  19. Well, what you really need is an exported, fully built version of the library in a ZIP file. I’ve just built that for you (and others) and posted it on the “Downloads” tab on Google Code.

    We were avoiding this for a while when the library was changing every day, but it’s pretty stable now.

    Comment by joe — September 29, 2009 #

  20. joe, huge thanks for the almost instantaneous response! diving in now…

    Comment by jay — September 30, 2009 #

  21. Hey Joe, incredible. This was exactly was I was looking for. I built this small AS3 toy called the Tone Scribbler using StandingWave2. It made the project a hundred times easier. Thanks.

    I used it as the final project for my Flash class. You can check it out on my website.

    Thanks again.

    Comment by Francis Baptiste — December 18, 2009 #

  22. This is a really impressive library!
    It succedeed in play back 12 mp3 tracks perfectly synchronized. The only features it lacks are a pause function (easily implementable) and a playAt function for the Performer. Did someone try to develop that?

    Comment by Ikoichi — March 18, 2010 #

  23. Hi Joe,

    Posted this in the standingwave1 post, so i decided to post it here as well, since i’m using standingwave2. :)

    What a wonderful library, it helped me a lot with something I am making. I’m making a drum sequencer like FL Studio and this lib fixed the timing issue! Great!
    But I have a question, how do I loop a ListPerformance? I’ve created the ListPerformance by iterating through a set of data and determine the starttimes etc and it works perfectly, but it only plays once. I’d like to see it loop, how do I do that?

    Thanks in advance!

    Comment by Jeffrey — March 26, 2010 #

  24. Joe,
    I’m a big fan of noteflight and have recently started building instruments – and attempting to use standingwave. I get build errors with the zip archive with Flash Builder 4. I’m assuming it must be from the compiled .swf’s – so I’ve tried to download the source – but I get invalid URL from subversion (of which I’m a newbie). Is the url correct on the google code site? Thanks for making this library public. What a service to us all.

    Comment by craig — May 4, 2010 #

  25. Hi Joe
    I wish I could take part in the “Happy audio coding!”. However there seems to be no chance to produce the quitest peep in Flash CS4. Is it possible that you mean “Flex” when you say “Flash”? If not – why do you put so much effort in an open source version that excludes people using the most popular Flash development tool? I would love to use your library creativly but endless error messages are too frustrating.

    Comment by Henry — May 16, 2010 #

  26. It’s been used in a bunch of Flash projects. Others have had luck using the library in CS3, so I’m not sure what the problem is in CS4.

    Comment by joe — May 16, 2010 #

  27. As a non developer I find it hard to get started because there’s no example that easily compiles in Flash CS4.

    However I managed to make a first sound with it – a first sense of achievement!

    Comment by Henry — May 16, 2010 #

  28. I’ve been reading through the docs and your library looks exactly like what I want. I’m in the middle of making a game independently and I had the crazy idea of having generative music in it. This will make my life so much happier. I’ll link you to it once it’s finished.
    Good work!

    Comment by Fernando — July 13, 2010 #

  29. I’m in sync again – thank you! Although only with sinewaves…
    I could not find any forum on the net for users of standingwave 2, so I post some questions here.

    I have searched the code unable to find out whether it is possible to pan sinesounds..

    Also, the sinesounds “pops(clicks)” on start and stop. Why is this?

    Comment by Torleiv — August 13, 2010 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Entries and comments feeds. Valid XHTML and CSS.
All content copyright (c) 2006-2007 Joseph Berkovitz. All Rights Reserved.