how to keep commas in a "one symbol" string?

efiocco's icon

Hi,
I'm trying to send strings from Max to Csound through UDP (I would like to read them from [text] and output them through [udpsend])
Those strings includes commas and they have to be sent as "one symbol" for not being truncated by [udpsend].

So, the output of [text] should pass through [tosymbol], but in this case I loose the commas...

How can I get out of this? I'm frustrated....

thanks!

madjax's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Try this. There may be a more elegant way, but I think this is what you are talking about. The regexp in this case is changing a "," into ","

efiocco's icon

Thanks Mad jax for your reply, it almost works, but I still loose some of the commas ;)

commas_test.maxpat
Max Patch
Jesse's icon
Max Patch
Copy patch and select New From Clipboard in Max.

sprintf is helpful here

efiocco's icon

Thanks Jesse, the problem is that each string is different in terms of % arguments position and lenght... ;-(

Roman Thilenius's icon

take care, you might simply exceed the lenght a symbol in max may have.

otherwise the general way is to first pack the separate messages into a list and then convert the list to a symbol.

Roman Thilenius's icon

the exception would be when there is a single comma among the input data. this can not even be sent out from anywhere ;)

Jesse's icon
Max Patch
Copy patch and select New From Clipboard in Max.

If you have a variety of string lengths it will be harder, but you can prepend your input lists with a tag that you can then use to route to the appropriate sprintf formatter. This can make for cumbersome patches but at least you have a way to achieve it. A brief example below.