File Exchange

image thumbnail

Send Open Sound Control (OSC) Messages

version 1.1.0.0 (2.02 KB) by Mark
Simple script to send a single Open Sound Control (OSC) Message.

3 Downloads

Updated 10 May 2011

View License

Sends a Open Sound Control (OSC) message through a UDP connection

oscsend(u,path)
oscsend(u,path,types,arg1,arg2,...)
oscsedn(u,path,types,[args])

u = UDP object with open connection.
path = path-string
types = string with types of arguments,
supported:
i = integer
f = float
s = string
N = Null (ignores corresponding argument)
I = Impulse (ignores corresponding argument)
T = True (ignores corresponding argument)
F = False (ignores corresponding argument)
B = boolean (not official: converts argument to T/F in the type)
not supported:
b = blob

args = arguments as specified by types.

EXAMPLE
u = udp('127.0.0.1',7488);
fopen(u);
oscsend(u,'/test','ifsINBTF', 1, 3.14, 'hello',[],[],false,[],[]);
fclose(u);

See http://opensoundcontrol.org/ for more information about OSC.

Cite As

Mark (2020). Send Open Sound Control (OSC) Messages (https://www.mathworks.com/matlabcentral/fileexchange/31400-send-open-sound-control-osc-messages), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Ethan Nardella

Shirley Xiao

Hi sorry, trying to wrap my head around using this function. Currently I've just been using it to trigger some main window actions eg.
oscsend(u,'/action', 'i', 40005); % remove tracks in the main window.

Is there any way of using the function to trigger other window actions, such as the media explorer window
oscsend(u,'/action', 'i', 40030); %Browser: Select next file in directory

SARVESH AGRAWAL

Thank you for this!

Bruce Wiggins

Does what it says on the tin. Many thanks :-)

Tom O'Connor

Mark

In MAX/MSP;

udpreceive 7488
|
OSC-route /test /anothertest /etc
| | |
unpack 1 2 3 4 5 6 7 8 9
| | | | | | | | |
all nine example arguments

Updates

1.1.0.0

Fixed a little bug (line 40: nargin >= 3 instead of 2)

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux