![]() | 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–2006 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 |
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 and TCP 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. Alternatively, make sure your firewall settings are appropriate.
The current version can be downloaded here:
The SuperCollider for Windows built maintained by the IEM Graz already comes with a preconfigured SwingOSC installation (however not always the newest):
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
.
There are other free implementations for the Java standard platform, like Apache Harmony and GNU Classpath. Kaffe.org has a list of related things. I have tested SwingOSC only with Sun's and Apple's VM and I don't know whether it runs with those alternatives.
SwingOSC_TCP.command
and SwingOSC_UDP.command
to boot a standard server. As of v0.29 they can be executed out-of-the-box. However, you may wish to customize the SwingOSC options using a text editor such as the TextEdit
application. If you cannot double-click these files, select each in the Finder and open the information window (Cmd+I). Choose to open these documents with the Terminal
application (located in /Applications/Utilities
).To use MovieView.java
(i.e. JSCMovieView
), you will need the Java Media Framework (JMF) classes from Sun (on Mac OS X use the cross-platform download). Put jmf.jar
in your system's classpath, e.g. on Mac OS X that can be /Library/Java/Extensions
. I'm hoping to find a better solution for movie playback in the future.
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:
-t <port>
: use the given TCP port for message reception. The SuperCollider classes assume that you use port 57111!-u <port>
: use the given UDP port for message reception. if absent, an arbitrary free port will be picked.-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
/classes
OSC command (see OSC reference for details).SwingOSC.jar
file, 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]
Please read the DevelopersNeeded note.
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).
To compile MovieView.java
, you will need to have jmf.jar
in your classpath (see requirements sections above). Otherwise remove MovieView.java
and the compiler won't complain.
SwingOSC.default.disconnect
) before quitting the server!Routine
and place short wait
statements in the body until no more message dropping occurs.-h
option is incompatible with TCP mode. instead ways of using "bonjour" should be evaluated for a next version.JSCSoundFileView
, JSCMovieView
, JSCTabbedPane
, JSCCheckBox
JFont
, JSCTextField
, JPen
JSCMultiSliderView
/classes
OSC commandOSCClient.java
to SwingClient.java
JSC2DSlider
, opacity in JSCCompositeView
, focus in JSCSlider
), missing classes (SwingDialog
), modifications (string operations in JPen
)System.out
not System.err
, so they are visible in SuperCollider's post windownew()
and start()
in SwingOSC.java
public (e.g. to be accessible by Eisenkraut)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: 09-feb-07