Flash Midi Server
Flash Midi Server v0.1
Lawrie Cape 2010
Download from the Google Projects Page.
WHAT IS IT?
Flash Midi Server is method for sending MIDI data out of Flash. Using an Actionscript 3 class and a Processing application, you can create generative,
dynamic, fun audio tools in Flash.
WHY?
Mainly just for fun. Flash Midi Server (FMS) started as an experiment to test communication between Processing and Flash. From there it developed into a
class I played around with a lot – seeing what fun things I could use it for.
As FMS is built in Flash, it allows developers to rapidly prototype audio tools, experiment with new input methods and acess to a huge public code base to
build on top of. There’s a huge amount of technical skill and creativity in the Flash scene and hopefully some of it will be applied to creating innovative
new audio apps using FMS.
HOW DOES IT WORK -
FMS sends data from Flash to the FMS server – which then sends the data as a Midi signal.
Firstly run the FMS app in the “Server App” folder.
Then run one of the Flash or Air apps. Note – you cannot run .swf files as they do not have the security permissions to access the midi server, unless you
set the permissions here – http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
You can set which Midi Channel the audio is played through via the drop down on the FMS app.
Windows XP has “Microsoft Midi Mapper” which plays the notes back over the soundcard. Mac OSX has a similar default Midi Playback setting.
To use FMS with other audio apps, you must install virtual midi softward. For example – LoopBe http://nerds.de/en/loopbe1.html
These channels will then show up in the FMS settings drop down.
HOW DO I USE THE CLASS MYSELF? –
Place the uk.co.lawriecape.midi folder structure in you classes folder.
You can then check out the .Fla sources in the “Example FLAs” folder.
A basic setup can be seen below –
In flash -
//Import the Flash Midi Server class. import uk.co.lawriecape.midi.flashMidiServer; //Create an instance of the class. var MS: flashMidiServer = new flashMidiServer(); //Add event listeners for the various Server events - (optional) MS.addEventListener("FLASH_MIDI_SERVER_ESTABLISHED", connectionEstablishedHandler); MS.addEventListener("FLASH_MIDI_SERVER_LOST", connectionLostHandler); MS.addEventListener("FLASH_MIDI_SERVER_NOT_FOUND", connectionNotFoundHandler); function connectionEstablishedHandler(e:Event):void{ trace("Flash midi server connected."); trace("You can start sending data now!"); MS.sendNote(50); //or //MS.sendCC(50); } function connectionLostHandler(e:Event):void{ trace("Flash midi server disconnected."); } function connectionNotFoundHandler(e:Event):void{ trace("Flash midi server not found, please check the program is running and try again."); } |
WHAT COMES NEXT? -
There are quite a few limitations to the current system, which I’ll be trying to address in future releases. These include -
The ability to send CC data on specified CC numbers.
The ability to have audio output on multiple midi channels at once – to controll multiple instruments from a single server instance.
The ability to send multiple notes at once – eg. Chords or simultaneous drum hits.
If you have any suggestions, or make anything using FMS, please get in touch with me.
Cheers.
Lawrie.
Lawrie at LawrieCape.co.uk
See also –
Flash Midi Server – Sonar reproduction. from Lawrie Cape on Vimeo.
Download the source code for Sonar from the Google Projects Page.
Flash Midi Server – Processing + Flash + Webcam Instrument from Lawrie Cape on Vimeo.




11 Responses to Flash Midi Server
Another Flash Midi Server video | The Lawrie Cape Blog
March 5th, 2010 at 2:49 pm
[...] Flash Midi Server [...]
Flash Midi Server 0.1 released + Sonar source code and audio air apps. | The Lawrie Cape Blog
March 24th, 2010 at 4:36 pm
[...] Flash Midi Server [...]
ZVUHO
June 13th, 2010 at 3:10 pm
HI!
You left a msg in my openprocessing sketch Color to Midi notes visualID=4121
This “Webcam Midi Thing” is very intresting!
I don’t understand which data you get from the webcam frames and then convert to Midi…
Did you tryed to send this data to a sintethizer?
I think that if you could use the data to variate parameters of a continuous sound it could be more natural. The periodic midi notes makes me imagine a compulsive pianist jajaja :)
I’d like to keep in touch to know more about this “Thing”
If u want to share ideas, send me mail!
nachohotmail@hotmail.com
Lawrie
June 13th, 2010 at 3:27 pm
Hi ZVUHO – every time you catch an image from the webcam – the image get divided into grid segments – each of these segments is then analysed to find the dominant colour in it – and then this colour is mapped into the Midi range – with black being midi note 0 and white being midi note 127 – and all other colours in between.
Yeah – I bet it would sound nicer to use CC’s to modulate a sound as opposed to sending individual notes – it does too often sound like a compulsive pianist.
If you’d like to have a play with the app – it’s an Air app bundled in with the Flash Midi Server stuff, which you can get at the google code page –
http://code.google.com/p/flash-midi-server/downloads/list
Cellular Automidi – Audio App - The Lawrie Cape Blog
July 22nd, 2010 at 11:31 am
[...] Flash Midi Server [...]
rumpelfilter
July 30th, 2010 at 1:11 pm
Great software, this really opens up a huge lot of possibilities!
How complicated would it be to have FMS sync to the Midi clock of a device? if possible at all…
cheers,
Hannes
Lawrie
July 30th, 2010 at 6:44 pm
Hi Rumpelfilter,
Glad to hear you like it – I’m hoping people will make some cool flash music apps using it.
In theory it would be possible to sync to the device clock, but I’m not sure if it’s supported by the Processing Midi Library I’m using. Maybe there’s something in the docs I’m missing -
http://ruinwesen.com/support-files/rwmidi/documentation/Controller-Controller-int-int-int.html
alfonsofonso
June 28th, 2011 at 12:07 pm
is it possible to send data from a midi controler to a swf to get some sound visualization?
Lawrie
June 28th, 2011 at 2:20 pm
Hi Alfonso,
Yep, it is possible to do that using a very similar set up. I had a rough demo working when I started work on this a few years ago. I’ll try and remake an input/output version – and I’ll post the files.
Flash Midi Server – I/O version. Work in progress - The Lawrie Cape Blog
June 30th, 2011 at 2:56 pm
[...] Flash Midi Server [...]
rob beattie
July 23rd, 2011 at 11:29 am
hi, ive been working on getting my head round a midi interface for my setup(keyboards) , done the graphic shell and now im confused….
can you help me out in development of a flash interface for midi, just need program change messages, bank control and midi channel control messages to work from my flash shell.
any help would be great. rob