benmca
YaBB Newbies
Offline
Posts: 4
WA
Csound, OscP5 and MovieMaker
Sep 8th , 2008, 8:45pm
Hi Folks: I am trying to make a movie using Csound and Processing. Csound generates sound events, some of which are accompanied by an OSC message to Processing. On the Processing side, every message received will draw a circle whose width is related to the osc param passed in from csound. It looks great on screen, but doesn't once I introduce the moviemaker class. I know I should expect latency when generating video, so I'm wondering what my options are in generating accurately-timed video from osc messages. I don't need it to render correctly in realtime, I just want the video to come out with correct timing. My processing code is below. If I leave the MovieMaker lines commented out, the onscreen rendering is correct. If I uncomment them, the timing is off and the graphics drawn in my OSCMessage handler seem to be cached and drawn all at once, every 8 messages or so. Does that make sense? import processing.video.*; import oscP5.*; import netP5.*; MovieMaker mm; OscP5 oscP5; NetAddress myRemoteLocation; int index = 0; void setup() { size(720, 480); frameRate(25); OscProperties properties = new OscProperties(); // mm = new MovieMaker(this, width, height, "drawing.mov"); properties.setRemoteAddress("localhost",12000); properties.setListeningPort(12000); properties.setDatagramSize(1024); oscP5 = new OscP5(this,properties); background(0); } void draw() { // mm.addFrame(); } /* incoming osc message are forwarded to the oscEvent method. */ void oscEvent(OscMessage theOscMessage) { OscArgument arg = theOscMessage.get(0); int i = arg.intValue() * 10; int x = int(random(width)); int y = int(random(height)); ellipse(x, y, i, i); } -=-=- I'm a programmer, so I dug into the Processing source. I wonder if my best option is to some slave Processing's view of time (it's system time in most spots I saw in the code) to Csound's view of time? It's kind of analogous to a Clock Source in MIDI or Digital Audio.. Thoughts? Thanks people!