Easy way to count number of repetitions of a number?
Hi all,
I am analyzing the MIDI pitch of audio files, and I have a stream of integers (MIDI) coming out. I have devised a way to sense if a particular number lasts for a certain amount of sound, but I'd also like to detect if a particular pitch is repeated many times, even if it doesn't last long.
I could imagine the number object connecting to something that spits out every number that's been repeated 100 times, etc.
Is there a way to do this using vanilla Max?
Thanks!
There are many ways to do so, but it depends where and how you want to collect and display infos.
One option would be to store number of repetitions and length of each note in a coll and display it using jit.cellblock.
If you are interested only in notes that repeated nn number of times,
you could use zl group set to nn, which would then report when it gets filled.
Or trigger counter object to monitor number of repetitions for each note ...
and so on
Thanks. I don't need to see the count -- I only want it to trigger a bang when any given number 0-127 exceeds X repetitions. That's a good idea about using zl groups -- I was hoping there might be a more efficient way to do it than creating 128 separate things, but maybe I just need to make that as an abstraction. Sigh!
If that is exactly what you need :
this will bang if any note exceeded set zl len size
thank you! i will check it out. i am realizing now that i may need it to spit out the numbers themselves but this will be useful too. so appreciate your taking the time to make this!