简体   繁体   中英

How to send OSC to QLab with Java?

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM