Forums > MaxMSP

Changing $1 to $x using flonum/number

January 3, 2012 | 2:06 pm
– Pasted Max Patch, click to expand. –

This may not be the best implementation of what I’m trying to do, and there may be a very simple way to do it, but…

The message box needs to change, so from "line $1" to "line $x", whatever x may be. It works up to $10, but anything above 10 is formatted as "/$xx". That slash causes the rest of the patcher not to work.

Is there any way to do this?


January 3, 2012 | 7:01 pm

When using #n or $n, Max will only substitute the first 9 items.

– Pasted Max Patch, click to expand. –

January 3, 2012 | 7:03 pm

So what are you trying to do?


January 4, 2012 | 1:55 am

messagebox-free version:

20, 30, 40
[list line 0] [list line 0] [list line 0]

or for list input:

20 30 40
[unpack 0 0 0]
[pak line 0] [pak line 0] [pak line 0]

-110


January 4, 2012 | 8:31 am

Cheers for the help!

"line $1" was appearing to reference a single word within a textedit box, so I was trying to step through the words to trigger off midi/samples.

Taking the advice that this is a stupid way of doing it ("When using #n or $n, Max will only substitute the first 9 items"), I’ve copied some code from elsewhere, which literally chooses the entire line, then broken it down to words and letters by using zl.slice and listfunnel.

That seems like a much more elegant solution.


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