change sign (positive to negative)?

jamesson's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Is there a faster way of doing this?

Many thanks in advance

AaronMButler's icon

[expr 0-$i1] ?

jamesson's icon

I guess

Cleaner at least :/

Floating Point's icon

why not [* -1.] ?

jamesson's icon

there we go :)

jamesson's icon

BTW, are you implying that [*1] would change type?

broc's icon

I would imply that [*1] is not a Max object ;)

Max Patch
Copy patch and select New From Clipboard in Max.

For handling both int and float without conversion you'd need something like this.

jamesson's icon

broc - thats simply disgusting. Nothing on you, but I cannot stand this type conversion nonsense.

Many thanks for the ! stuff tho, very useful

Roman Thilenius's icon

"[expr 0-$i1] ?"

[expr -$i1] would be much shorter.

-110

Chris Muir's icon

@jamesson — My advice is to either figure out a way to stop being bothered by Max's data type rules, or find a different language that has rules you like better. It's not "disgusting," "nonsense" or "stupid." It's just the way it is, and will probably never change, so learn to tolerate it or move on.

Max was just designed with a different set of assumptions than the ones that you seem comfortable with.

jamesson's icon

@Chris, yes I know my whining is unappetizing :). I like things to make sense, especially when they're made by human beings who should know better :). I'll stop now :).

Chris Muir's icon

But the Max data type rules do make sense. They are consistent, well documented, and loosely based on older standards for strongly typed languages. (e.g. C, C++)

They just don't seem to be based on paradigms that you like.

jamesson's icon

If by "like" you mean "expect them to relate directly to real math", then, yes I do not "like" them.

IMHO having to relearn math to learn programming is kind of a bummer.

Chris Muir's icon

As would be having to relearn programming if learning to program Max. (if coming from a strongly typed language)

jamesson's icon

And there's the rub. I'd like to have Max be as accessible to non-programmers as possible. I know that's not in the roadmap, but that's my preference.

Chris Muir's icon

I understand that (from a beginners POV), but at this point in time, I'd rather Max be compatible with the decades of Max patches in existence.