MIDI note counter

ben1000's icon

Hi. I'm new to m4l and need to create a m4l program that counts the number of times each midi note is used to trigger a sample that is assigned to it.
So if for example, if I pressed a G3 on an external midi keyboard 32 times and a C4 22 times at the end of the session I would be able to look at all the samples I had triggered and would know how many times I had triggered the sample on G3 and C4 etc.
Any ideas?

Thanks,
Ben

Roman Thilenius's icon

[route 67 72]
[count]

ben1000's icon

Thanks for that Roman Thilenius!
I understand 67 is obviously G3 and 72 is C4 but because my knowledge of m4l is pretty non-existent I still don't know how to build anything yet.
I'll start the tutorials but I'm currently learning 3 programs at the same time so if it's not too complex could you explain how to set it up?

Many thanks,
Ben

Michael Sperone's icon

If you create the object, you can right click or command click and select "help" and a help patch will open up showing you all the details of how that object is used. It will show you the arguments you can enter, any messages you can send to it, what each inlet and outlet does, etc... If you look at both help files, you'll see how it works. And after doing just the first few tutorials to see how things connect and learn the most important objects, I think this is the best way to learn max - going through help files. Each help file will also show you related objects, so it's easy to learn about new objects that you might want to use.

Mike

ben1000's icon

Hi Mike,

Thanks for the advice. I'll work my way through the tutorials as you suggest which will also give me a good overview of m4l in general.
Cheers,
Ben