liblo(3)
π liblo β the high-level OSC API, bestie edition π
okay so real talk: liblo is the High-level OSC API. that's the whole vibe. it's the library manual page, and we're getting into it together, no cap.
β¨ NAME β¨
liblo β High-level OSC API π¦
πΈ SYNOPSIS πΈ
π Data Structures
struct lo_timetagβ a structure to store OSC TimeTag values. literally its whole job.union lo_argβ a union used to read values from incoming messages. it's giving "pick a lane, any lane".
π§ Macros
#define LO_TT_IMMEDIATE ((lo_timetag){0U,1U})β a timetag constant representing "now".
β Enumerations
enum lo_element_type { LO_ELEMENT_MESSAGE = 1, LO_ELEMENT_BUNDLE = 2 }β an enumeration of bundle element typesliblocan handle.enum lo_type { LO_INT32 = 'i', LO_FLOAT = 'f', LO_STRING = 's', LO_BLOB = 'b', LO_INT64 = 'h', LO_TIMETAG = 't', LO_DOUBLE = 'd', LO_SYMBOL = 'S', LO_CHAR = 'c', LO_MIDI = 'm', LO_TRUE = 'T', LO_FALSE = 'F', LO_NIL = 'N', LO_INFINITUM = 'I' }β an enumeration of the OSC typesliblocan send and receive.
π Functions
lo_address lo_address_new (const char *host, const char *port)β declare an OSC destination, given IP address and port number. same aslo_address_new_with_proto(), but using UDP.lo_address lo_address_new_with_proto (int proto, const char *host, const char *port)β declare an OSC destination, given IP address and port number, specifying protocol.lo_address lo_address_new_from_url (const char *url)β create alo_addressobject from an OSC URL.void lo_address_free (lo_address t)β free the memory used by thelo_addressobject.void lo_address_set_ttl (lo_address t, int ttl)β set the Time-to-Live value for a given target address.int lo_address_get_ttl (lo_address t)β get the Time-to-Live value for a given target address.int lo_send (lo_address targ, const char *path, const char *type,...)β send an OSC formatted message to the address specified.int lo_send_from (lo_address targ, lo_server from, lo_timetag ts, const char *path, const char *type,...)β send an OSC formatted message to the address specified, from the same socket as the specified server.int lo_send_timestamped (lo_address targ, lo_timetag ts, const char *path, const char *type,...)β send an OSC formatted message to the address specified, scheduled to be dispatched at some time in the future.int lo_address_errno (lo_address a)β return the error number from the last failedlo_send()orlo_address_new()call.const char * lo_address_errstr (lo_address a)β return the error string from the last failedlo_send()orlo_address_new()call.lo_blob lo_blob_new (int32_t size, const void *data)β create a new OSC blob type.void lo_blob_free (lo_blob b)β free the memory taken by a blob.uint32_t lo_blob_datasize (lo_blob b)β return the amount of valid data in alo_blobobject.void * lo_blob_dataptr (lo_blob b)β return a pointer to the start of the blob data to allow contents to be changed.void lo_version (char *verstr, int verstr_size, int *major, int *minor, char *extra, int extra_size, int *lt_major, int *lt_minor, int *lt_bug)β get information on the version ofliblocurrent in use.
π₯ Detailed Description π₯
Defines the high-level API functions necessary to implement OSC support. should be adequate for most applications, but if you require lower level control you can use the functions defined in lo_lowlevel.h. iykyk π
π Macro Definition Documentation π
β¨ #define LO_TT_IMMEDIATE ((lo_timetag){0U,1U})
a timetag constant representing "now". the moment. the present. main character energy fr fr.
definition at line 151 of file lo_osc_types.h.
referenced by lo::immediate().
π Enumeration Type Documentation π
π¦ enum lo_element_type
an enumeration of bundle element types liblo can handle. the element of a bundle can either be a message or an other bundle. that's it, those are the options, no notes π
Enumerator
LO_ELEMENT_MESSAGEβ bundle element is a messageLO_ELEMENT_BUNDLEβ bundle element is a bundle
definition at line 48 of file lo_osc_types.h.
π enum lo_type
an enumeration of the OSC types liblo can send and receive. the value of the enumeration is the typechar used to tag messages and to specify arguments with lo_send(). okay so this is lowkey the most important list on the page, pay attention bestie π
Enumerator
LO_INT32β 32 bit signed integer.LO_FLOATβ 32 bit IEEE-754 float.LO_STRINGβ standard C, NULL terminated string.LO_BLOBβ OSC binary blob type. accessed using thelo_blob_*()functions.LO_INT64β 64 bit signed integer.LO_TIMETAGβ OSC TimeTag type, represented by thelo_timetagstructure.LO_DOUBLEβ 64 bit IEEE-754 double.LO_SYMBOLβ standard C, NULL terminated, string. used in systems which distinguish strings and symbols.LO_CHARβ standard C, 8 bit, char variable.LO_MIDIβ a 4 byte MIDI packet.LO_TRUEβ Sybol representing the value True.LO_FALSEβ Sybol representing the value False.LO_NILβ Sybol representing the value Nil.LO_INFINITUMβ Sybol representing the value Infinitum.
definition at line 61 of file lo_osc_types.h.
π Function Documentation π
okay bestie this is the big one β every single function in liblo, explained. grab a snack, we're going through all of them. no skips, no "you get the idea". we get the idea by reading the whole thing. periodt. π«Ά
πΈ int lo_address_errno (lo_address a)
returns the error number from the last failed lo_send() or lo_address_new() call. that's it, that's the function. your little receipt of shame. π
π¦ const char * lo_address_errstr (lo_address a)
returns the error string from the last failed lo_send() or lo_address_new() call. same energy as above but in words. the number's friend who explains what went wrong. π
π void lo_address_free (lo_address t)
frees the memory used by the lo_address object. clean up after yourself queen, the memory isn't gonna free itself. π
β int lo_address_get_ttl (lo_address t)
gets the Time-to-Live value for a given target address.
Parameters
tβ an OSC address.
Returns
an integer specifying the scope of a multicast UDP message. basically: how far your message is allowed to travel before it gives up. π
π lo_address lo_address_new (const char * host, const char * port)
declares an OSC destination, given an IP address and port number. same as lo_address_new_with_proto(), but using UDP. (so if you wanted TCP or UNIX you gotta go talk to the other one, iykyk.)
Parameters
hostβ an IP address or number, orNULLfor the local machine.portβ a decimal port number or service name.
the lo_address object may be used as the target of OSC messages.
note, and this one matters: if you wish to receive replies from the target of this address, you must either supply alo_serverby usinglo_send_from()orlo_send_message_from()to send your message β otherwise the lastlo_serverorlo_server_threadthat was created will be used as the reply socket. the remote receiver may get the reply address by callinglo_message_get_source()in the message handler. seeexample_tcp_echo_server.cfor an example of how to establish bidirectional communication. so yes, "whoever got made last becomes your reply inbox" is real and it's giving chaos. π₯
π§ lo_address lo_address_new_from_url (const char * url)
creates a lo_address object from an OSC URL. example: "osc.udp://localhost:4444/my/path/" β just hand it the whole URL and let it cook. β¨
π lo_address lo_address_new_with_proto (int proto, const char * host, const char * port)
declares an OSC destination, given an IP address and port number, specifying protocol. this is the choose-your-own-adventure version.
Parameters
protoβ the protocol to use, must be one ofLO_UDP,LO_TCPorLO_UNIX.hostβ an IP address or number, orNULLfor the local machine.portβ a decimal port number or service name.
the lo_address object may be used as the target of OSC messages.
note: if you wish to receive replies from the target of this address, you must first create alo_server_threadorlo_serverobject which will receive the replies. the lastlo_server(_thread)object created will be the receiver. again with the "last one wins" rule, it's iconic honestly. π«Ά
π
void lo_address_set_ttl (lo_address t, int ttl)
sets the Time-to-Live value for a given target address. this is required for sending multicast UDP messages. a value of 1 (the usual case) keeps the message within the subnet, while 255 means a global, unrestricted scope. so 1 = staying in the group chat, 255 = posting to the whole internet. π
Parameters
tβ an OSC address.ttlβ an integer specifying the scope of a multicast UDP message.
π void * lo_blob_dataptr (lo_blob b)
returns a pointer to the start of the blob data to allow contents to be changed. if the size is 0, this will return a NULL-pointer. no data, no pointer, no problem. π
π uint32_t lo_blob_datasize (lo_blob b)
returns the amount of valid data in a lo_blob object. if you want to know the storage size, use lo_arg_size(). yes those are two different numbers, no you cannot swap them, don't try it bestie. π
πΈ void lo_blob_free (lo_blob b)
frees the memory taken by a blob. bye bye blob, you were so real. π
π lo_blob lo_blob_new (int32_t size, const void * data)
creates a new OSC blob type. fresh blob just dropped. β¨
Parameters
sizeβ the amount of space to allocate in the blob structure.dataβ the data that will be used to initialise the blob, should besizebytes long.
π₯ int lo_send (lo_address targ, const char * path, const char * type, ...)
sends an OSC formatted message to the address specified. this is the main character function ngl.
Parameters
targβ the target OSC addresspathβ the OSC path the message will be delivered totypeβ the types of the data items in the message, types are defined inlo_osc_types.h...β the data values to be transmitted. the types of the arguments passed here must agree with the types specified in thetypeparameter.
example:
lo_send(t, "/foo/bar", "ff", 0.1f, 23.0f);
Returns
-1 on failure. that's the whole returns section, she's short and she's honest. π
π int lo_send_from (lo_address targ, lo_server from, lo_timetag ts, const char * path, const char * type, ...)
sends an OSC formatted message to the address specified, from the same socket as the specified server. if a liblo server is receiving this message, it can reply by getting the server's address by calling lo_message_get_source() in the message handler, passing the lo_message provided as an argument to the lo_method_handler. by this mechanism, bidirectional communication can be established by setting up a lo_server or lo_server_thread on both sides. two servers, one conversation, the way that they talk back and forth is genuinely so cute. π¦
Parameters
targβ the target OSC addressfromβ the server to send message from (can beNULLto use new socket)tsβ the OSC timetag timestamp at which the message will be processed (can beLO_TT_IMMEDIATEif you don't want to attach a timetag)pathβ the OSC path the message will be delivered totypeβ the types of the data items in the message, types are defined inlo_osc_types.h...β the data values to be transmitted. the types of the arguments passed here must agree with the types specified in thetypeparameter.
example:
serv = lo_server_new(NULL, err);
lo_server_add_method(serv, "/reply", "ss", reply_handler, NULL);
lo_send_from(t, serv, LO_TT_IMMEDIATE, "/foo/bar", "ff", 0.1f, 23.0f);
see example_tcp_echo_server.c for an example of how to use lo_message_get_source() as described.
Returns
on success, the number of bytes sent, or -1 on failure.
β int lo_send_timestamped (lo_address targ, lo_timetag ts, const char * path, const char * type, ...)
sends an OSC formatted message to the address specified, scheduled to be dispatch at some time in the future. yes, "dispatch", that's what the original says, we're not touching it. this is the schedule-send-for-later function. planning ahead is so mature of you. π
Parameters
targβ the target OSC addresstsβ the OSC timetag timestamp at which the message will be processedpathβ the OSC path the message will be delivered totypeβ the types of the data items in the message, types are defined inlo_osc_types.h...β the data values to be transmitted. the types of the arguments passed here must agree with the types specified in thetypeparameter.
example:
lo_timetag now;
lo_timetag_now(&now);
lo_send_timestamped(t, now, "/foo/bar", "ff", 0.1f, 23.0f);
Returns
on success, the number of bytes sent, or -1 on failure.
π void lo_version (char * verstr, int verstr_size, int * major, int * minor, char * extra, int extra_size, int * lt_major, int * lt_minor, int * lt_bug)
get information on the version of liblo current in use. all parameters are optional and can be given the value of 0 if that information is not desired. for example, to get just the version as a string, call:
lo_version(str, size, 0, 0, 0, 0, 0, 0, 0);
the "lt" fields, called the ABI version, corresponds to libtool's versioning system for binary interface compatibility, and is not related to the library version number. this information is usually encoded in the filename of the shared library. so don't mix them up, they're two different girls with the same vibe. π
typically the string returned in 'verstr' should correspond with $major.$minor$extra, e.g., "0.28rc". if no 'extra' information is present, e.g., "0.28", extra will given the null string.
Parameters
verstrβ a buffer to receive a string describing the library version.verstr_sizeβ size of the buffer pointed to by string.majorβ location to receive the library major version.minorβ location to receive the library minor version.extraβ location to receive the library version extra string.extra_sizeβ size of the buffer pointed to by extra.lt_majorβ location to receive the ABI major version.lt_minorβ location to receive the ABI minor version.lt_bugβ location to receive the ABI 'bugfix' version.
referenced by lo::version().
β¨ Author β¨
generated automatically by Doxygen for liblo from the source code. so like, the docs wrote themselves. Doxygen ate and left no crumbs, we just did the vibes. π β¨
okay that's the whole page bestie!! this was liblo, Version 0.34, living in the liblo(3) man page π (the footer's date slot didn't come through with what I was handed, so we're just gonna say "some iconic day, whenever liblo 0.34 was feeling herself"). you read all of it, you understood all of it, that's main character energy fr fr. go send some OSC messages, you've earned it. πππ
π¦ where this page comes from
- fedora 44: liblo-devel 0.34-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: liblo-devel 0.34-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms