[solved] Report elapsed sample time between two events

Handsonicsuki's icon

Hi,

What is the easy way to report elapsed sample time between two events like timer object? My patch seems work to some extent but I want to know whether there are more simple way.

Martin Olavarria's icon

Hi!

Yes, the [timer] object :)

Handsonicsuki's icon

Thank you for sharing, and sorry for the lack of explanation.

Time resolution of milliseconds by timer object is not enough for controlling buffer at my purpose since 1ms is 48samples.

So, I want to know easy way to confirm the interval by sample counts.

Martin Olavarria's icon

Right, you mentioned timer hehe

If samples is what you're after then gen~ is the way to go, you can find an [elapsed] object as part of the gen system. Maybe build on the logic you already have.

I have a lot of gen~ study to do myself.

TFL's icon

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

Using [cpuclock] is more precise than [timer], but if you want an actual sample count, probably go with what Martin suggested.

Alex Norman's icon

timer outputs fractional ms which you can then convert to samples via mstosamps

Handsonicsuki's icon

What a noob I am! I hadn't realized that timer outputs a floating number of milliseconds since I've connected it to a number(i) when I test. Thank you so much!