SwingOSC is an OpenSoundControl (OSC) server intended for scripting Java(tm), such as to create graphical user interfaces with AWT or Swing classes. It uses the reflection and beans mechanism to dynamically create instances of java classes and control them. A separate set of SuperCollider language classes is included to allow the building of GUIs from within sclang.
SwingOSC is (C)opyright 2005 by Hanns Holger Rutz. All rights reserved. SwingOSC is released under the GNU General Public License and comes with absolutely no warranties. To contact the author, send an email to contact at sciss.de
For project status, API and current version, visit www.sciss.de/swingOSC.
For OSC communication, SwingOSC uses the NetUtil library, which is licensed under the GNU Lesser General Public License (LGPL). The compiled library is included, for sourcecode and details visit www.sciss.de/netutil.
SwingOSC uses UDP network protocols. It allows to create and execute almost any kind of java code on your machine. Therefore, running SwingOSC in a network that can be accessed from outside is a severe security problem, allowing hijacking, information retrieval and massive damage on your machine. You have been warned!
It is strongly advised to launch SwingOSC with the -L option which limits communication to the local computer.
The current version can be downloaded here:
The SuperCollider for Windows built maintained by the IEM Graz already comes with a preconfigured SwingOSC installation:
SwingOSC is written in Java(tm) and requires a Java runtime environment (JRE) version 1.4 or better. On Mac OS X you already have this runtime. On other platforms you may need to download and install a recent runtime from java.sun.com. You can verify your current java version by opening a terminal and executing the command java -version
.
SwingOSC.command
in the TextEdit
application. Modify the cd
statement to reflect your actual SwingOSC installation location. Save and close the document. Select SwingOSC.command
in the Finder and open the information window (Cmd+I). Choose to open this document with the Terminal
application (located in /Applications/Utilities
).
Open a terminal and cd
into the SwingOSC folder. Either run the default script by typing sh SwingOSC.sh
, or launch with custom options:
> java [java-VM-options] -jar build/SwingOSC.jar [swing-osc-options]
where the VM options are:
-Dswing.defaultlaf=<LookAndFeelClassName>
: specify a custom look-and-feel class. e.g. com.birosoft.liquid.LiquidLookAndFeel
.-Dapple.awt.brushMetalLook=true
: (Mac OS only) use the brushed-metal window skin as known from the Finder and traditional SuperCollider GUI.-Xdock:icon=application.icns
: (Mac OS only) use a prettier icon for display in the dock and programme switching screen.-Xdock:name=SwingOSC
: (Mac OS only) alternative screen nameand the SwingOSC options are:
-u <port>
: use the given UDP port for message reception. if absent, an arbitrary free port will be picked. The SuperCollider classes assume that you use port 57111!-L
: use loopback address ("127.0.0.1") for communication. if absent, the local host's IP address is used. when your computer is connected to a network and SwingOSC needs only be accessed from the local computer, make sure you use this option to minimize the security issue mentioned above.
-i
: run Swing initialization upon startup. On Mac OS, a terminal app becomes a GUI app with screen menu bar and icon in the Dock, as soon as an AWT or Swing component is created. This initialization can be enforced by using this opton.-h <host:port>
: send a [ /swing, "hello" ]
message to the given socket. this kind of manual "bonjour" is used by the SuperCollider classes to detect the startup of the SwingOSC server.if you wish to include custom java classes or libraries, you can either include them in the SwingOSC.jar
file; otherwise you will have to add them to the java class path, as shown in the following example which adds the freetts speech libraries (assuming they have been copied to the lib
folder):
> java -cp build/SwingOSC.jar:lib/freetts.jar:lib/jsapi.jar de.sciss.swingosc.SwingOSC [swing-osc-options]
examples
folders.OSC-Command-Reference.html
provides an introduction to the concept of SwingOSC and explains all commands that the server understands.
As of v0.35, I'm using Eclipse 3 to compile the project which makes cross-platform compliation easier. As I'm new to Eclipse, some stuff may still look strange. Choose the main SwingOSC folder as Eclipse's workspace. It contains the invisible file .project
and the invisible folder .settings
that are read by Eclipse. After a fresh install, you may need to select the project in Eclipse's package explorer and choose "Refresh" from the context menu.
Since I didn't manage to configure a .jar exporter to include all the files that are necessary and automatically exclude others, I've included a custom shell script makejar.sh
which you can run after all classes have been compiled. This script will overwrite the file build/SwingOSC.jar
which includes all classes, the NetUtil library and all resources (images).
Without any IDE you can easily make a clean build by opening a terminal, cd
'ing into the SwingOSC folder and executing the following lines:
> chmod u+x *.sh > ./clean.sh > ./compile.sh > ./makejar.sh
(the chmod
is only necessary once after a fresh SwingOSC installation).
Routine
and place short wait
statements in the body until no more message dropping occurs.JSCCompositeView
, completions for JSCWindow
JSCPlugView
, JSCPlugContainerView
, JavaObject
JPen
, JSCUserView
, JSCTextView
, fixed JSCHLayoutView
and JSCVLayoutView
, added mouse, component resize and focus traversal tracking, modified the JMouseBase
gui, optimized performance, fixed a lot of bugs.MultiStateButton
was moved to the de.sciss.gui
package and is slightly modified.JStethoscope
/ JSCScope
/ .jscope
plusGUIFreqScope
by Lance Putnam-h
option/field
and /fieldr
commands/free
"toolkit"
object assignment which caused the -i
option to be ineffective. you can restore the original binding by sending a message [ "/local", \toolkit, [ "/method", "java.awt.Toolkit", \getDefaultToolkit ]]
JSCDragSource/Sink/Both
supercollider classesRangeSlider
and Slider2D
classes (+ related SC classes)JMacUGens.sc
supercollider class/import
package lookup mechanism (not yet accessible though)
java is a trademark of sun microsystems
i think mac os and xcode are trademarks of apple inc
windows is one of microsoft corp
jever is a trademark of some west german beer factory
lastmod: 02-aug-06