Forums > MaxMSP

Add more numbers

March 29, 2009 | 9:17 pm

Hello,
could not find help on the forum (prev messages), though it might be too easy:

Is there a smarted way of doing this?
Thank you!
Krisztian

{
"boxes" : [ {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 20.0, 239.0, 50.0, 20.0 ],
"id" : "obj-10",
"fontsize" : 11.595187,
"numinlets" : 1,
"triscale" : 0.9,
"presentation_rect" : [ 149.0, 477.0, 50.0, 20.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"patching_rect" : [ 20.0, 212.0, 290.5, 20.0 ],
"id" : "obj-8",
"fontsize" : 11.595187,
"numinlets" : 2,
"presentation_rect" : [ 146.0, 449.0, 0.0, 0.0 ],
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"patching_rect" : [ 20.0, 177.0, 235.5, 20.0 ],
"id" : "obj-9",
"fontsize" : 11.595187,
"numinlets" : 2,
"presentation_rect" : [ 146.0, 414.0, 0.0, 0.0 ],
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"patching_rect" : [ 20.0, 148.0, 180.5, 20.0 ],
"id" : "obj-7",
"fontsize" : 11.595187,
"numinlets" : 2,
"presentation_rect" : [ 147.0, 386.0, 0.0, 0.0 ],
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 291.0, 18.0, 50.0, 20.0 ],
"id" : "obj-3",
"fontsize" : 11.595187,
"numinlets" : 1,
"triscale" : 0.9,
"presentation_rect" : [ 418.0, 256.0, 50.0, 20.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 237.0, 18.0, 50.0, 20.0 ],
"id" : "obj-4",
"fontsize" : 11.595187,
"numinlets" : 1,
"triscale" : 0.9,
"presentation_rect" : [ 364.0, 256.0, 50.0, 20.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 182.0, 18.0, 50.0, 20.0 ],
"id" : "obj-5",
"fontsize" : 11.595187,
"numinlets" : 1,
"triscale" : 0.9,
"presentation_rect" : [ 309.0, 256.0, 50.0, 20.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 129.0, 17.0, 50.0, 20.0 ],
"id" : "obj-2",
"fontsize" : 11.595187,
"numinlets" : 1,
"triscale" : 0.9,
"presentation_rect" : [ 202.0, 334.0, 50.0, 20.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"patching_rect" : [ 20.0, 113.0, 127.5, 20.0 ],
"id" : "obj-1",
"fontsize" : 11.595187,
"numinlets" : 2,
"presentation_rect" : [ 137.0, 367.0, 0.0, 0.0 ],
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 75.0, 17.0, 50.0, 20.0 ],
"id" : "obj-16",
"fontsize" : 11.595187,
"numinlets" : 1,
"triscale" : 0.9,
"presentation_rect" : [ 15.0, 15.0, 50.0, 20.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 20.0, 17.0, 50.0, 20.0 ],
"id" : "obj-17",
"fontsize" : 11.595187,
"numinlets" : 1,
"triscale" : 0.9,
"presentation_rect" : [ 15.0, 15.0, 50.0, 20.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 20.0, 84.0, 50.0, 20.0 ],
"id" : "obj-25",
"fontsize" : 11.595187,
"numinlets" : 1,
"triscale" : 0.9,
"presentation_rect" : [ 15.0, 15.0, 50.0, 20.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"patching_rect" : [ 20.0, 53.0, 73.5, 20.0 ],
"id" : "obj-26",
"fontsize" : 11.595187,
"numinlets" : 2,
"numoutlets" : 1
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-8", 0 ],
"destination" : [ "obj-10", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-3", 0 ],
"destination" : [ "obj-8", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-4", 0 ],
"destination" : [ "obj-9", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-7", 0 ],
"destination" : [ "obj-9", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-9", 0 ],
"destination" : [ "obj-8", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-7", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-7", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-2", 0 ],
"destination" : [ "obj-1", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-25", 0 ],
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-16", 0 ],
"destination" : [ "obj-26", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-26", 0 ],
"destination" : [ "obj-25", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-17", 0 ],
"destination" : [ "obj-26", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
]
}


March 29, 2009 | 9:33 pm

Below is one approach. Also read the sticky notes on posting examples. Copy compressed is the way to go.

_
johan

– Pasted Max Patch, click to expand. –

March 29, 2009 | 9:55 pm

Copy compressed! got it now and also thank you for the example!
best
Krisztian


March 29, 2009 | 10:01 pm

…huhh the maximum it can take is 9 variables!…

I would like to use it with 16 inlets, thank you.
K


March 29, 2009 | 10:38 pm

Have a look at accum.

_
johan


March 30, 2009 | 1:02 am

or zl sum


March 30, 2009 | 10:15 am

hello Emmanuel and jvkr
thank you!
K


March 30, 2009 | 5:04 pm

You might also want to look at lp.sigma & Co. for multi-value addition, multiplication, subtraction and division.

In addition to everything else, all inlets in lp.sigma and friends are hot, so you don’t have to [t b i] for updates when the 2nd, 3rd, etc inlet changes.

Sigma is in the Starter Pack (free, but happier with Max 4.x). The friends (delta, pi, and logos for subtraction, multiplication, and division respectively) are in the Max-5 savvy Litter Pro.

Best,
Peter


March 31, 2009 | 8:55 am

Peter

yes, sigma does the job, and the others look good as well. Will have to try them…

thank you.
K


April 1, 2009 | 12:43 pm

I previously overlooked the requirement of >9 inlets. In that case you’ll love lp.sigma. On Max 5 I’ve instantiated over 960 inlets (at which point I started to lose count). This is a little insane for patching, but someone will want to do it.

Max 4 limits argument lists to 255 items, but that’s Max 4′s limitation.


April 1, 2009 | 1:46 pm

Or the jitter way, to add even more values.
Jean-François.

– Pasted Max Patch, click to expand. –

April 2, 2009 | 10:24 am

The Jitter patch is cute, but only works for positive sums (otherwise the rounding is wrong) and requires a lot more objects and patch cords than this:

– Pasted Max Patch, click to expand. –

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