Forums > MaxMSP

If object using text

September 8, 2011 | 12:49 am

Brand new at this. My first question is what exactly is the term for letters in Max/Msp? Numbers are integers or abbreviated as "i" but what are letters and what is their abbreviation?
I’m also attempting to have a text input box that outputs the users text into an "if" or "else" system of objects that depending on what the user inputs has different outcomes. For example, say the user types in the sentence "pitch a tent". If anything other than that exact sentence is typed in, I would want the patch to output the text "error". But if that exact sentence is typed in, I would want the patch to output the text "tent pitched"


September 8, 2011 | 3:25 am

Hello and welcome!

I use l to represent a list of numbers/words/whatever or s to represent a symbol "something in quotes".

Use tosymbol and fromsymbol to convert between a list and a symbol. I assume that is the correct way to go.

remember that route discards the prefix unless it does match anything, otherwise it sends out the whole string to the rightmost outlet. In this case, you could use the sel object in it’s place. It should do the same thing as route if you are not sending it a list.

Here is a patch that does what you describe:

I checked the option for textedit that tells it to output as one symbol for this patch, otherwise it will output a list of the words (no quote marks). Use inspector to set these things.

– Pasted Max Patch, click to expand. –

`


September 8, 2011 | 4:40 am

yeah, we call it "symbol" when it is not a number.

[if] will not work with symbols or lists, but you can compare two symbols against
ech other for example using the [zl] object, which is able to treat a symbol as
data type "list with one element".

other objects you should look into are the comparison operators ([==]), [regexp]
and [sprintf].

-110


September 8, 2011 | 8:11 pm

Awesome, thank you so much for the help!


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