Login | Register 

Using OSC in DAT with callback script

Still a little green? Ask your beginner's questions here

Using OSC in DAT with callback script

Postby maybites » Sun Jun 17, 2018 11:24 am


I have been successfull in using the OSC in Dat node to get OSC data, but I would like to expand the function of the node by dynamically setting the maximum lines (rsp. a more elegant way)

my stream of osc data looks something like this:

print: /frame/start 16277
print: /skeleton/bone 2 1 position 0.091817 0.834653 1.091124
print: /skeleton/bone 2 1 quat -0.057058 0.932215 0.030215 0.356099
print: /skeleton/joint 2 21 quat -0.031265 0.945332 -0.035648 0.322645
print: /frame/end 16277

and at the moment the node only outputs a table once it has reached a set size (Maximum Lines).

I would like to ouput the table once it reaches a /frame/end message.

so far I was able to use the callback script to clear the table each time it reaches the /frame/end message, but this is (obviously) not working.

Code: Select all
def onReceiveOSC(dat, rowIndex, message, bytes, timeStamp, address, args, peer):
   if message.startswith('/frame/end'):

now I wonder if there is a command I can send to the OSCIn node to force it to send the table...


Posts: 2
Joined: Fri May 11, 2018 7:53 am

Re: Using OSC in DAT with callback script

Postby elburz » Mon Jun 18, 2018 11:32 am

A better strategy might be to take every message coming in, write it to a staging table (not connected to the output of the OSC In DAT), then when you get the frame/end, write that final line, then do a op().copy() of the whole staging table into an "output" table. That way your output table only updates in the manner you're mentioning when it updates once per frame/end.
Elburz Sorkhabi
Creative + Technology
nVoid Art-Tech Limited
Posts: 1994
Joined: Fri Jun 01, 2012 6:55 pm
Location: Toronto, Canada

Return to Beginners

Who is online

Users browsing this forum: Bing [Bot], Gallo and 23 guests