Noob Question – Pack Object

Apr 11, 2007 at 10:39pm

Noob Question – Pack Object

Hello

I know this is a noob question, so please bare with me. As far as I understand, the Pack object allows you to turn a bunch of numbers or symbols into a list. What I don’t understand about the Pack object are the numbers that follow the Pack object. For example, in the picture I have attached, I have circled in red my problem. In one of the objects in that attachment, I have an object “pack 1 2 6.5″ and another one “unpack 0 0 0″. What do the “1 2 6.5″ and “0 0 0″ mean ?

[img]index.php?t=getfile&id=581&private=0[/img]

Thanks
-Jon-

#31316
Apr 11, 2007 at 10:59pm

As the help file states, “the arguments set the types and initial values of the list items”.

What this means…

- the “type” refers to the data type (integer vs. float). If you set element 2 of your list in [pack] to be an int, and then send the object a float value for that element, it will be truncated to an integer.

- the “intial values” are the default numbers that will come out of pack. so, in the help example, if you click on the leftmost number box going into the pack object and change it, the output will still be a 3 element list, with 2 and 6.5 as the 2nd and 3rd members.

- also keep in mind, the number of arguments determines how long of a list the [pack] and [unpack] objects will be expecting to deal with.

hope that helps,
/dan

Quote: icu222much wrote on Wed, 11 April 2007 16:39
—————————————————-
> Hello
>
> I know this is a noob question, so please bare with me. As far as I understand, the Pack object allows you to turn a bunch of numbers or symbols into a list. What I don’t understand about the Pack object are the numbers that follow the Pack object. For example, in the picture I have attached, I have circled in red my problem. In one of the objects in that attachment, I have an object “pack 1 2 6.5″ and another one “unpack 0 0 0″. What do the “1 2 6.5″ and “0 0 0″ mean ?
>
> [img]index.php?t=getfile&id=581&private=0[/img]
>
> Thanks
> -Jon-
—————————————————-

#101607
Apr 11, 2007 at 11:23pm

Bearing with you… :)

As the help file you helpfully included states, for pack, “the arguments
set the types and initial values of the list items.” There are a few
basic types of data in Max which should be well-explained in the
“Tutorials and Topics” and “Fundamentals” (aka “Getting Started”) PDF
documentation.

In the help file, the arguments for pack are “1 2 6.5″. This means the
input for the first inlet will be considered an int (integer), as will
the second inlet’s input, and the input for the third inlet will be
considered a float (floating point, decimal). Note that in Max, “1.”
means one, but it’s a floating point one, not an integer one.

Again from the help file, unpack’s arguments are “0 0 0.”. This is the
same order as the pack which precedes it: int int float.

The different data types are very important to understand. I suggest
you go over the explanations for them until they begin to make sense.
Otherwise you may seem to get through things ok, but without the
understanding I guarantee you will have a number-type problem in the
future.

For an intimidating introduction to the perils of numeric type-
carelessness (and even some of the perils of numbers inside computers in
general), search the archives of the forum (using Google/etc) for the
phrase “floating point precision”.

Hope this helps…

#101608
Apr 11, 2007 at 11:48pm

Hello

Thank you very much Dan and Dlurk :)

Thanks Again,
-Jon-

#101609

You must be logged in to reply to this topic.