Discussion:
[ANN] Lua bindings for oscpack
(too old to reply)
Gaspard Bucher
2014-08-19 13:12:04 UTC
Permalink
Hi everyone,

I just released "osc", a Lua library to pack/unpack OSC messages. The
library is based on oscpack by Ross Bencina.

Compared to oscpack, this library adds support for sending key/value pairs
(hash). If anyone thinks adding Hash support to oscpack is interesting
outside of Lua, I can send a patch to Ross. Type values for a Hash are: '{'
(start hash), '}' (end hash). Encoding is simple it simply alternates
string (for key) and value type: {sfsfss}.

The library is really simple and has just two methods: pack and unpack.

osc for lua documentation <http://doc.lubyk.org/osc.html>

Cheers,

Gaspard
Ross Bencina
2014-08-19 14:20:07 UTC
Permalink
Hi Gaspard,

Looks cool. Does it support OSC bundles?

Cheers,

Ross.
Post by Gaspard Bucher
Hi everyone,
I just released "osc", a Lua library to pack/unpack OSC messages. The
library is based on oscpack by Ross Bencina.
Compared to oscpack, this library adds support for sending key/value
pairs (hash). If anyone thinks adding Hash support to oscpack is
interesting outside of Lua, I can send a patch to Ross. Type values for
a Hash are: '{' (start hash), '}' (end hash). Encoding is simple it
simply alternates string (for key) and value type: {sfsfss}.
The library is really simple and has just two methods: pack and unpack.
osc for lua documentation <http://doc.lubyk.org/osc.html>
Cheers,
Gaspard
_______________________________________________
OSC_dev mailing list
http://lists.create.ucsb.edu/mailman/listinfo/osc_dev
Gaspard Bucher
2014-08-19 19:54:51 UTC
Permalink
Hi Ross,

No, bundles are not supported. I could easily add support for them if
needed.

Lua code without bundles:

local url, ... = osc.unpack(data)
local fun = map[url]
if fun then fun(url, ...) end

This is the best API I could come with that is stateless, simple and avoids
the overhead of creating temporary tables with message arguments:

local timestamp = osc.unpackBundle(data, function(url, ...)
local fun = map[url]
if fun then fun(url, ...) end
end)
-- commit all changes, using timestamp or not.

packBundle would receive a list of messages and a timestamp.

Do you feel I should implement this ?

Gaspard
Post by Ross Bencina
Hi Gaspard,
Looks cool. Does it support OSC bundles?
Cheers,
Ross.
Post by Gaspard Bucher
Hi everyone,
I just released "osc", a Lua library to pack/unpack OSC messages. The
library is based on oscpack by Ross Bencina.
Compared to oscpack, this library adds support for sending key/value
pairs (hash). If anyone thinks adding Hash support to oscpack is
interesting outside of Lua, I can send a patch to Ross. Type values for
a Hash are: '{' (start hash), '}' (end hash). Encoding is simple it
simply alternates string (for key) and value type: {sfsfss}.
The library is really simple and has just two methods: pack and unpack.
osc for lua documentation <http://doc.lubyk.org/osc.html>
Cheers,
Gaspard
_______________________________________________
OSC_dev mailing list
http://lists.create.ucsb.edu/mailman/listinfo/osc_dev
_______________________________________________
OSC_dev mailing list
http://lists.create.ucsb.edu/mailman/listinfo/osc_dev
Loading...