Don't understand isRange(int low, int high, int threshold) of Minim Library

1.1k views Asked by At

I've seen a lot of programs with the function isRange(int low, int high, int threshold) but I can't understand how it works.

The doc says:

In frequency energy mode this returns true if at least threshold bands of the bands included in the range [low, high] have registered a beat. In sound energy mode this always returns false.

Why I can't put an high value greater than 27?

1

There are 1 answers

0
Murilo On

In the benoit link, there is a nice quote about the problem which is:

So when you say isRange(5, 20, 10), you are saying, "Look at the boolean values in the onset array in the range of 5 to 20. If at least 10 of those are true, then return true."

If your main question is why you cant put a value higher than 27 for the threshold, maybe it is because the range between your lower value and your higher value is smaller than 27.

To understand the isRange() function, it would be great to understand first some beat detection concepts and problems. You can find something here:

http://code.compartmental.net/tools/minim/manual-beatdetect/

I hope it can help you!