Forums > MaxMSP

sprintf maximum arguements

May 22, 2008 | 4:00 pm

Hello All

I need to create a string that has more arguments than 31(which appears to be the largest in my version 4.6.2)

I tried with zl join etc but I have some commas in the string which caused problems with this aproach

any easy way round this?


May 22, 2008 | 4:15 pm

I think I can use the text object :)

The forum could do with a delete thread function if no-one has replied.


May 22, 2008 | 4:46 pm

Maybe not

I found that using the output of sprintf in to text you need 7 x " in the sprintf object in order to have the comma properly added to the output of text.

like %f\\\, %f

then put in to text

then the output from text would be 1.5, 2.5


May 22, 2008 | 7:21 pm

Quote: Mike S wrote on Thu, 22 May 2008 09:00
—————————————————-
> Hello All
>
> I need to create a string that has more arguments than 31(which appears to be the largest in my version 4.6.2)
>
> I tried with zl join etc but I have some commas in the string which caused problems with this aproach
>
> any easy way round this?
—————————————————-

I’d probably look at javascript.

mz


May 23, 2008 | 10:06 am

You may also find a simple solution by daisy-chaining sprintf objects. Use a couple of sprintf’s at the top level to concatenate string segments that do not contain commas, then use a final sprintf to insert the commas between the main components.

The flexibility is not unlimited, but may be enough for your purposes.


May 23, 2008 | 10:56 am

But don’t you need to provide the same number of %s or %f anyway?

For example

message 1 = transpose 20

message 2 = pitch 500Hz

message 1

message 2

combined


May 23, 2008 | 11:05 am

message 1

message 2

combined


May 23, 2008 | 12:32 pm

Ah the symbol thing!

Ta


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