last.fm recent tracks in flash

If you’ve been wondering when the code was going to return, well, here it is. Its a little app to show you your [tag]recently played tracks[/tag] from Last.fm. [tag]Last.fm[/tag] is a great site if you like music, and who doesnt like music? So whats it all about?

As they say ‘You get your own online music profile that you can fill up with the music you like. This information is used to create a personal [tag]radio[/tag] station and to find users who are similar to you’

One really nice feature is that a lot of the data is freely available from the audioscrobbler.net site in a variety of formats. This has prompted some people to create handy little scripts that generate sigs which show what you have just been listening to. Most of them have been made using php and GD to generate a graphic, or just plain ol html. So i thought this would be a perfect opportunity to do the same in [tag]Flash[/tag], but using only open source tools and libraries (You dont need the flash IDE installed to build it..)

You can download a zip of the code from here.

To build it you will need swfmill and MTASC, and to make your life easier i’ve included an ant build file.
The build file requires the as2 [tag]ant[/tag] tasks created by Simon Wacker which you can grab from here.

Also included in the zip is a lovely font created by the nice people at orgdot and a little php script that will cache the response from last.fm so you dont hammer their servers (they ask that you dont make more than 1 request a second..)

For now the implementation is very basic, im sure theres plenty of improvements and extras that can (and should) be added. Drop me a comment if you do something interesting with it.

and if you want to see it in action you can go here

All flash and no bang

Flash 8 is announced, everyone is getting very excited about the new toys and tricks that are available, but, again it seems as though we are all deaf. (NOTE : I am writing this before i know for sure *exactly* what is in the new player, but from reading this it certainly looks like its all visual stuff)

Ok, so there are now 32 channels of sound in the new player (well, thats what it says here and there is a demo) BUT, oh, thats 32 mono channels, so 16 stereo channels.

Well, thats an improvement, but what can i do with those channels? anything new? theres all these fandangled bitmap filters and effects, why not the same for audio? Why do i have to be stuck with using mp3’s if i want some nice sound.
I want ogg’s and i want to access the sound buffer.
It doesnt even have to be real time, just let me write some numbers into an array, say here little sound object, eat this and loop it please. If i can update it at least some of the time, that would be cool, maybe play it back at different speeds. Im not asking for time stretching or anything.
Even some pre-defined filters would go a long way, just yer standard low pass / band pass / high pass would be great.

Oh well, maybe next time. At least i can do some motion detection with the camera and pass some data from that off via OSC (using flosc) to something nice, like plogue bidule

Automated Swf Publishing

Today i was faced with the pleasant task of publishing over 100 .fla’s into swfs. Not something i would ever do manually if i could avoid it.

Handily i remember reading this from grant skinner just the other day which is a great start, but im not going to hand write the compile schema (aka list of files to be published). In my case there arent any special deployment requirements, i can just stick the output files all in 1 directory. (Although if the jsfl file api thingy had a directory selector and a way to iterate through a directory contents then i wouldnt need any of this…)

Someone wrote a nice comment about using the dir command and a .bat file on windoze to generate the schema, handy but pretty dirty. So instead of that i knocked up a quick ruby script to generate a simple schema file, which is probably a good start if you need a more interesting layout, at least you dont have to write it all by hand.

It was also a good excuse to actually write some ruby code rather than just read about it. So here it is ‘my first ruby program’

enhancements and modifications are welcome.

the code is here