Forums > MaxMSP

List: Replace Space with Comma?

February 11, 2014 | 8:47 am

Hi!
I want to send three values from Sliders via a Serial Object.
Pak combines the values in a form like "255 24 145" but I need to seperate the values with a comma.

Thanks in advance for your Help

Brantiko


February 11, 2014 | 9:19 am

Hi !

– Pasted Max Patch, click to expand. –

.
is it okay ?


February 11, 2014 | 9:36 am

Thanks but.. when I put it through "tosymbol" the commas are gone again.

I tried to replace the 32 (ASCII Sapce) with 44 (ASCII Comma) after "atoi" and then convert it back but it seems as if max has some problems with commas as normal ASCII Letter.

Any Ideas?

Brantiko


February 11, 2014 | 10:06 am

im not quite sure how to do this :/

– Pasted Max Patch, click to expand. –

February 11, 2014 | 10:13 am

i dont know about the serial , but cant you just send a list ?


February 11, 2014 | 12:52 pm

No! The device that waits for data needs to have a comma to seperate the values.

I will try your solution later…

Thanks,

Brantiko


February 11, 2014 | 1:09 pm

Does it NEED to be a symbol? Can you post a sample of what you are trying to do?


February 12, 2014 | 2:57 am

You need to be aware that inside Max the comma has a special meaning. You can’t just insert commas into messages and expect everything else to continue as is. It’s like dropping hydrochloric acid onto gold (don’t try this at home with your wedding ring, kids).

If you want commas somewhere, you need to tell us exactly where and how and when.

If you’re sending out to a serial device, probably the most appropriate way is to set up a list of ASCII codes and insert the integer 44 where you’re wanting a comma.

But you’re going to need to be a lot(!!!) more specific if you want specific help.


February 13, 2014 | 4:25 am

I tried to replace the 32 (ASCII Sapce) with 44 (ASCII Comma) after "atoi" and then convert it back but it seems as if max has some problems with commas as normal ASCII Letter.

Are you printing your output or just looking at results in a message box? It seems like there is some confusion about the nature of symbols and/or the functionality of a message box. It’s not really clear what you want… but it might look like 255\,24\,145 in a message box. That doesn’t mean it will look like that to your device.

– Pasted Max Patch, click to expand. –

Viewing 9 posts - 1 through 9 (of 9 total)