How to send OSC to QLab with Java?

335 views Asked by At

I am trying to send OSC (Open Sound Control) to Figure 53's QLab. So far I have come up with this code.

import com.illposed.osc.transport.udp.OSCPortOut;

import com.illposed.osc.OSCMessage;

import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class controller {
    public static void main(String[] args) throws UnknownHostException, IOException {
        OSCPortOut sender = new OSCPortOut(InetAddress.getByName("10.67.192.113"), 53000);
        OSCMessage msg = new OSCMessage("/cue/1");
         try {
            sender.send(msg);
         } catch (Exception e) {
             e.printStackTrace();
         }
    }
}

I have successfully added Illposed's JavaOSC library to my code, but then it says I need SLF4J, and when I try to add slf4j-api-1.7.30.jar it says Failed to load class "org.slf4j.impl.StaticLoggerBinder". When I try to run the above code with both libraries SLF4J and JavaOSC.

1

There are 1 answers

0
Ben Arrigo On

You will need to use Maven to handle the dependencies JavaOSC needs.

Here's a good tutorial for Eclipse. Just use a simple project, you do not need to do archetype selection.

Then add the following at the end of your new projects pom.xml file, before </project> but after everything else.

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