gen~ phase accumulator problem

Mattebass's icon

Hello,
I've just begun to work on gen~, so probably my question is not so brilliant. I was looking to the example gen~.pulsar and I can't really understand the role of the object counter to accumulate the phase. As the object receive no signal, but only a param, I can't grasp why the result It's a number that ramp between 0 and 1 (..the phase!!); I would expect a constant value from that calculation...Probably there's something very fundamental of gen~ that I'm not able to understand

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

thanks

geddonn's icon

The first inlet of the counter object takes the number to be added per sample.

So if you send it 0.1, every sample 0.1 will be added to the count.
The first argument limits this so that it wraps between 0. and 1.

Mattebass's icon

thanks for the answer, but my problem It's about the fact that counter is receiving a parameter, that should be a constant. Because, reasoning as a max-er, the envelop is generated after the counter. So, about what you have said to me, where are the samples that made the counter to increment ?

thanks

stkr's icon

"where are the samples that made the counter to increment ?"

they are always there, incrementing away. the gen~ graph is 'always on', constantly incrementing at 1 sample at a time. the moment counter receives any non-zero into it's first inlet, the incrementing will start. also, you have given counter an argument '1', which means it will wrap whatever the increment value is by 0. -> 1. .

your counter is constantly incrementing whatever your param constant is, at a rate of 1 sample @samplerate.

is that what you are wondering? (it seems your patch works fine).