(Probably easy) Beginners Question about Objects and Arguments

10ff's icon

Dear all,

I have a, probably, easy question. If I want to give an object, let's take the play~ object, certain arguments in its box but want to leave others open, how do you do that? For instance, I want to tell the play~ object to have 2 channels, but I don't want to define a buffer name to play for it from the beginning. The problem here is that the channel argument is on 2nd place so I have to tell Max that this is supposed to be the channel argument by mentioning a placeholder name as the buffer argument.

Is there a more elegant way to do this?

Thanks a lot in advance!

Andre

Jean-Francois Charles's icon

Nope, you cannot do that. When using arguments, the place/order are fixed. The more flexible way is attributes. Jitter objects use them by default, but not all Max objects use attributes.
In the case of [play~], you can see in the reference that the buffer~ name is mandatory, though.
J-F.

10ff's icon

Thanks J-F.

That's annoying. The point is that I definitely know the number of channels play is supposed to have, but the buffer will be defined at runtime via the set (buffer) message. I cannot define the number of channels via a message. Mhmpf.

Peter Castine's icon

So just use a placeholder/dummy value for the argument you don't care about. Whatever the default value is will do nicely.

You'll see dozens of examples where this is done.

It's not costing you anything more than typing a few characters. Is that a big deal?

10ff's icon

No, it's not a big deal. I am doing that at this moment. If you would've read my post more carefully it would've been clear that I was asking for an elegant way.

Peter Castine's icon

The alternative is attributes, to the extent that the object you want to use is attribute-savvy.

Whether or not that is more 'elegant' is a different question.

Those are all the options you get, though.