Accum

Gary Lee Nelson's icon

Does anyone use accum? One of my students found it and used in his first
patch. It doesn't seem to do what I expected and the help and manual don't
help or man...Is it me or is funky?

Cheers
Gary Lee Nelson
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson

swieser1's icon

it's a pretty basic object. it's cleaner than using a bunch of [int] and [+] and [*] objects.

try opening the help patch on it. send a value into the left inlet, and that will set (and output) the "initial value" stored in the accum object. then, send a value into the middle inlet. that value will be added to the "initial value", and then that sum will be stored as the "current value". however, nothing is output until it receives a bang in its left inlet. similarly, values sent into the right inlet will multiply the current value.

if your confusion comes from the fact that nothing is output when the object's value changes, then try using a [t b i] object to trigger a bang to the left inlet whenever a value is sent to the middle or right inlets.

-scott

David Beaudry's icon

I've used it a few times. It's like a very odd counter. The trick is
you have to always send a value to the center inlet (the amount you
want to add to the "accumulation", then bang the left inlet to get
the result. e.g.

Max Patch
Copy patch and select New From Clipboard in Max.

David

On Feb 22, 2007, at 3:31 PM, Gary Lee Nelson wrote:

> Does anyone use accum? One of my students found it and used in his
> first
> patch. It doesn't seem to do what I expected and the help and
> manual don't
> help or man...Is it me or is funky?
>
> Cheers
> Gary Lee Nelson
> Oberlin College
> www.timara.oberlin.edu/GaryLeeNelson
>
>

Gary Lee Nelson's icon

Ah, then it IS funky! The manual should say in big red letters that, unlike
all other max objects inputs to the right must happen before action at the
left-most inlet causes output. I learn once again that blind faith is
dangerous. :-)

On 2/22/07 6:49 PM, "swieser1" wrote:

>
> it's a pretty basic object. it's cleaner than using a bunch of [int] and [+]
> and [*] objects.
>
> try opening the help patch on it. send a value into the left inlet, and that
> will set (and output) the "initial value" stored in the accum object. then,
> send a value into the middle inlet. that value will be added to the "initial
> value", and then that sum will be stored as the "current value". however,
> nothing is output until it receives a bang in its left inlet. similarly,
> values sent into the right inlet will multiply the current value.
>
> if your confusion comes from the fact that nothing is output when the object's
> value changes, then try using a [t b i] object to trigger a bang to the left
> inlet whenever a value is sent to the middle or right inlets.
>
> -scott

Cheers
Gary Lee Nelson
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson

raphaelseguin's icon

gimmee back my patchcords you thiefs !!!

OK OK there must have been some copypaste mistake from me ;-)

Thanks for your answers anyway.

Here is the real thing (makes more sense) :

Max Patch
Copy patch and select New From Clipboard in Max.

Chris Muir's icon

At 8:21 PM +0200 4/1/07, raphael seguin wrote:
>gimmee back my patchcords you thiefs !!!

OK, that _is_ strange. It seems like accum, after a certain point, refuses to acknowledge any number less than 16. (in your example it comes after processing step 31)

Here's your patch set up for single stepping with a bunch of debugging stuff scattered around. This version runs until the accum number and the + number are different. You notice that once it breaks (at step 31) accum is a little wacky. You can bang in numbers < 17 with no output, but numbers >= 17 cause output, as normal.

Max Patch
Copy patch and select New From Clipboard in Max.

--
Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." - Brian Eno

raphaelseguin's icon
_j's icon

I use accum all the time...

pajzd's icon

thnx guys, the year=2024 &&& i wanted an alternative for accum but in audio rate

that's when i saw plusequals~ exist ( accum~ too in gen i know, being sample precise !)

to check its behavior , to transpose it into pd & why ?
because pd can open a patch & make off-line recordings

now, this would be nice in max msp too, like ok i want 20 minutes of this patch

POEFFF or BANGGG, there you have it,

a posteriori you analyze what you're recording is all about

luvelyyyyyy, no ?

alt_accum.maxpat
Max Patch

Roman Thilenius's icon

not sure what your question is, but i can try guessing.

in MSP, building a custom +=~ patch might be impossible or difficult because you can´t make a loop with only 1 sample delay.

in PD it is theoretically possible with a blocksize of 1 and fexpr~.

no idea why pd-extended does not have +=~. it lacks so many things. :)

but max can do offline signal processing, too - in case that is the motive behind the idea.

pajzd's icon

no question, just sharing :) mais merci pour les réponses en tout cas

pd has plusequals~ btw

"but max can do offline signal processing, too - in case that is the motive behind the idea."

really, it might be off topic, but could you tell us, how to do offline signal processing in max ???
am trying to convert a max to pd patch, becuz of this, but i'd prefer stay in max of course ...
i got suggested to record in highest fs (sample rate) possible ... but yeah that's not really offline

Roman Thilenius's icon

aha, so i understood the second part right.

how to do it:

you would switch to the NRT driver as ouptut source.

if you are clever, you save all the DSP settings current configuration before you do that, otherwise they might get lost.

if you need max messages (you usually do), you must have audio interrupt also turned on, or the scheduler will not be present at all under NRT.

various file I/O operations will work as normal, but be careful with the higher speed in NRT when CPU consumption was very low before in realtime.

you can not only save time with NRT, you can also use NRT to artificially make stuff running slower as in realtime - i do this when writing dozens of tracks on an old computer.
to do so you can utilize a small poly~ patcher which does nothing but eating up 150% realtime CPU.

pajzd's icon

waw this = amazing ! :) yeah max was clever enuff to remember settings

thnx for the advice ,, worked in pd (off-gui, in terminal) & in max (while program was open)

i wonder if one can also open max in nrt mode from terminal & just let it process the audio from outside ...

Roman Thilenius's icon

well you can contact mr. and mrs. max via MIDI or network protocols at any time to give orders from outside the house.

i would not let it run in NRT mode all the time, it is easier to switch in and out.