Dynamic bleeps and bloops in AS3

I noticed an awesome hack on Flashcoders today. David from Robots w/Lasers shows off a way to dynamically generate sounds in AS3. He actually builds a SWF in a ByteArray at runtime and passes it into a Loader object. With a little work to refine this approach, ambitious Flash developers could put together some sort of music sequencer. A full game soundtrack would be pretty cool. The sounds have a nice retro feel that would go well with many of the Flash games out there. It reminds me of my days playing with BASIC or Assembly. I’m sure there are hundreds of other possibilities.

If you’ve got some time, David is interested in seeing any improvements that can be made. I might take a look at his code later this weekend. It seems like a fun little project.

About Josh Tynjala

Josh Tynjala is a frontend developer, open source contributor, bowler hat enthusiast, and karaoke addict. You might be familiar with his project, Feathers UI, an open source user interface library for Starling Framework that is included in the Adobe Gaming SDK.

Discussion

  1. PJ @ E-Phonic

    Hi,

    I’ve been working on a Class that was based on your idea.
    I took the concept a bit further and created a realtime circular audio buffer so you can generate audio in realtime without the limit of sample length, as it will ‘stream’ the circular buffer.

    Please take a look at:
    http://www.e-phonic.com/misc/

    Cheers!
    PJ