Forums > MaxMSP

documentation

June 6, 2012 | 9:03 pm

What is the difference between arguments, messages and attributes?

And why do the types (int, float, list, setloop) bear no resemblance to types in modern programming languages?

I am looking at the groove~ documentation at the moment and trying to work out if I can make it loop from the loop start without starting from the start of the sample.

I started to drill into the docs and found it all very confusing/inconsistent.

Or am I just stupid?


June 6, 2012 | 9:04 pm

for instance in the right click object help for groove~ it shows a -1 message going into a sig~ and saying that it makes it go backwards.

But I tried this and it doesn’t make it go bacwards at all!


June 6, 2012 | 9:11 pm

-1 into sig only seems to make it go backwards when you start it with startloop (found this by error and trial).


June 6, 2012 | 11:35 pm

not sure I understand the problem. The number going into sig~ determines the playback speed not loop start/stop. I agree though the references can be confusing until you get the hang of them.

– Pasted Max Patch, click to expand. –

June 7, 2012 | 12:22 am

An argument is some data entered into an object’s box after its name

A message is some data sent into an inlet

An attribute is a property set in the inspector.

General suggestions (from somebody who complains about this stuff all the time)

- The datatypes (afaik setloop is not a datatype, I think this is a message you send to groove~) are inherited from C/Lisp. They have not been updated since the dawn of Max to preserve compatibility. A number of "modern" languages still do strict static types, which is a pain in the ass as far as I’m concerned.

-Max is not a programming language. This fact still trips me up a lot more than I would like. The best way to think of it imo is as a bunch of DLLs and a thing to load them. The objects in and of themselves are "programs". In this way of thinking,

-Messages are inputs to a running program
-Arguments are commandline parameters
-Attributes are settings in a config file loaded when the program starts

Think of an OS and daemons/services. A daemon/service sits in ram and waits for some input. If the input is what it expects it does what you want, if the input is not what it expects it does something other than you want.

Do not be fooled by the fact that you can change these on the fly. This simply means that max "reloads" this stuff quick enough that you don’t notice.

Check out the tutorials. In particular, until you understand message structure and message wildcards ($whatever) your progress will probably be slow.


June 7, 2012 | 11:19 am

Check this http://cycling74.com/docs/max6/dynamic/c74_docs.html#groove~

In the messages section there are things that seem to suggest the type of the message such as int and float (because sending these as literals surely does nothing useful).

But in this same messages section underneath the int and float we have setloop etc..

Which I would have thought are strings.

This is confusing – maybe it should have the heading – allowed values and leave off the int, float stuff.

And what does ‘anything’ mean in this context? You can put anything in there and it does something useful? Surely not.

Thanks for the distinction on the messages, arguments and attributes and also for the information on dlls versus language.

Are there any tutorials/documents on the design of the max/msp system?

For someone like me this would help – I didn’t know it wasn’t a programming language – messages make much more sense in this context!

thx


June 7, 2012 | 4:28 pm

This is straightforward. Int is a message consisting of nothing but an integer. Float is a message consisting of nothing but a float. setloop is a maessage consisting of the string "setloop" followed by two numbers.

Arguments to a message are anything following the message "name". Again, find the tutorial that talks about $ in messages – it’s one of the early ones.

Make a message that says setloop $1 $2. Connect a message with two ints to the setloop message’s left inlet and a blank message’s right inlet to setloop’s outlet. Ctrl+click the two int message. See what happens?

Anything containing more than 1 item (string, int, float, whatever) qualifies as a list.

In the context of "groove~", "anything" means that any symbol followed by 3 ints will be handled as a command to the transport. This enables patches to be more easily understood by allowing users to arbitrarily name cue points.


June 7, 2012 | 4:35 pm

Yeah I know what ints and floats and lists are (in ‘normal’ programming) but in the context of the documentation what is the literal string ‘anything’ supposed to mean?

Why is the documentation structured like this?

Mixing up what seem to be data types with a type called ‘anything’ seems to be always contradictory.

Normally you say that the type of an input can be of some type to show the user of the object (dll, script, small program, applet call it what you will) that it will not accept a string in this place or that if you supply a float in the case of type int any decimals will be lost.

What the documentation seems to suggest to me as a professional computer programmer of more than 20 years is that if the type of the variable is ‘int’ then it surely cannot be ‘anything’!


June 7, 2012 | 4:51 pm

Dude, seriously, they’re not datatypes. They’re inputs. Your email daemon does not recognize datatypes. It doesn’t care if your email address is composed of letters, numbers, or ancient egyptian heiroglyphics. It looks at the address, parses it to the best of its ability and tries to use it to deliver the message. If it fails, it says so. Same with your dns. Sure, it needs some help to go from a numerical ip to an alphanumerical url, but _even if it doesn’t get that help_ it doesn’t complain of a type miscast, it simply says "I couldn’t resolve this URL/IP" and continues to go about its business, waiting for a url or IP it actually can resolve.

The helpfile explains the inputs that groove~ will handle, and how it will handle them. In some cases, the inputs are consistent with generally-recognized datatypes. In others, they consist of a symbol (alphanumeric string), specified in the helpfile (such as setloop), followed by some other stuff (arguments). Therefore a valid setloop input may look like "setloop 1 2".

Your programming experience is only mildly useful here. If you truly cannot progress without understanding this from a programming perspective, download the max sdk. It contains c code for everything. However, I would strongly urge you to go through the tutorials first.


June 7, 2012 | 5:03 pm

Yes, but that will take maybe longer :). IMO it’s probably better that he understand the Max nature first :).


June 7, 2012 | 5:13 pm

I went through a lot of the tutorials – not difficult to understand and are quite useful.

All I am saying is that the documentation imo is confusing.

That’s my opinion – probably because of what I do – other people don’t seem to complain so much.

Again in my opinion I would prefer not to see words like int and float mixed with words like anything because of their historic significance for programmers.

Anyway, it seems I am very much in the minority – so I will shut up and just get lost.


June 7, 2012 | 5:45 pm

halsallian, Dont get me wrong, I have a lot of the same problems you do (strict static typing in particular) but I would disagree with you on this. If something in my computer is called a "tree" I will not complain because it is not brown with green leaves on it. Simply because some messages share names with datatypes does not mean that the entire system works in a datatype paradigm. Some of it does, and some of it doesn’t.


June 7, 2012 | 7:07 pm

I think it’s depend on what "Max Object" that you’re working with.
and don’t thinking "int,float,list,etc.." was datatype but thinking all of them act like name of "function,method,property" then i think you get & clear all of them .


June 7, 2012 | 7:18 pm

I know I said I was bowing out but if the meaning of the documentation depends on the object that’s a worry!


June 7, 2012 | 8:34 pm

it does not, you’re likely to meet again that mysterious "anything" elsewhere in the documentation


June 7, 2012 | 8:46 pm

Nope, the meanings of all the terms are consistent, even between messages and objects. An argument is always an argument. A property is always a property. A message is always a message.

"Anything" is a wildcard. Messages are never typed. Their contents are, but not the "containers".

The more you cling to programming paradigms, the more painful the transition will be for you. This is not coding, this is sysadmin. Somewhere between connecting stuff together you maybe write some code, but mostly you simply make sure that everything is talking to each other correctly, changing config files, and routing data.


June 7, 2012 | 11:04 pm

are you sure the meanings of all terms are consistent?

have I found perfection at last?


June 8, 2012 | 6:08 am

Sure, only not between programming and Max :).


June 9, 2012 | 12:48 pm

anything is like object,id ….. you can custom cast to whatever you want


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