Receiving text via osc
-
Hello All,
A coworker of me is writing a Max/MSP application to receive SMS from smartphones and send them via OSC text messages.
I searched (a little) by myself, but I'm a beginner with OSC language.
It seems there no way for Isadora to receive OSC text message. Only values.
I'd like to be able to receive via OSC text messages (like "Hello how are you ?") and wire them to text draw actor.Did I miss something ?
Thanks
Philippe -
Dear Philippe,
Isadora can receive text; the _OSC type tag_ must be 's' per the OSC specification.Text must be ASCII because this is what the OSC spec says it must be. To quote the specification:_**OSC-string:** A sequence of non-null ASCII characters followed by a null, followed by 0-3 additional null characters to make the total number of bits a multiple of 32.__The specification does not allow for Unicode, UTF-8 or other kinds of text. _This test patch shows that Isadora can send text. Press letter 'a' on your Keyboard to see it work.Best Wishes,Mark -
THANK YOU MARK !
I've been struggling with this during 3 hours yesterday night. You gave me a good lead to follow.
I thought I had to patch in "Stream Setup".
I was trying to send text from OSCulator to Isadora, but it seems (I'm surelly wrong again) you can't send osc text with the "manually create message" function of OSCulator.So from an external application (i don't know which I could use to send simple osc messages) the right syntax would be :
osc.udp://localhost:1234/isadora/1/hello world
Am I right ?
Thanks again Mark
Best
Philippe -
Not quite;
This is right: osc.udp://localhost:1234/isadora/1The address you proposed above would be incorrect, because it would be /isadora/1/hello world -- this address would not be recognized by Isadora because it only looks for /isadora/1Instead, the text is a parameter following the address. The OSC message would end up something like this in "raw memory"/isadora/1 --- ,s --- this is the textwhere /isadora/1 is the address,s is the type tag indicator "," followed by an 's' to indicate a string (text)and then the text dataThe dashes are one or more bytes set to 0.If you are using the pre-release version you can use the "Monitor" window to see the layout in memory using my test patch.Hope that helps,Mark -
Ok, thanks for your explanations it's becoming clearer.
I already was using the new monitor function (very handy by the way)
When i use your patch i get these 4 lines :<- OSC | to 127.0.0.1:1234 = "/isadora/1" 1 String
<- OSC | 127.0.0.1:1234 | 2F 69 73 61 64 6F 72 61 2F 31 00 00 2C 73 00 00 | /isa dora /1.. ,s.. |
| 68 65 6C 6C 6F 20 77 6F 72 6C 64 00 | hell o wo rld. |
-> OSC | 127.0.0.1:59699 "/isadora/1" = 1 String
-> OSC | 127.0.0.1:59699 | 2F 69 73 61 64 6F 72 61 2F 31 00 00 2C 73 00 00 | /isa dora /1.. ,s.. |
| 68 65 6C 6C 6F 20 77 6F 72 6C 64 00 | hell o wo rld. |I understand the two first lines (sending a string on port 1234 to isadora/1) but the two last ones ?!
What's the port 59699 story ?I have to go to work (another), see you later and thanks for your patience.
best
Philippe -
Hello all, I'm coming back to this osc text project.
All things above have been clearly understood for me. (I think !)
I'm easily receiving text via OSC, and drawing it on screen. I'm using several text chopper actors to limit the number of characters per line and several text draw actors to draw each limited line (15 characters per line by example). It works.
But how would you avoid text chopper actor to cut in the middle of a word ?Thanks all.
Best
Philippe -
Have you tried the Text Wrapper actor? That will do what you want I think. I'm not sure what pre-release version it appeared in, but it's in the most recent one for sure.Best Wishes,Mark