Page 1 of 1

Send line break through OSC to text block?

Posted: Tue May 30, 2023 22:02
by farstriderfm
Hi,

I'm sending OSC data to Avenue through a node.js program which allows users to input text and it shows up in the text field of the text block or text animator. I can send this data and it works just fine, but I want to add a feature where the text goes to a new line if the message is too long.

Is this possible? And if so, what's the input? (Something like \n ??)

Thanks in advance.

Re: Send line break through OSC to text block?

Posted: Wed Jun 28, 2023 12:40
by Zoltán
Try sending a line feed (0A hex)

Re: Send line break through OSC to text block?

Posted: Thu Jun 29, 2023 19:05
by farstriderfm
Zoltán wrote: Wed Jun 28, 2023 12:40 Try sending a line feed (0A hex)
Thank you for your suggestion. Sending 0x0a was just displaying the ASCII value (the number 10) but I sent a "\n" as a string and that worked. I hope this helps someone else!

Re: Send line break through OSC to text block?

Posted: Sat Aug 12, 2023 04:49
by elijahnelson
Here's an example of how you might format your OSC message:

javascript
const osc = require('osc');

const udpPort = new osc.UDPPort({
localAddress: '127.0.0.1',
localPort: 12345, // Your OSC port
remoteAddress: '127.0.0.1', // Avenue's address
remotePort: 1234 // Avenue's OSC port
});

udpPort.open();

// Sending the OSC message with a newline character
const textMessage = "Hello,\nThis is a new line!";
udpPort.send({
address: '/text',
args: [
{
type: 's',
value: textMessage
}
]
},mapquest driving directions '127.0.0.1', 1234);
In this example, the textMessage variable contains the text you want to send with a newline character \n in between "Hello," and "This is a new line!". When Avenue receives this OSC message, it should interpret the newline character and display the text on two separate lines.

Remember to replace the relevant port numbers and addresses with the actual values you're using for your setup.

Re: Send line break through OSC to text block?

Posted: Tue Aug 29, 2023 08:06
by tshirtzesty
I imagine something could be scripted, but the API does not appear to provide OSC-related functionality. ExecProcess is a command-line OSC tool, so I'm assuming you could create something with itmini crossword.

Or, you could do something insane by transmitting your text encoded in midi to some midi (oh text events) -> OSCII-bot??? Upon further consideration, that might work... That is likely the best approach.

Re: Send line break through OSC to text block?

Posted: Thu Oct 12, 2023 11:48
by istvan1987
tshirtzesty wrote: Tue Aug 29, 2023 08:06 I imagine something could be scripted, but the API does not appear to provide OSC-related functionality. ExecProcess is a command-line OSC tool, so I'm assuming you could create something with it baba vanga predictions 2024.

Or, you could do something insane by transmitting your text encoded in midi to some midi (oh text events) -> OSCII-bot??? Upon further consideration, that might work... That is likely the best approach.
Unfortunately, this does not work! It might have been working back in August when you posted this, but not now (or I am doing something wrong) :(

Re: Send line break through OSC to text block?

Posted: Thu Oct 19, 2023 12:21
by Zoltán
How are you sending OSC, which application?