Detecting Collisions

I need to generate OSC or MIDI messages upon collisions between objects. e.g. Collisions between two particles or between a particle and another surface.

Is this possible, and how could it be done?

observe the pstate attribute of the particles (easiest by using a SOPtoDAT)