Sample Map Builder 2

I’ve been building this on and off for quite some time but just don’t ever have enough time to finish it up, so rather than just letting it rot on my hard drive for a few more years i’ve put the source up on github.

There are builds available for Win and OSX here :

and a PDF manual here :

It is totally usable in its current state, but please feel free to clone the git repo and make it better, i’ll happily accept pull requests. :)

The repo is here :

OSC – Open Sound Control

For some reason, MIDI isnt dead yet, although it is indeed ‘ubiquitous and lightweight’ that doesn’t mean it should stick around. For some tasks its fine, but its definitely starting to show its age. One of the alternatives for communication between audio / video software and devices is Open Sound Control – OSC.

Im not going to go into a deep discussion of MIDI vs. OSC at this point, there are of course some benefits to MIDI which OSC should deal with in some way (e.g. a standardised namespace for representing MIDI semantics, or a discovery mechanism for that namespace..)..anyway, I just want to let you know that I’ve been working on some OSC related stuff to make using it easier from both Actionscript 3 and Max/MSP.

First up is OSCLib, this is intended as a low level set of OSC libraries which you can use in other applications. Actionscript 3 doesnt have UDP, only HTTP sockets whereas most OSC implementations (e.g. Reaktor, Bidule) are UDP based although one notable exception is SuperCollider which supports both. So to help bridge the gap there are java implementations for both HTTP and UDP clients and servers (well, the UDP server is currently missing but should be done in a day or two..)

For Max/MSP there is an MXJ object which wraps the HTTP server so you can send messages from a Flash / Flex client directly to Max/MSP.

There is some documentation on the project wiki pages for getting your dev environment setup and also a Flash / Max demo you can try out.

As a side note if anyone has a Korg Kontrol49 then i’ve also got a project based on OSCLib for working with the Kontrol49 in native mode : KontrolTools. This allows you to have full control of the lights and text displays via OSC as well as generate OSC message from all the knobs, sliders and buttons.

PixLib part 2. More configuration features and a ‘hidden’ gem.

After the previous success of PixLib dealing with my configuration needs, today brought a new challenge, creating instances at runtime from string identifiers (aka Class Factories).

To complete part of the project im working on in a nice way I want to be able to create instances of UI classes at runtime, using their fully qualified package names as identifiers. e.g. com.relivethefuture.ui.Stage.

The package names will be specified in the config file, but the class constructors need to be passed parameters which can’t be declared in the config as well.

IF the instances could be created without parameters then I could have used the config type called ‘class’. This would have meant that the framework would have done the hard work for me and created me an instance of the class specified.

When you are able to use this feature you can setup your config like this (note the quotes around the package name and any string arguments)

    'com.mydomain.MyClass',23,12,'hi Mum'

The interesting thing is whilst investigating the source code to see how PixLib creates the class instance I found a handy little utility function tucked away in the HashCodeFactory class (com.bourre.core.HashCodeFactory).

This class has a static method just for building instances, it looks like this :

public static function buildInstance(sPackage:String, aArgs:Array)

Exactly what I need.

I can just specify the class name in my config file


and when the time comes I just call the buildInstance method (note the parameters are supplied as an array)

stage = HashCodeFactory.buildInstance(Config.getInstance().stage.classname,[mc.mainStage]);


Now, for those of you who are going to be creating classes from package names remember one vital thing. You *MUST* reference the class at some point in your code for the compiler to include it into the swf, otherwise you wont be able to create an instance. This is slightly unfortunate, but its easy enough to deal with, just add

static var myClass:com.mydomain.MyClass

to your main class (or in a seperate class that is just used as a placeholder to ensure the classes are imported) and you’re good to go.

Ant task for Haxe compiler

For those of us who use Ant to automate builds and other tedious tasks i’ve put together a task so you can now run the Haxe compiler from Ant.

It supports all of the relevant command line arguments, but if it doesnt do something you think would be useful please get in touch and i’ll see what I can do.

You can grab a zip here :

Inside is everything you need, source, jar, samples and documentation.

MTASC and ANT : error running mtasc compiler

If you are trying to run MTASC from ant and are seeing the message ‘error running mtasc compiler’ this means that ant cant find the mtasc executable. There are 2 ways to remedy this.
The first is to add the folder with MTASC in to your system path. The second is to use the ‘mtasc’ attribute of Simon Wackers mtasc ant task to point it at mtasc.

If your mtasc executable is in D:devtools then you will need to define the task something like this :

<mtasc mtasc=”D:DevToolsmtasc.exe” …./>

I’ve written a more in depth guide to using ASDT and MTASC with ant over at 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 [tag][/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 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 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