I am currently working on a patch that can detect when pitch clashes occur via MIDI in a DAW project. By this I basically mean a "clash" to be whenever the exact same MIDI note is being played at the same time on 2 separate MIDI channels, if MIDI channel 1 is playing a "C2" and MIDI channel 2 is playing "C2" simultaneously then this would be a clash. My idea is that MAX will timestamp any clashes whenever they occur with the user able to view the results before deciding if these clashes could be causing any potential frequency problems in their arrangement (building up of frequencies in one area etc.), however, I do understand that this isn't always a problem and can sometimes be desirable. My plan of action is to get the patch working with just 2 channels to start with although I seem to be at a bit of a hurdle.
By utilising External MIDI channels "using Logic Pro X" set to "MAX 1" (channels 1 and 2) I have managed to get MAX to recognise what notes are being played in the DAW and SOMETIMES detect when a clash is occouring. These clashes are recorded in the "coll" object at the end of the patch along with the amount of time passed taken from the "clocker" object. As far as I can tell the patch should be fully working, however, I am obviously missing something so I was hoping someone would be able to lend a hand!
On a side note am I right in saying the clocker object works in milliseconds? If so then does anyone have any idea how I would go about converting these milliseconds to the bars and beats / BPM of my logic project? With that being said I wish to try and get the fundamentals of the patch above working before i look into this, however any insight would be useful for the patch further down the line.
Thank you for your time!