gilTclOSCDownload gilTclOSC is a lightweight extension of Tcl to format and parse Open Sound Control messages. gilTclOSC does not provide any transport services for the OSC packets: transport is done with Tcl TCP services (the socket command) or the tcl-udp Tcl extension (tcl udp is included in the GIL distribution). DownloadgilTclOSC is part of the GIL distribution. ActivationEasiest wayThe easiest way is to execute the following line in your Tcl interpreter: source ${where_gil_is_installed}/src/srcipt/gil_Init.tcl this loads all GIL extensions in your interpreter (including giltclosc), plus the tcludp extension that comes with the GIL distribution. Selective wayIf you prefer to only load the giltclosc extension, do one of: load ${where_gil_is_installed}/bin/osx/libgiltclosc.dylib | load ${where_gil_is_installed}/bin/x11/libgiltclosc.so | load ${where_gil_is_installed}/bin/win/giltclosc.dll depending on your platform. For udp transport services, load the tcl udp extension in your interpreter. This can be done either with: package require udp if the extension is installed on your system, or with: load ${where_gil_is_installed}/bin/osx/libudp*.dylib | load ${where_gil_is_installed}/bin/x11/libudp*.so | load ${where_gil_is_installed}/bin/win/udp*.dll (replace * by the version number of the extension provided with the distribution). Tcl commandsgilTclOSC adds the osc_write and osc_read Tcl commands for formatting and parsing OSC packets. OSC packet formatted as a listThe osc_read command returns an OSC packets formatted as a Tcl list either in the compact form or the detailed form. The osc_write command takes as an argument a list formatted in the detailed form. Detailed formThe list can either represent an OSC bundle or an OSC message. List representing bundles have the string #bundle as their first element, and other elements must be properly formatted OSC message lists. { #bundle <message> <message> ... } An OSC message list starts with an address pattern (such as: /some/address), followed by an even number of type specifiers and values. { <address_pattern> <type_specifier1> <value1> <type_specifier2> <value2> ... } where the type specifier is one of:
Compact formWhen returning an OSC packet list in the compact form, osc_read omits the type specifier in the messages: { <address_pattern> <value1> <value2> ... } Examplesosc_write $channel { /test i 12 i -1 } osc_write $channel [list #bundle [list /test i 13] DemoThe GIL distribution includes the Tcl scripts of an OSC demo application. |