Java API via OSC interface

Discuss using the OSC interface to control SL

Moderator: jesse

Post Reply
heuermh
Posts: 3
Joined: Thu Jan 08, 2009 2:25 am

Java API via OSC interface

Post by heuermh »

It's probably too early to announce this, but I am writing a java API for SooperLooper that uses the OSC interface. The OSC messages are wrapped in java-style method names, e.g.

Code: Select all

SooperLooper sooperLooper = new SooperLooper("http://localhost:9999");
sooperLooper.setRecordThreshold(0.8f);
sooperLooper.hitRecord(1);
sooperLooper.saveSession("session.sl");
GPL license. Requires java 1.5 or later and maven 2.0.x to build.

If others are interested, I can put this up on sf.net, google code, or git-hub. Or I can just attach updates here.

michael
Last edited by heuermh on Tue Jan 13, 2009 12:28 am, edited 1 time in total.
jesse
Posts: 554
Joined: Sat Sep 06, 2008 9:46 am
Contact:

Re: Java API via OSC interface

Post by jesse »

Interesting, are you also writing a custom GUI or some other interface using Java?
heuermh
Posts: 3
Joined: Thu Jan 08, 2009 2:25 am

Re: Java API via OSC interface

Post by heuermh »

My motivation is that I built one of these

http://www.cycling74.com/story/2007/10/16/1252/3782

but ended up with only two working switches (my soldering skills are to blame). I need to manage some state in code such that the same two keystrokes can be mapped to different OSC commands in different situations. I am most proficient in java, so I thought I would start there. A nice side-effect will be a library that Processing can use.

If all goes well, I will do the same for ChucK.

Newer version attached, all the "push" code is there. I still need to come up with a good pattern for handle the "polling" parts of the OSC interface.

michael
Attachments
sooperlooper-osc-src.tar.gz
src tarball, about 50% feature-complete
(27.2 KiB) Downloaded 1857 times
heuermh
Posts: 3
Joined: Thu Jan 08, 2009 2:25 am

Re: Java API via OSC interface

Post by heuermh »

In ChucK:

Code: Select all

SooperLooper sl;
sl.connect();
2::second => now;
sl.downRecord();
8::second => now;
sl.upRecord();
4::second => now;
sl.hitUndo();
Or in Processing:

Code: Select all

SooperLooper sl = new SooperLooper();      
delay(2000);
sl.downRecord();
delay(8000);
sl.upRecord();
delay(4000);
sl.hitUndo();
I see the timer in the SooperLooper user interface go up to around 11 seconds on the record and up to around 6 seconds on the undo. I would expect it to stop at 8 and 4 seconds respectively.

Is the significant delay in the ChucK or Java --> SooperLooper engine OSC message or in the SooperLooper engine --> SooperLooper interface OSC message(s)?

michael
Post Reply