• Stars
    star
    157
  • Rank 238,399 (Top 5 %)
  • Language
    Java
  • License
    BSD 3-Clause "New...
  • Created almost 13 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OSC content format/"protocol" library for JVM languages
      _                       ____    _____   _____
     | |                     / __ \  / ____| / ____|
     | |  __ _ __   __ __ _ | |  | || (___  | |
 _   | | / _` |\ \ / // _` || |  | | \___ \ | |
| |__| || (_| | \ V /| (_| || |__| | ____) || |____
 \____/  \__,_|  \_/  \__,_| \____/ |_____/  \_____|

Status

License Latest version at Maven Central Issues Chat

REUSE status GitHub last commit Build Status

Code Quality (LGTM) Total alerts (LGTM) Status (SonarCloud) Coverage (SonarCloud) Bugs (SonarCloud) Vulnerabilities (SonarCloud)

What is this?

JavaOSC

JavaOSC is primarily a library that gives JVM language programs the ability of serializing, parsing, sending and receiving data in the OSC content format. It is written in Java 8, and its only runtime dependency is a logging facade (SLF4J). It is also an OSGi (a dynamic module system for Java) bundle.

In a separate package, it also contains a sample GUI that allows to send OSC messages to SuperCollider.

Open Sound Control (OSC)

is a simple content format, although it is often though of as a protocol for the transmission of data over a network.

Application domains

  • as a replacement for MIDI - a network-protocol for the exchange of musical control data between soft- and hardware, usually over a UDP/IP network
  • in robotics - for communication between the parts of a robot, or multiple robots amongst each other

Its main strength is its simplicity.

How to

Get it

The latest release version of the library is available on GitHub for manual download or on Maven central

<dependency>
	<groupId>com.illposed.osc</groupId>
	<artifactId>javaosc-core</artifactId>
	<version>0.7</version>
</dependency>

The latest development sources can be found on GithHub.

Run the Demo UI

... with SuperCollider

JavaOSC is not a standalone application, but designed to be used in other applications. Though there is a very basic application for demonstration purposes.

To run the demo app, make sure you have all parts packaged and installed:

mvn install

Then start the UI:

cd modules/ui
mvn exec:java

Next, launch SuperCollider (SC), open the file located in the modules/core/src/main/resources/supercollider/ directory, and load the synthdef into SuperCollider. Start the SC local server. In the JavaOSC Demo UI, click the "All On" button and start moving the sliders. You should hear the sounds change. To see what messages the UI is sending, run either the CNMAT dumpOSC, or turn on dumpOSC in SuperCollider.

... with PD

There is also a PureData patch created by Alexandre Quessy, available here.

To try the demo UI with PureData, launch (this is important!) pd-extended and open the file modules/core/src/main/resources/puredata/javaosc.pd. Turn down the volume a bit at first, as it might be very loud. Click the "All On" button, and start moving the sliders. You should hear the sounds change. To see what messages the UI is sending, just look in the PD window or in the terminal.

Use the library

The classes that deal with sending OSC data are located in the com.illposed.osc package. The core classes are com.illposed.osc.transport.OSCPort{In, Out}, com.illposed.osc.OSCMessage and com.illposed.osc.OSCBundle.

The common way to use the library is to instantiate an OSCPort{In, Out} connected to the receiving machine, and then call port.send(myPacket).

There are some associated JUnit tests, which also contain code that may illustrate how to use the library. They can be run with mvn test.

Release a SNAPSHOT (devs only)

To release a development version to the Sonatype snapshot repository only:

# open a "private" shell, to not spill the changes in env vars
bash
# set env vars
export JAVA_HOME="${JAVA_8_HOME}"
# do the release
mvn clean deploy
# leave our "private" shell instance again
exit

In the project you want to use the SNAPSHOT release, you need to add this to your pom.xml:

	<repositories>
		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</repository>
	</repositories>

Release (devs only)

Prepare "target/" for the release process

mvn release:clean

Setup for signing the release

To be able to sign the release artifacts, make sure you have a section in your ~/.m2/settings.xml that looks like this:

<profiles>
	<profile>
		<id>ossrh</id>
		<activation>
			<activeByDefault>true</activeByDefault>
		</activation>
		<properties>
			<gpg.executable>gpg2</gpg.executable>
			<!--
				This needs to match the `uid` as displayed by `gpg2 --list-keys`,
				and needs to be XML escaped.
			-->
			<gpg.keyname>Firstname Lastname (Comment) &lt;[email protected]&gt;</gpg.keyname>
		</properties>
	</profile>
</profiles>

If you have not yet done so, generate and publish a key-pair. See the Sonatype guide for further details about how to work with GPG keys.

Prepare the release

# open a "private" shell, to not spill the changes in env vars
bash
# set env vars
export JAVA_HOME="${JAVA_8_HOME}"
# check if everything is in order
mvn \
	clean \
	package \
	verify \
	gpg:sign \
	site
mvn release:clean
mvn \
	-DdryRun=true \
	release:prepare
# run the prepare phase for real
mvn release:clean
mvn \
	-DdryRun=false \
	release:prepare
# leave our "private" shell instance again
exit

This does the following:

  • Important for backwards compatibility: use the oldest possible JDK version to compile (currently 1.8)
  • asks for the release and new snapshot versions to use (for all modules)
  • packages
  • signs with GPG
  • commits
  • tags

Perform the release (main part)

# open a "private" shell, to not spill the changes in env vars
bash
# set env vars
export JAVA_HOME="${JAVA_8_HOME}"
# perform the release
git push origin master <release-tag>
mvn release:perform
mvn deploy -P release
# leave our "private" shell instance again
exit

This does the following:

  • pushes to origin
  • checks-out the release tag
  • builds
  • deploy into Sonatype staging repository
  • promote it on Maven Central repository (may have a delay of up to 4h)

Thanks

Thanks to John Thompson for writing the UI (demo application), Alexandre Quessy for the PD demo, and to Martin Kaltenbrunner and Alex Potsides for their contributions.

More Repositories

1

Jawk

Java AWK interpreter/compiler
Java
40
star
2

sent

a simple plaintext presentation tool
C
22
star
3

ReZipDoc

Repack uncompressed & diff visualizer for ZIP based files stored in git repos
Java
16
star
4

arity

Java Arithmetics Engine
Java
14
star
5

dANN

An Artificial Intelligence Library written in Java
Java
7
star
6

osh-tool

A command line tool for Open Source Hardware (OSH) technical project linting (quality assessment).
Nim
6
star
7

escher

Escher: A language for programming in metaphors
Go
5
star
8

my_clojure_openscad

Template for projects that create 3D objects from Clojure code using OpenSCAD in the background
Clojure
5
star
9

kicad-image-injector

A stand-alone (python) tool to replace rectangular template areas drawn onto a KiCad PCB with B&W images or QR-Codes.
Python
5
star
10

Javolution

Java Solution for Real-Time and Embedded Systems
Java
4
star
11

Remind

a sophisticated calendar and alarm program
C
3
star
12

sophia-q1

Rust library question repo - sophia - Question 1
Rust
2
star
13

AIA

Automatic Image Analysis
C++
2
star
14

PCV

Programmatric Computer Vision
C++
2
star
15

MachInt1

Objective-C
2
star
16

ModelleGehirn

Java
2
star
17

LibreOfficeImageOptimizer

This is an utility that reduces the file-size of images contained within a Libre-/Open-Office document, in order to cut down on the overall file-size, and to save memory and speed up working on the document.
Kotlin
1
star
18

projvar

A tool that tries to ensure a certain small set of project related environment variables are set.
Rust
1
star
19

SPDX-identifiers

1 column CSV file with the sorted SPDX license identifiers for each release
1
star
20

KAIK

C++
1
star
21

nim-ci

A CI base image when building nim(lang) packages for Linux (native compilation) and Windows (cross compilation).
Shell
1
star
22

Opcion

Opcion Font Viewer - Free font viewer for Windows, Mac and Linux
Java
1
star
23

GAI

General Artificial Intelligence - JVM based Skirmish AI for the spring RTS engine
Java
1
star
24

industrialbenchmark_python

Python
1
star
25

ChanServ

The ChanServ lobby bot, to be used with a Spring lobby server
Java
1
star
26

reuseify

A tool to generate REUSE compatible SPDX licensing info for a project stored in a git repo, using its git commit history for extracting author/copyright info, and a file with assigning regexes matchign the (git tracked/content) files to SPDX expressions.
Shell
1
star
27

MI2

1
star
28

LOSH-RDF

1
star
29

codify-rs

Automatic Rust code generation for initializing structs and enums
Rust
1
star
30

osh-dir-std-rs

Code that helps humans and machines deal with the OSH directory standard
Rust
1
star
31

kicad-text-injector

A CLI tool that allows you to post-process your KiCad PCB files, by replacing variables of the type `${NAME}` in your text elements.
Rust
1
star
32

mle

Extracts links from markup files. Currently `html` and `markdown` files are supported.
Rust
1
star