demonstrates how to construct a simple OSC server that responds to a message with a particular address.
This example demonstrates the primary way to implement an OSC server that responds to a message with a particular address by executing a function associated with that address.
It makes use of the built-in address prefix /! which, when placed in front of an address such as /!/addr means "lookup /addr and execute it. See Example: OSC Server that Dispatches Specific Addresses for an example that shows how to respond to a prefix without the need for that prefix.
#include <stdio.h>
#include <string.h>
#define NUM_BYTES 65536
{
printf("Hello, World!\n");
}
int main(int ac, char **av)
{
char bytes[NUM_BYTES];
ose_bundle bundle = ose_newBundleFromCBytes(NUM_BYTES, bytes);
1024, 1024, 1024, 1024, 1024);
ose_pushMessage(vm_env, "/greet", strlen("/greet"), 1,
OSETT_ALIGNEDPTR, hello_world);
ose_pushMessage(vm_input, "/!/greet", strlen("/!/greet"), 0);
osevm_run(vm);
return 0;
}
provides global definitions and types
contains functions that structure an OSC bundle for use with other parts of this library
contains functions that manipulate the structure and contents of an OSE bundle and its elements
#define OSEVM_INPUT(osevm)
Get the input bundle.
Definition ose_vm.h:362
#define OSEVM_ENV(osevm)
Get the environment bundle.
Definition ose_vm.h:374