M4L Tutorial: Beginning Max 1 1/2 - Message Ordering

 

This is a short but extremely important tutorial. This tutorial illustrates the importance of message ordering within Max. If you do not view any other tutorial before you start programming in max, you should at least view this one. Understanding message ordering and object positioning can save you an immense amount of time in troubleshooting.

Check out the Video after the jump

 

max4live.info tutorial: Beginning Max 1 1/2 - Message Ordering from max4live on Vimeo.

Your rating: None Average: 3 (1 vote)
cassiel's picture
cassiel
Offline
Joined: 10/17/2009
Ordering

Actually, when I teach Max one of my first pieces of instruction is never to rely on message ordering: always use [trigger] objects to enforce firing order so that a patcher is impervious to rearrangement of its contents.

dido (not verified)
Very good post, thanks a lot.

Very good post, thanks a lot.

mchenetz's picture
mchenetz
Offline
Joined: 09/17/2009
Yeah... I agree. But, If

Yeah... I agree. But, If people do not understand this it could hurt them in the end. I agree with triggering though.

cassiel's picture
cassiel
Offline
Joined: 10/17/2009
Agreed...

I tend to teach R-to-L, B-to-T briefly - using a patcher looking very like yours.

The other thing worth pointing out in tutorials is that message firing is depth-first. (Programmers will probably recognise that message dispatching is really just procedure calling.)

Valery_Kondakoff
Offline
Joined: 11/08/2009
The reasons of rtl-btt message ordering behavior?

Does anyone knows what were the reasons (usability, historical etc) to choose the rtl-btt message ordering behavior in Max/MSP?

manuel (not verified)
rtl-btt ltr-ttb ATCG-CGAT

what is ergonomically right for people used to english and similar languages, is reading left-to-right top-to-bottom.

someone should ask to Miller Puckette, AFAIK also when he went open source with PureData, the order hasn't changed.

Other data-flow languages/environments like LabView, Quartz Composer, vvvv execute the graph differently.

una (not verified)
data-flow - object-orientation - functional world

I don't know about LabView or Quartz but this is one of the 'bullets' in "differences between PD and MAX":
- Pd does not conform to the right-to-left ordering of output messages. Instead, outputs will happen in the order they were created. It is expected that users will make use of the trigger object to disambiguate message ordering.

Independently from what the differences between Max and PD are, like Cassiel said one of the first things to remember is:
"never rely on message ordering".
Sure it's really important to know about message ordering anyway, because together with triggers and object behaviors related to the receiving inlets, that's what is needed to read the flow in the patch.

Apart from data-flow, one of the things that it's really never considered in documentation and lessons about Max is how the data-flow programming it's related and/or different to other forms of programming. I have used Max for years but I have to say that I've never managed to do something big with it. Sure you can encapsulate things in patches but this seems like using simple subroutines. I never really grasped how to transport/write a semi-complex object oriented architecture I had in mind inside Max.
It's insane to start making patches and just incapsulate bits and pieces of them when they get too big or when they are used too many times. There must be, like for Object oriented programming, some kind of approach to have an idea of how the architecture will be before starting to deal with bricks and concrete.
I guess that to do something meaningful in M4L devices someone should start talking about the design process.

mchenetz's picture
mchenetz
Offline
Joined: 09/17/2009
I like the idea of a Architecture and Design tutorial...

I definitely think that a Architecture and design tutorial would be great. The problem is that there is no, one way, to work within Max. I like to plan out the architecture of an application. Even when i am programming apps adhoc, I think about what can be encapsulated and used in future programs. I definitely believe in using a lot of sub-patchers in order to create a Max application. I try to modularize everything and encapsulate areas in logical ways. To me, everything is about being able to analyze the flow easily. In large programs I try and make the main patch like a flow chart that just shows the sub-patchers within it.

Tips and tricks in creating legible and organized programs, might be a good tutorial.

Mike

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.
  • You may insert videos with [video:URL]

More information about formatting options