How to add a comma in a list?
I want to create a list of numbers with MAX to copy it in a C code. I am using a multislider for that.
The values inside the list coming from the multislider object needs to be seperated by a comma… But how can I manage it?
I tried to add the ASCII value of a comma (44).. but unfortunately that doesnt work (look at my patch)
----------begin_max5_patcher---------- 408.3ocuT10SCBCEF9Z3WQSuFMiuFn2X7N+GXLtESGbbTEZIzt3zk8eWZA1W LL.KtaZomdZOu8oukMlF3E70f.itG8JxvXioggNjJfQ8XCbFYcTJQnSCGwyx .lDaUMmDVK0wkIPAfnBDAsfD8onbAIOzj06blTP+ATYZ6b6j5v4DYTBks7sB HRVIh.+xYKywQ24OQ04T1hlWuF1pLJKEjZ0XWGjFq0.ewG23dXMYjLcMwOVP Io38aAekrYOlnBt0zT0X0SHvfuJqUKFjW.4.KFIfc7opPxuygpyGFu6jzenX qgREZB7FLRlNcnLwdDLQQAHl11Y77SuLalU2.wBgoJCU0mimO1NZ2hudfx.0 e.MXSi2H.TFHDjkPK9DFfBbPg2g779GbM1G3ZrC6BJNsghe30v0zwKIpjS5D FJ2xn4gWU6z+9Uj6Y3g6kvCcYvoT1o+sUKTU7igjfupHp4.2bcf1q1XPHoLh jxYGlj6QIkPiiA87MXIiFmyK4WsHPyO6UVu0jaOzj5uOWQMcR45PSWBmJGr0 7WvmXgJ8 -----------end_max5_patcher-----------
How about this?
regexp " " @substitute ", "
----------begin_max5_patcher---------- 363.3ocqSE1aBBCD8ykeEM8yrEnnF29z1uisESAtomAJj1hiMi+2WaATzYht 4Rnzbud2qu6kdaCHrzpVPynORegRHaCHDOjCfzGSXkh1rBg1mFSBeTktlE1c jAZMd3ZEJMCnuWIMZ7KvcRL+9ndXYSIJK.imn3CfUMlAzgTqElrUnb4BEjY5 jGmOwxDkOclaKoKH59H5a80f4dkXU2cIiUhTT5UB6YEJJXtC1ED39Eda8rBV Bs0zWYtumzMoZCZZLfMLzttc2X5kciDGgz3Iy+gczwi4yZnqBqdNYcNmi++5 bkMEFTWf4fZf3AqX906C7K5CO3eTDymue6B9v458X196QY6bCnV.RQZguvnQ cuuXVAJOczwKPG9wVhtpQkMb882D8fByA6CGovfUxQ4vOJmUXdNHGOhjiZm1 xOUbg+Z0vuB0j7GUSmUIpq2.JcOkdgXemrtR4BmE5CQYWnmQ6r0FbH+oAN11 E7chaNAr -----------end_max5_patcher-----------
Thank you, that looks good.. but I want to show the list in a textedit object because I need to copy the data out of max.
Illustrated in a textedit object the backslash is there again.. using a commentbox works without a backslash but there I cant copy the data.
BTW.. I am new at max and I have still problems dealing with the different datatypes like Lists,Symbols and stuff. Is there a tutorial dealing with it? Would be fine to know why different kind of objects show the same data in a different way..
sprintf ％f, ％f, ％f
just write as many variables like this in the sprintf object as your multislider provides..
if you have ints instead of floats just substitute the f with i
Another problem with the regexp object is that it cuts of the list after 40 items? Why?
The Number of variables is adjustable!
Thats why sprintf is not the very best solution.
then connect an iter to the left output of multislider, then a sprintf ％f, – with the comma – then a zl group with an argument twice the value of your values in the multislider
you can always adjust the argument of zl group via its second inlet
As often I solved the problem without understanding it.
Using "append ," works.