Archive for May, 2008

Sound.extract() rocks!

When Tinic Uro was implementing the dynamic audio features he was also giving us a very nice present called Sound.extract(). And it is simply awesome!

I wrote a simple experiment yesterday night using the popforge library. Yes — you can use it still with the new features and it is a great help. I just had to convert the sample data into a format for popforge.

The experiment is a simple flanger applied to an MP3. André wrote the flanger about a year ago but it is still fun listening.

The sourcecode will also show you how to loop sounds using Sound.extract(). It is a very safe way so that you get always as much data as you need.

There is only one problem right now. I wanted to use the new FileReference features so that you can load your own MP3s into the flanger. But unfortunately there is currently no easy way to do this. You would have to load the bytes, then create a SWF at runtime and inject the MP3. Then you could load that SWF with Loader.loadBytes() and once that is complete you can extract the sound. I thought doing that would be a little bit too much for a small demo :)

Water with Pixel Bender

Another simple example here. I think it was a little bit hard for me to understand first how to do animations with Pixel Bender based on user input.

The user input is currently only a Math.random() but I think you will get the idea. I always put the output of the shader back into it and get a nice wave effect.

8bitboy on steroids

Remember the 8bitboy? It was our first application to test how good dynamic audio works in the Flash Player. It was also the very first application we ported to test the new Flash Player 10 audio capabilities.

Here is the Astro version.

I was very happy when I ported the 8bitboy because it was very simple. You just have to replace the sound buffer we were using with the callback of the Sound object and pull for samples from the processors.

Simple Astro synthesizer

Here is a simple example how to write your own synthesizer in Astro with multiple voices and a simple ADSR envelope. I thought I write it so that not everybody is posting hurtful high-frequency oscillators.

You will see why latency really matters when programming audio applications once you start pressing some keys. It is not really possible to play anything but hopefully this well get adressed before the final version of the FP10.

Also there is currently not a really great way to develop with FDT for Astro. It is too bad but I hope the guys at Powerflasher will release an update pretty soon as well. Right now you can compile the example using Ant.

Adobe is awesome

Adobe released today the beta of the Flash Player 10 on its labs website. Among a couple of really great features is also one that made my day.

Dynamic Sound Generation — Dynamic sound generation extends the Sound class to play back dynamically created audio content through the use of an event listener on the Sound object.

If you do not know what this means: Flash is now finally capable of doing real dynamic audio streaming. I am so happy that Adobe was listening to the community and implemented this feature. A special thanks goes out to Tinic Uro for implementing it. He has also very detailed information about this feature on his blog.

I will post soon some example about how you can use Adobe Pixel Bender (Hydra) to synthesize sound in Flash. Think of it — its fantastic!

WIRED

Yay, the AudioTool made it on the WIRED blog. Read the article here. I am also happy that the author is mentioning the Adobe, MAKE SOME NOISE campaign. It means people begin to understand how important it is to include dynamic audio capabilities in Flash so that we can get rid of our Java server.

Update: Eliot Van Buskirk from WIRED wrote another article covering Adobe, MAKE SOME NOISE. Although I do not completly agree with the quote from Scott Gilbertson that it is very difficult to stream audio to the soundcard. It is not a question about open standards or proprietary technology (like FLV, which has just been opened). Streaming audio to the soundcard is usually done with raw amplitudes in a certain format — we do not need anything else than that and it is actually really simple if you have ever done it yourself.

AudioTool Update

Hobnox AudioTool

Hooray! The Hobnox AudioTool has been updated. You will find the TR-808 now and also some of our new stompboxes like the Compressor and Crusher. The mixer has also been expanded to cover 16 channels.

There is a lot more stuff in the pipe and I am really excited about it. Developing the timeline and saving arrangements are the next big steps. Until then: have fun playing around and stay tuned!

Tweening and object pools

Some days ago I was writing a tween engine for our library here at Hobnox and when I was comparing it with the other ones out there which are quiet popular (Tweener, TweenLite) I was pretty surprised that my engine was performing about 10fps faster than TweenLite when tweening 1000 objects. It was 40fps for me, 28fps for TweenLite and 14fps for Tweener. It is not only faster but the memory usage is constant and small — on a Mac it was constant 11mb for my engine versus up to 22mb for TweenLite for instance.

Since I am currently not allowed to post the source-codes I want to talk a little bit about the ideas behind the engine.

Continue reading ‘Tweening and object pools’