We have defined an inlet for the detector object which is dedicated to input played flow: We recieve a list with (pitch, velocity) for notes-on, and (pitch, 0) for notes-off. The associated function detector_get_played has just to get those values, and to check if received event is a note-on or a note-off by checking velocity value.
Time of incoming event is calculated by the function, refering to initial time when first note was played.