Re: right to left order in the folder object ?


Forums > MaxMSP > right to left order in the folder object ?
October 11, 2006 | 3:04 pm

> Is it just a bug, or is on purpose?
> I didn’t find any mention to this in the reference manual.

this is on purpose (there’s been a thread on this before, i think). this
exception to the right->left rule is based on the following usage theory:

1) you tell [folder] which folder to search (via a message).

2) [folder] puts out its series of a ‘clear’ message followed by ‘append’
messages to a [umenu].

THEN

3) [folder] tells you how many items it found via an int out the right
outlet, which you can then use to synchronously start something else (e.g.
a process iterating through the items in the [umenu]).

the principle here is that it’s not very useful to know how many items are
in a folder before you can access what they actually are. if this were
the case you would start stuff going based on the item count only to find
out that, due to that _other_ max rule of depth-first stack execution,
you’re querying things in the [umenu] that haven’t arrived yet because the
left outlet of [folder] hasn’t output the filenames.

if we were to remake the [folder] object again from scratch we’d probably
switch the outlets so that it would have this behavior _and_ follow the
right->left rule. but we can’t, though you could easily make an
abstraction containing a [folder] with this outlets crossed if you feel
this is upsetting the tao of max…

as for documentation, we’ll make a note to put something about it in the
reference page for the [folder] object. thanks for pointing that out.

all the best.

/luke

On Wed, 11 Oct 2006, Vincent Goudard wrote:

> I just noticed after banging my head quite a while on the initialisation
> procedure of a fairly complex patch, that the "folder" object outputs
> first the append messages on the left outlet, ****** then *****
> the number of items in the folder, on the right outlet.
>
> Which appears kind of a crime in the right-to-left-ruled max world.
> but ok, maybe the hidden law in max is not to take anything for granted,
> hehe
>
>
>
>

————————–
R. Luke DuBois
Computer Music Center, Columbia University
e-mail: luke@music.columbia.edu
www: http://www.lukedubois.com
www: http://www.FreightElevatorQuartet.com
phone: (212)-854-9266 fax: (212)-854-9267
————————–