Category Archives: Flash Brain Food

Just A Couple Of Useful Posts

I read then as is usually the case i forget and do it the long way… so for future reference:


Packing Squares

Working on a new idea codename ‘Stimuli’…

As a part of that i wanted to experiment with fitting a variable number of tiles into a dynamically resizeable container.

Square Packing v1 Demo

This demo will give a random number of tiles each time you refresh the page between 0-500 and will lay them out in the best possible fit leaving padding as required. I tried between 0-10000 but higher numbers take a long time to process. I’ll do some optimization on the layout code for v2. There’s also a 100ms timer running in response to a stage resize, basically to prevent multiple requests to draw the ui from occuring.

This demo uses drawing api and a single container sprite – maybe a BitmapData will be faster??? Lots to experiment with so i’d better get busy…


My Favourite Flash Site Of The Year

Be@ TV does it all for me, great Job – it’s what i aspire to!


HYPE & Audio – Early Findings

Playing with HYPE some more this time comparing the difference between calling ComputeSpectrum() direct and via SoundAnalyzer.

SoundAnalyzer is currently using the getFrequencyIndex() method which should spread the ByteArray data psychoacoustically based on Brandens’ previously collated values. See the Hype Blog Post – Understanding…

I’m using 2 different apps/UIs so the display is not identical but the way the data is drawn is! Also don’t run 2 files at the same time as each will display the combined data – that’s a SoundMixer issue, naughty!

Check out these examples:

NOTE: There seems to be an issue with the ‘no hype’ files – returning an end of file error, seems to be an issue with FMS especially if other flash apps are running in other matching browser tabs/windows. If you see it check what else is running flash, close it and refresh your browser – it should go eventually… sorry!

When i get time i’ll test the other methods getOctave() and getFrequencyRange().


HYPE v1

A couple of experiments using HYPE.

Hype is great! I’ve been staring at these just tweaking them slightly over and over again – so many permutations it’s very possible the really good ones got lost in the process…

The Word Is
No End In Sight


Unhype The HYPE!

Brandon Hall & Joshua Davis have released ‘The HYPE Framework’

Check out the HYPE Videos and HYPE Blog to see what’s on offer.

For me initially it was all about the potential of the SoundAnalyzer wrapper class but now, after some time spent delving a little bit deeper, i think i have truly found a gem!


Fixing ComputeSpectrum()

Today i stumbled upon a couple of blog posts that made my year!

I love having the ability to visualize stuff, especially audio whether it be a live stream or on demand sound. A couple of features i have played with a lot since the release of ActionScript 3.0 are SoundMixer.ComputeSpectrum() and BitmapData.draw().

I’ve always had a good handle on both (yet i’m still learning) but one thing that drove me absolutely crazy was the lack of documentation specifically regarding to what ComputeSpectrum actually spits out. There have been many experiments, usually followed by bouts of depression and hours of frantic searching looking for something…anything…or anyone who might be in a position to attempt to shed some light on things.

The most unanswerable questions where:

  • Why is FFT biased towards low frequencies?
  • What frequency band does ByteArray.position = N relate to?
  • Are the 256 bands per channel equally spaced?
  • How can i correct the data to produce a realistic display?

Well here’s the first step:

Ben Stucki has started to attempt to explain his findings in respect of better understanding ComputeSpectrum Ben Stucki – The Math Behind Flash FFT Results

He also references another blog post What’s In An FFT

Lets just say i’m on this big time…