flosc

flosc is a Java server that can communicate with anything that uses the OpenSound Control protocol. This includes software audio synthesizers like Max/MSP, Reaktor, and SuperCollider, and hardware like Lemur and SmartController. It can also communicate with Macromedia Flash (versions 5 and later) using Flash’s XMLSocket feature. flosc acts as a gateway between OSC and Flash, allowing messages to go in both directions. This enables many combinations of powerful, programmable platforms for high-quality animation, audio, video, and interactive production. flosc can accept simultaneous input from multiple OSC connections and Flash clients, and can broadcast messages to multiple Flash clients, but it does not do any routing. Think of it as a simple gateway or bridge between the UDP world of OSC and the TCP world of Flash XMLSockets.

Matt Wright accurately summarized flosc as:

“A standalone application written in Java that sends and receives OSC packets via UDP, translates bidirectionally between binary OSC packets and an XML encoding of OSC packets, and sends and receives XML entities via TCP in a way that’s compatible with Flash’s XMLSocket feature.”

Download

This archive contains the .java and .class files for the flosc server, as well as an example Flash client. The code might be useful if you want to see how to write a recursive OSC packet parser in Java, or how to parse or create XML in Flash, or how to create a 4-byte boundary aligned array of bytes from objects in Java. Why reinvent the wheel?

flosc-0.3.1.zip
(All platforms – 82 KB)

License

With the exception of the noted inclusions of other free and open source software, flosc is Copyright © 2004 Benjamin Chun. You can do anything you want with flosc and the source code, including create new software and sell it, pursuant to the terms of the LGPL 3 license.

Installation and Use

Put the files anywhere you like. Be sure you have a Java runtime environment version 1.1 or later installed. (All versions of OS X come with this, so that makes your life easy if you’re on a Mac.) Run the server like this:

java Gateway oscPort flashPort

where oscPort is the port where flosc will receive OSC packets (the UDP port for it to listen on), and where flashPort is the port to which Flash clients will connect (the TCP port you’re using in Flash).

To learn how to send and receive OSC packets using your application of choice, see the application documentation or the OpenSound Control site. Start the server, connect your Flash client, and send some packets back and forth. Then, all you have to do is think of something interesting to do with all this technology.

Applications

People have actually used flosc to make stuff. Really! Here’s proof:

Project Eclipse – Modular synthesis patch interface
Contemplace – Responsive environment
Space Jockey – Sound source positioning
Luminance – Interactive playground

Let me know if you’ve got something to add to this list. And if that stuff’s not stuffy enough, here’s a paper: OpenSound Control: State of the Art 2003 [PDF] and a conference proceedings.

Credits

This project is inspired by work done with my friend Sam Torrisi. Thanks to Colin Moock and Derek Clayton for their examples of basic XMLSocket communication in Flash, and the design for the example Flash client. Thanks to Sean Rooney for taking flosc, improving it, generalizing it, and then sharing it back. Thanks to Jesse Gilbert for actually reading the comments in my code and reminding me what static does in Java. Thanks to Dr. Toast for moving in with me so I would have to fix the bugs I was leaving open. And, of course, we would be nowhere without Matt Wright and the CNMAT crew.

flosc includes code from the (now-defunct) Java Apache Project — see Bytes.java for more information. It also includes code written by Phil Scovis — see TcpServer.java for more information. Open source is a good thing.

 

7 Responses to flosc

  1. Pingback: Nick Fox-Gieg’s Tutorials » Kinect Setup Links

  2. Pingback: MIDI2 – Java MIDI/Socket Server | A.Quarter.To.Seven

  3. Pingback: AIR – Max/MSP – WiiFlash | Code Stuff

  4. Pingback: Eyecon – rastreamento de movimento « Leandro De Maman

  5. robert beattie says:

    hi, ive been looking for some way to get my flash movie shell to speak to my midi setup, it involves motherkeyboards, rack mount synths and also effects units. all my equipment is midi based and i need a way of linking a touchscreen (win) tablet/flash flv to speak to my midi equipment. is this possable with flosc, and if so, how do i go about it, ?

    what im trying to do is devise a program that will send midi program changes and control changes to my gear through a flash app/movie, this includes just buttons to send the messages, also input text to save information to the buttons. how do i go about all this, hope you can help.

    rob

  6. Rich says:

    Wondering if anyone has considered using orbited ( http://www.orbited.org/ ) or similar to allow interaction with javascript. I would like to be able to control chuck ( http://chuck.cs.princeton.edu/ ) via Javascript; using flash in not an option for me.

    – Rich

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>