Forums > MaxMSP

Problem with counting samples

Dec 22 2011 | 11:53 am


I want to count the elapsed samples from the start of an audio signal until a defined threshold is exceeded. The Threshold recognising works fine, but i have a problem with the counter.
I use the [count~] object in combination with the [snapshot~] object, because i want the result displayed in a message.

So here is what i did:

-- Pasted Max Patch, click to expand. --

(The bangs and the stop messages are triggered by the threshold patch)

Why doesnt that work? Is there another way to do this?

Dec 22 2011 | 2:25 pm

It doesn’t work because number~ doesn’t work the way you expect it.
This may help you:

-- Pasted Max Patch, click to expand. --

Dec 22 2011 | 3:00 pm

Thank You!
That was easier than expected :)

Dec 22 2011 | 5:02 pm

Thanks to Patrick, i could solve my problem, but now i have another one:

I finished the patcher and it does, what it should but way too inaccurate!
The variation of the meassured predelay is around 600 samples! I was hoping i could reach an accuracy of maybe +-5 samples. Is this utopian in Max, or am i doing something wrong again?

Here is my patch:

-- Pasted Max Patch, click to expand. --

First i used an sfplay object to play the audio file, so i thought the problem would be the slow hard drive and implemented a buffer.
It didnt help at all…

Any ideas?

Dec 22 2011 | 6:20 pm

If you need sample accurate measures, you need to stay in the MSP domain (even the time needed for a Max message like stop will take a lot of samples!). I don’t have Max5 at hand now, so I can’t check your patch.


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

Forums > MaxMSP