OSC to midi

Hello I had to make an application that listen OSC messages and convert it to a midi note.

Example:
message “play int(12)” → send midi note on 12, velocity 127
message “stop int(12)” → send midi note off 12, velocity 0

I know how to send a midi note on/off via MBS Plugin from @Christian_Schmitz my question is how to listen OSC from an IP address on Xojo

thanks

Use ServerSocket and TCPSocket classes.
I bet Xojo comes with an example to listen for some port using them…

1 Like

I use touchOSC that generate OSC message locally on port 8000.

I try to use ServerSocket with port 8000 with no result

:frowning:

Xojo ServerSocketServerTest example project works for me withTouchOSC and Xojo 2021r2.1:

Thanks @Julia_Truchsess default configuration was not TCP…

1 Like

a way to resolve charset pb ?

You need to properly decode the packages.
The strange characters you see are bytes in the data stream, which you need to interpret as numbers probably.
Like the number for the note or some flags.

1 Like

Sorry, “pb” did register in my mind as an abbreviation for “problem” and I didn’t know what you meant :slight_smile:

As Christian said, they are bytes representing the message payload, you will have to dig into TouchOSC documention for the packet structure and decode accordingly.

pb = problem

in the first image you can see the message send by OSC Touch : “/fader 1 FLOAT(0.37574449)”

in Xojo listbox I got “?.fader.?f/??>???”

Try looking at those strings in the debugger’s binary view to reverse-engineer the format.